This CodeLet will add a facbook connect button to your login / registration form. Using the CSS, you can change the appearnce of the login block/page. This CodeLet also uses Ajax login/register module. Please make sure you have all the require modules and libraries installed before you using this CodeLet.
CodeLet
<?php/** * @filesource * * Different customization & enhancements to existing features for Channel portal * * @param $form * @param $form_state * @param $form_id * DrupalD <http://twitter.com/DrupalD> *//** * Implementation of hook_form_alter * * @param $form * @param $form_state * @param $form_id * DrupalD <http://twitter.com/DrupalD> */function channel_utils_form_alter(&$form, &$form_state, $form_id) { $user_profile = fbconnect_user_profile(); $op = $user_profile ? 'login' : 'register'; switch ($form_id) { case 'user_register_form': case 'user_login': drupal_add_css(drupal_get_path('module', 'channel_utils') .'/fbappear.css'); $attr = array(); if (variable_get('fbconnect_fast_reg', 0) && variable_get('fbconnect_reg_options', 0)) { $attr = array('perms' => 'email'); } $ss__facebook_connect = fbconnect_render_button($attr); $form['login_text'] = array( '#markup' => '<h21>Log in instantly with Facebook</h2>', '#weight' => -50, ); $form['fbconnect_button'] = array( '#type' => 'item', '#prefix' => '<div id="fbbutton">', '#title' => t('Facebook login'), '#markup' => $ss__facebook_connect, '#weight' => -49, ); $form['points_text'] = array( '#markup' => '<li>Share what you love with your friends</li> <li>See the videos your friends want to share</li> <li>Improve your recommendations</li>', '#prefix' => '<ul>', '#suffix' => '</ul></div>', '#weight' => -48, ); $form['fb_divider'] = array( '#type' => 'item', '#prefix' => '<div id="login-divider">', '#markup' => ' ', '#suffix' => '</div>', '#weight' => -47, ); $form['or'] = array( '#type' => 'item', '#prefix' => '<div id="fbor">', '#markup' => '<h2>'. t('OR') .'</h2>', '#suffix' => '</div>', '#weight' => -46, ); $form['name']['#size'] = 40; $form['pass']['#size'] = 40; break; }}?>
Info file details
name = Channel portal Utilities
description = Customization & enhancements to existing features.
core = 7.x
dependencies[] = fbconnect
package = Channel
Modules used