Social Connect 2 (facebook connect and Twitter login) for elgg 1.7 and greater v1.0

Release Notes

fbconnect is stable

GFC google friend connect login is NOT STABLE

  • What is the key difference between your plugin and that of releaser earlier by someone else?

  • the facebook uid-> key code of facebook is saved in metadata and you can login with login button of facebook immediately

  • do you thin i could  use it to link photos on FB (not justa the one on the profile) to mz egll site and show them in a widget or page?

  • Dose it work in 1.7.6? when i enable this plugin, my homepage(login) can't work. can you help me? Thanks a lot!

  • Mark what don't work?(white screen or there aren't FBbutton or..)

  • @Dario Thanks for you response! Sorry for my poor English! The homepage problem had been solved!. But I have some question after read your code. Can you help me?

    1. The "guid" in database should be Facebook uid? but in my database, the guid is just increase.

    2. Maybe because of 1.(it can't find the guid) , after registration, I can't login automatic.

    3. Can this plugin pull the other information (like location, aboutme) after registration?

    Thanks for your time to help me!

  • @Mark, don't worrt I'm am italian guy.

    1.NO. the guid is the unique id of user.

    uid is the id of user of facebook:{$uid}

    2. the user must clik on FBbutton to connect, if the uid that you retrive is already in the db, make the login with the user corrispondent or go to registration page.

    3. Yes, for example in register page you get first_name, last_name, email

    << $arr = fbconnect_get_info_from_fb($CONFIG->uid, "first_name, last_name, email" >>



    you can add a field, hometown_location, locale, sex ad more...( you can see fb api site)

    this file is in mod\fbconnect\views\default\fbconnect\register.php


    global $CONFIG;

    $plugin_name = "fbconnect";

    $appapikey = get_plugin_setting('api_key', $plugin_name);

    $appsecret = get_plugin_setting('api_secret', $plugin_name);

    $appid = get_plugin_setting('api_id', $plugin_name);

    $cookie = get_facebook_cookie($appid, $appsecret);

    $uid = $cookie['uid'];

    $CONFIG->uid = $uid;


    // get info facebook account 

    $arr = fbconnect_get_info_from_fb($CONFIG->uid, "first_name, last_name, email,hometown_location, locale, sex");

    $CONFIG->first_name = $arr['first_name'];

    $CONFIG->hometown_location = $arr['hometown_location'];

    $CONFIG->sex = $arr['sex'];

    $CONFIG->email = $arr['email'];



    //set in fields the facebook accounts ifo

    // you can change this but

        $('input[name="email"]').val("<?php echo $CONFIG->email; ?>");

        $('input[name="username"]').val("<?php echo $CONFIG->first_name . $CONFIG->last_name; ?>");

        $('input[name="name"]').val("<?php echo $CONFIG->first_name; ?>");


        $('input[name="uid"]').val("<?php echo $CONFIG->uid; ?>");


    now you must add in register action page the field and save the metadata

    now I have not time! but in next day I add features such as this and the widget for connect,

    good work


  • @Dario
    Hi this a great plugin, I'm mexican student, now  I'm making a social network  for the ex student from my university.  I need to know where are the ex student work..
    I have a cuestion when you have a field for example work_history this is an array type, how I can show in the register form.
    I added this field in the users.php and in the mod register.php

    Note: for the new releases the field name is wrong in this part:

    $('input[name="username"]').val("<?php echo $CONFIG->first_name . $CONFIG->last_name; ?>");

     $('input[name="name"]').val("<?php echo $CONFIG->first_name; ?>");

    the correct way is:

    $('input[name="username"]').val("<?php echo $CONFIG->first_name; ?>");

    $('input[name="name"]').val("<?php echo $CONFIG->first_name . $CONFIG->last_name; ?>");

    kind regards


  • @Briceda Thx

    when you have a field for example work_history this is an array type, how I can show in the register form.

    I understand what you want. but only show? or he can edit?

    I think, a listbox? or a div? in views\default\account\forms\register.php. and set values from fb with jquery in mod/view..../fbconnect/register.php


  • @Dario

    Thanks for the new releases

    It's the first plugin for the twitter login that work for me, I really appreciate your job. It's works great on my Elgg 1.7.5       :D


  • Category: Authentication
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 6188
  • Recommendations: 8

Other Projects

View Dario Agliottone's plugins