Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Styling the facebook login icon.

Hi there everyone,

I'm looking for some pointers on how to style the default facebook login button. I found a piece of code in the /plugins/Facebook/class.facebook.plugin.php file which im guessing outputs the "Login with Facebook" icon. Ideally i'd like to replace it with plain text.

This is the code im talking about (i might be wrong):

    */
   public function EntryController_SignIn_Handler($Sender, $Args) {
      if (!$this->IsConfigured())
         return;

      if (isset($Sender->Data['Methods'])) {
         $ImgSrc = Asset('/plugins/Facebook/design/facebook-login.png');
         $ImgAlt = T('Sign In with Facebook');

//         if ($AccessToken) {
//            $SigninHref = $this->RedirectUri();
//
//            // We already have an access token so we can just link to the connect page.
//            $FbMethod = array(
//                'Name' => 'Facebook',
//                'SignInHtml' => "<a id=\"FacebookAuth\" href=\"$SigninHref\" class=\"PopLink\" ><img src=\"$ImgSrc\" alt=\"$ImgAlt\" /></a>");
//         } else {
            $SigninHref = $this->AuthorizeUri();
            $PopupSigninHref = $this->AuthorizeUri('display=popup');

            // Add the facebook method to the controller.
            $FbMethod = array(
               'Name' => self::ProviderKey,
               'SignInHtml' => "<a id=\"FacebookAuth\" href=\"$SigninHref\" class=\"PopupWindow\" popupHref=\"$PopupSigninHref\" popupHeight=\"326\" popupWidth=\"627\" rel=\"nofollow\" ><img src=\"$ImgSrc\" alt=\"$ImgAlt\" /></a>");
//         }

         $Sender->Data['Methods'][] = $FbMethod;
      }
   }

Thanks in advance guys !

Comments

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
    edited January 2015
    public function EntryController_SignIn_Handler($Sender, $Args) {
          if (!$this->IsConfigured())
             return;
          if (isset($Sender->Data['Methods'])) {
            $Title = T('Facebook');
    //         if ($AccessToken) {
    //            $SigninHref = $this->RedirectUri();
    //
    //            // We already have an access token so we can just link to the connect page.
    //            $FbMethod = array(
    //                'Name' => 'Facebook',
    //                'SignInHtml' => "<a id=\"FacebookAuth\" href=\"$SigninHref\" class=\"PopLink\" ><img src=\"$ImgSrc\" alt=\"$ImgAlt\" /></a>");
    //         } else {
                $SigninHref = $this->AuthorizeUri();
                $PopupSigninHref = $this->AuthorizeUri('display=popup');
                // Add the facebook method to the controller.
                $FbMethod = array(
                   'Name' => self::ProviderKey,
                   'SignInHtml' => "<a id=\"FacebookAuth\" href=\"$SigninHref\" class=\"PopupWindow\" popupHref=\"$PopupSigninHref\" popupHeight=\"326\" popupWidth=\"627\" rel=\"nofollow\" >'.$Title.'</a>");
    //         }
             $Sender->Data['Methods'][] = $FbMethod;
          }
       }
    
  • @Vrijvlinder, it worked for me. Thanks !

Sign In or Register to comment.