DRUPAL 7 – OVERRIDE THE FACEBOOK CONNECT LOGIN BUTTON THEME

Public

For those who wants to override that Facebook Login template, add the following function in your theme template.php and and customize it as u wish. uses FB connect module. source: http://eureka.ykyuen.info/2012/06/21/drupal-7-override-the-facebook-conn...

Get raw version
php
  1. function theme_fbconnect_login_button($variables) {
  2. $op = $variables['op'];
  3. $user_profile = $variables['user_profile'];
  4. $text = $variables['text'];
  5. $attr = $variables['attr'];
  6. if ($op == 'login') {
  7. $url = url('fbconnect/register/create');
  8. $title = t('Hello %name', array('%name' => $user_profile['name']));
  9. $desc = t('Login to this site using your Facebook credentials.');
  10. $link = '<a href="/fbconnect/register/create" class="fb_button fb_button_' . $attr['size'] . '"><span class="fb_button_text">' . $text . '</span></a>';
  11. $button = '<button onclick="location.href=\'' . $url . '\'" id="fblogin" type="button">Log in</button>';
  12. return '<h3>' . $title . '</h3>' . $desc . $link;
  13. }
  14. else {
  15. $attr['data-scope'] = "email";
  16. $button = '<fb:login-button ' . drupal_attributes($attr) . '>' . $text . '</fb:login-button>';
  17. return $button;
  18. }
  19. }