Skip to:
Content
Pages
Categories
Search
Top
Bottom

Integrating sign in with Twitter or Login with Twitter to buddypress

  • Avatar of bnt76
    bnt76
    Participant

    @bnt76

    Hi all,

    I have just written a tutorial on how to sign in with Twitter on Buddypress over on WPin, it’s rather a long tutorial and I have tried to cover as much as possible with pictures etc check it out on http://bit.ly/d5imku

    Hope you like it,

    All the best

    WPin.me

Viewing 20 replies - 1 through 20 (of 20 total)
  • Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    Cool! Got an example of a user who signed up using Twitter on your site?

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Hmm, testing this. I logged in easy enough but do not like that it adds twitter to the end of username.

    Avatar of r-a-y
    r-a-y
    Moderator

    @r-a-y

    I haven’t tested this, but it looks like you can set the suffix… maybe you can set the suffix blank?

    Although if you do set the suffix blank, I’m not sure if that plugin has a lookup routine to see if there are duplicate usernames…

    Avatar of bnt76
    bnt76
    Participant

    @bnt76

    If you read the post you just delete the suffix and voila it is done.

    MidlandUK and webalista are both signups via twitter for testing, it worked on both occasions. Quick note even if you delete the suffix it will still show in the box in the back end, worry not as it will be deleted from the database.

    Another update it does check for duplicate names!

    Avatar of Gpo1
    gpo1
    Participant

    @gpo1

    Is this for wordpress MU or single with BP and does the user access all the BP features?

    Demo site for this..

    Avatar of bnt76
    bnt76
    Participant

    @bnt76

    You can try it on http://www.wpin.me as I have it up and running.

    Avatar of arnonel
    arnonel
    Participant

    @arnonel

    will it work with WPMU/BuddyPress1.2 ? or is it WordPress/BuddyPress1.2 only?

    Avatar of Gpo1
    gpo1
    Participant

    @gpo1

    @WPin.me, I’ve login using my twitter acc but no avatar displayed and also can you make it as a plugin, so that one does need to hardcode it?

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    There is a function created to pull in your avatar but it only works on a child theme. If you add the function to the default functions.php it throws up errors.

    http://deanjrobinson.com/article/enabling-twitter-avatars-within-buddypress/

    Avatar of Anton
    Anton
    Participant

    @antonrsaopencirclecoza

    I got it working in the parent functions.php file.

    I removed the spaces after the opening <?php and after and inserted the correct tab spaces for the file. Here is it:

    <?php

    function bp_twc_get_avatar($avatar, $id_or_email=”) {

    global $comment, $twc_user_login_suffix;

    if(is_object($comment)) {

    $user_id = $comment->user_id;

    }

    if (is_object($id_or_email)) {

    $user_id = $id_or_email->user_id;

    }

    if (is_array($id_or_email)) {

    if ($id_or_email['object']==‘user’) {

    $user_id = $id_or_email['item_id'];

    }

    }

    if (get_usermeta($user_id, ‘twcid’)) {

    $user_info = get_userdata($user_id);

    $twav_suffix = ”;

    if ( $id_or_email['width'] ) {

    $twav_size = $id_or_email['width'];

    if( $twav_size < 32 ) {

    $twav_suffix = ‘/mini’;

    } else if ( $twav_suffix < 64 ) {

    $twav_suffix = ”;

    } else {

    $twav_suffix = ‘/bigger’;

    }

    } else if ( ‘full’ == $id_or_email['type'] ) {

    $twav_size = BP_AVATAR_FULL_WIDTH;

    $twav_suffix = ‘/bigger’;

    } else if ( ‘thumb’ == $id_or_email['type'] ) {

    $twav_size = BP_AVATAR_THUMB_WIDTH;

    }

    $out = ‘http://purl.org/net/spiurl/’. str_replace($twc_user_login_suffix,””,$user_info->user_login) . $twav_suffix;

    $avatar = “<img alt=’Twitter Avatar’ src=’{$out}’ class=’avatar avatar-{$twav_size}’ height=’{$twav_size}’ width=’{$twav_size}’ />”;

    return $avatar;

    } else {

    return $avatar;

    }

    }

    // Check if Twit Connect exists (since its without it this function is pointless)

    if( function_exists( ‘twit_connect’ ) ) {

    add_filter( ‘bp_core_fetch_avatar’, ‘bp_twc_get_avatar’,10,4);

    }

    ?>

    better yet…download it from here: http://www.antonrsa.co.za/testblog/functions.phps

    On the admin side of the plugin deleteing @twitter didn’t work. Had to manually delete @twitter in the db. Search for “twc_user_login_suffix” and delete @twitter manually. It works 100%

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    yeah, but the file will get over written when you up grade so its best to just create a child theme functions file.

    Avatar of bnt76
    bnt76
    Participant

    @bnt76

    @anton thanks for posting your find!

    @GP01 – unfortunately I am neither a programmer or developer, I am sure someone will evolve this plugin to incorporate Twitter+buddypress in the future.

    Avatar of bnt76
    bnt76
    Participant

    @bnt76

    Oops sorry @arnonel the twit connect plugin is running on single WP install on wpin.me however I believe it may work with WPMU you can only test it out (or hope someone else does!)

    Avatar of billydecola
    billydecola
    Participant

    @billydecola

    I can’t delete @twitter either. How about an update to the plugin?

    Also, I’m having a hard time getting the twitter login to show on the front page. The tutorial written on WPin.me says to look for a certain code which doesn’t exist. Perhaps the plugin has been updated and code changed.

    Anyyhow, if anyone knows how to get it to show on the front page I’d be super happy.

    Avatar of bnt76
    bnt76
    Participant

    @bnt76

    @billydecola send me a message, I may be able to help you.

    Avatar of Rocio Valdivia
    Rocio Valdivia
    Participant

    @_dorsvenabili

    Hi billydecola, I had the same problem, and after a time I noticed that it wasn’t working cause I copied the wrong code:

    <?php if(function_exists(´twit_connect´)){twit_connect();} ?> –> WRONG (it using written accent instead quotation marks)

    <?php if(function_exists(‘twit_connect’)){twit_connect();} ?> –> OK

    Hope it helps.

    Avatar of Rocio Valdivia
    Rocio Valdivia
    Participant

    @_dorsvenabili

    Anyway, the plugin has a bug, cause when I log in my social network using the twit connect buttom it works perfectly and it creates a new user, but if I log out or I clear browsing data, the next time that I try to connect using the twit connect buttom again, it show me the next message: “User name XXXXXX cannot be added. It already exists.”

    So, what’s the solution?, if I’m logged in using twit connect I can’t never log out or delete the cookies?. The plugin must to check that if already exists a user with that username, maybe it’s the same user trying to log in again, so it should check if the email and password are the same, in that case, to log in with that username.

    Avatar of desarrollador
    desarrollador
    Participant

    @desarrollador

    Hi, the bug was Fixed???

    Thanks

    Avatar of Jonathan
    Jonathan
    Participant

    @jonwaite

    I am having the identical issue as _dorsvenabill and also cannot delete the @twitter suffix. Would love to get this working on my site!

    Avatar of Altermann
    Dennis
    Member

    @altermann

    I’am with the same problem, the user can create but can’t login in the account.

Viewing 20 replies - 1 through 20 (of 20 total)

You must be logged in to reply to this topic.