Advertisement:

Author Topic: [TUTORIAL] Use button image for Facebook Connect plugin  (Read 6636 times)

volunteer

  • Full Member
  • ***
  • Posts: 241
[TUTORIAL] Use button image for Facebook Connect plugin
« on: March 08, 2014, 01:51:16 pm »
this tutorial is the result of another thread

thanks Tom and aide2001 for your help.


here it goes:

in your plugins folder look for facebook/index.php

and change

Code: [Select]
    function fbc_button() {
        if( !osc_is_web_user_logged_in() ) {
            echo '<div><a href="' . OSCFacebook::newInstance()->loginUrl() . '">' . __( 'Login with Facebook', 'facebook' ) . '</a></div>';
        }
    }

for

Code: [Select]
    function fbc_button() {
        if( !osc_is_web_user_logged_in() ) {
            echo '<div><a href="' . OSCFacebook::newInstance()->loginUrl() . '">' . __( '<img src="/oc-content/themes/YOU+THEME+HERE/images/facebook_login.gif">', 'facebook' ) . '</a></div>';
        }
    }

you can download the original images from here but notice u will have to resize them to fit your site design:
https://developers.facebook.com/docs/facebook-login/checklist/#brandedlogin

or use the one I attach to this post that doesn't need to be resized for default osclass style:
ALSO ATTACHED SCREENSHOT OF MY SITE TO SEE RESULTS

will post this as tips/tutorial.. saw many people dealing with this issue :)
« Last Edit: June 08, 2014, 02:03:13 pm by volunteer »

tomshaft

  • Hero Member
  • *****
  • Posts: 862
  • Osshaft for Osclass - Add 650 posts to my total
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #1 on: March 08, 2014, 02:22:15 pm »
If you want. Zip your plugin and attached to post.

Tom

pixellegolas

  • Full Member
  • ***
  • Posts: 224
  • zwappa.se
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #2 on: March 13, 2014, 01:12:12 pm »
Thanks! Worked great!

aide2001

  • Guest
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #3 on: March 13, 2014, 03:37:42 pm »
Thanks @volunteer for the post, glad we can help 8)

ventado

  • Newbie
  • *
  • Posts: 13
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #4 on: June 08, 2014, 01:28:29 pm »
Hi,

What about showing the profile pic if you are logged in?

Thanks!

volunteer

  • Full Member
  • ***
  • Posts: 241
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #5 on: June 08, 2014, 02:03:32 pm »
that's a different story, can't help u with it sorry

aide2001

  • Guest
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #6 on: June 08, 2014, 11:18:32 pm »
I used this
function fbc_button2() {
        $user = OSCFacebook::newInstance()->getUser();

        if( $user && osc_is_web_user_logged_in() ) {
            echo '<img src="https://graph.facebook.com/' . $user . '/picture" style="float:right;">';
            //echo '<a href="' . OSCFacebook::newInstance()->logoutUrl() . '">' . __( 'Logout', 'facebook' ) . '</a>';
       
        }
    }

Being that the first button for facebook is to log in or out, I used another function call to show their image. So in facebook plugin index, put the above and where you want their image put <?php fbc_button2(); ?>

ventado

  • Newbie
  • *
  • Posts: 13
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #7 on: June 09, 2014, 05:43:12 pm »
Thanks aide2001. :D

aide2001

  • Guest
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #8 on: June 10, 2014, 12:28:35 pm »
No probs  8)
Did it work for you??

bujuk

  • Newbie
  • *
  • Posts: 8
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #9 on: September 13, 2014, 03:23:46 am »
thanks for the nice twist.  managed to get it works.

just have one small issue.  the button wont appear in the android/smartphone.  i'm using bender by the way.

aide2001

  • Guest
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #10 on: September 14, 2014, 11:48:02 pm »
Have you got the mobile plugin?, there really shouldn't be a problem i have bender theme and all is good.

bujuk

  • Newbie
  • *
  • Posts: 8
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #11 on: September 15, 2014, 01:45:10 am »
So I need to install a mobile plugin ontop of the fb plugin?

I though the header php should be good enough. Ok, i ll try that. Thnks for the tip.

Azman

aide2001

  • Guest
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #12 on: September 15, 2014, 10:50:18 am »
No you dont need mobile plugin.
If you have amended the header.php this is wrong.
You need to amend the facebook index.php with the code to show the image. Thats why mobile is not working

jvpacoin

  • Newbie
  • *
  • Posts: 4
  • Forever Newbie
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #13 on: January 10, 2015, 12:34:56 pm »
Just wanna say thanks for the great tutorial

damansingh

  • Newbie
  • *
  • Posts: 13
Re: [TUTORIAL] Use button image for Facebook Connect plugin
« Reply #14 on: June 24, 2015, 08:00:32 am »
Worked like a charm, How can I control the size of the image shown up???