Social Connect 2 (facebook connect and Twitter login) for elgg 1.7 and greater v2

Release Notes

ADD TWITTER

ADD PANEL ADMIN

 

  • Good plugin, thanks.

    How can I put the buttons in my custom-index??

    regards.

  • @gastre

    hi. try this: put this code in your indexpage

    <?

    $plugin_name = "fbconnect";

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

    $perms = get_plugin_setting('perms', $plugin_name);

     

    ?>

    <div>

    <fb:login-button perms="<? echo $perms ?>"</fb:login-button>

    <div id="fb-root">Facebok connect

    <script src="http://connect.facebook.net/en_US/all.js"></script&gt;

    </div>

    </div>

    <script>

        FB.init({appId: '<? echo $appid ?>', status: true,

            cookie: true, xfbml: true});

        FB.Event.subscribe('auth.login', function(response) {

     

            window.top.location.href = "<? echo $CONFIG->wwwroot ?>pg/register/";

        });

        FB.Event.subscribe('auth.logout', function(response) {

     

            window.top.location.reload();

        });

     

    </script>

  • @Dario, perfect!!!! Thanks.

    Now the problem is when I go t:

    http://www.facebook.com/developers/apps.php

    I have an error with Developer.

     

    Error

    Ha ocurrido un error con Developer. Por favor, inténtalo de nuevo más tarde.

  • @gastre Hola! amigos.  I have not idea :( . this is fb trouble. try this: http://www.facebook.com/help/?page=796&hloc=es_ES

     

  • Perfect!!! now is working. thanks.

     

  • I am using apache2triad webserver on widnows machine, when I configure twitter keys, I get this error.

    Fatal error: Call to undefined function: hash_hmac() in C:\apache2triad\htdocs\hcu_staging\mod\fbconnect\twitter\EpiOAuth.php on line 364

    it seems apache does not have hash_hmac() function, any way to use another function in php 5.1.2 in place of hash_hmac()?

    Nauman

  • got it working,

    -- added extension=php_hash.dll in php.ini

    -- restart apache :)

  • Dario

    I have another issue though, while logged in through facebook, i click your logout link and it works fine.

    But when I want to put

    global $CONFIG;
    $plugin_name = "fbconnect";
    $consumer_key = get_plugin_setting('consumer_key', $plugin_name);
    $consumer_secret = get_plugin_setting('consumer_secret', $plugin_name);
    $appapikey = get_plugin_setting('api_key', $plugin_name);
    $appsecret = get_plugin_setting('api_secret', $plugin_name);
    $appid = get_plugin_setting('api_id', $plugin_name);
    $perms = get_plugin_setting('perms', $plugin_name);
    $facebook=get_plugin_setting('facebook', $plugin_name);
    $twitter=get_plugin_setting('twitter', $plugin_name);

    then

    <a href="javascript:FB.logout();"> logout</a>

    and also include

    <script>
        FB.init({appId: '<? echo $appid ?>', status: true,
            cookie: true, xfbml: true});
        FB.Event.subscribe('auth.login', function(response) {
       
        window.top.location.href = "<? echo $CONFIG->wwwroot ?>pg/register/";       
     
        });
        FB.Event.subscribe('auth.logout', function(response) {
     
            window.top.location.reload();
        });

    </script>

    I get this error JS error "FB is not defined", any help on resolving this? or is there a way that I can logout from both elgg and facebook same time?

    Regards

    Nauman

  • i don't know. try to add <script src="http://connect.facebook.net/en_US/all.js"></script&gt;

    or try to read http://developers.facebook.com/docs/reference 

    I will release a new version with automatic login in few days 

     

  • Dario, with this plugin I can replace Elgg login process.

    I mean, I wish to log the user in Elgg with their twitter accounts without generating an elgg user for this.

    Its possible?

    Regards

    Daniel

  • What will happen if I switch from

    Facebook Connect for 1.7.3  

    to your plugin? 

    What will happen to the Facebook users I already have registered?  If it is an easy transition, I would much prefer to have both twitter and Facebook login options. Thanks,

    Survtime

  • Hi, @Suvtime

    You can try to intervent into database and replace "facebook_uid" with uid. and setup my plugin. in metastring table, I suppost.

    or

    replace ALL files of my plugin-->> "uid" with-->"facebook_uid"

     

  • it works however i have this warning.

    WARNING: Deprecated in 1.7: get_entities_from_metadata() was deprecated by elgg_get_entities_from_metadata()! (Called from /elgg/mod/fbconnect/views/default/fbconnect/login.php:19)

  • Just go and edit the login.php to change get_entities_from_metadata() to elgg_get_entities_from_metadata and the warning will go away.

  • Hi All,

    Just started using Elgg ^_^

    Facebook App Creation
    http://www.facebook.com/developers/createapp.php

    You have to validate your facebook account through Mobile or Credit Card!

    Thanks Dario for this useful plugin.
    And thanks the communuty for Elgg.
    Cheers

  • I have many errors:

    1- The conect with facebook button is not view in internet explorer.

    2- When I register is fine but, I cant login with the facebook connect.

    Please help...

     

  • Hello, when will you get the 2.1 version without errors? Thank you very much

  • Dario - got 1 issue and question for you.

    Issue:  The Facebook button doesn't load properly in IE8 and is unclickable.  The Twitter one's fine in IE8 and both buttons seem to work in FireFox, Opera & Chromium.

    Question:  Is it possible to add the buttons inside a widget, either using the Free HTML one or a custom one?  Also, would it be possible to add the buttons individually to widgets on the homepage?  My ultimate aim is to have people only logging in/registering using existing accounts on other sites as I'm currently not able to to provide an SSL connection to encrypt passwords etc...

    Thanks in advance,

    LJ

  • mmm

    " The Facebook button doesn't load properly in IE8 and is unclickable.  The Twitter one's fine in IE8 and both buttons seem to work in FireFox, Opera & Chromium."

    tommor I see..

    :  Is it possible to add the buttons inside a widget, either using the Free HTML one or a custom one?  Also, would it be possible to add the buttons individually to widgets on the homepage?  My ultimate aim is to have people only logging in/registering using existing accounts on other sites as I'm currently not able to to provide an SSL connection to encrypt passwords etc...

    yes.

    Tomorrow i write the code,

    There in italy are 11.30 pm  goodnight! 

  • INSERT THIS CODE:

    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script&gt;

    <script type="text/javascript">

       // initialize the library with the API key

        FB.init({ apiKey: 'YOURAPIKEY!!' });

        // fetch the status on load

        FB.getLoginStatus();

        $(document).ready(function() {

            $('.facebook').click(function() {

                FB.login(function(response) {

                    if (response.session) {

                        if (response.perms) {

                            document.location.href = "http://127.0.0.1/trunk/people/socialconfirm?mode=facebook&uid="+FB.getSession().uid+"&access_token="+FB.getSession().access_token;

                        } else {

                        }

                    } else {

                    }

                }, {perms:'user_birthday,friends_birthday,offline_access,email,publish_stream,status_update,user_birthday,user_location,user_work_history,user_photos, user_photo_video_tags,create_event,rsvp_event'});

            });

        });

    </script>

     NOW THE LINK OF THE LOGIN IS THIS 

    <a href="#" class="facebook">Facebook</a>
  • INSERT THIS CODE:

    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script&gt;

    <script type="text/javascript">

       // initialize the library with the API key

        FB.init({ apiKey: 'YOURAPIKEY!!' });

        // fetch the status on load

        FB.getLoginStatus();

        $(document).ready(function() {

            $('.facebook').click(function() {

                FB.login(function(response) {

                    if (response.session) {

                        if (response.perms) {

                            document.location.href = "http://127.0.0.1/trunk/people/socialconfirm?mode=facebook&uid="+FB.getSession().uid+"&access_token="+FB.getSession().access_token;

                        } else {

                        }

                    } else {

                    }

                }, {perms:'user_birthday,friends_birthday,offline_access,email,publish_stream,status_update,user_birthday,user_location,user_work_history,user_photos, user_photo_video_tags,create_event,rsvp_event'});

            });

        });

    </script>

     NOW THE LINK OF THE LOGIN IS THIS 

    <a href="#" class="facebook">Facebook</a>
  • FOR IE8 BUG INSERT THIS CODE TRY!

     <html xmlns="http://www.w3.org/1999/xhtml"xmlns:fb="http://www.facebook.com/2008/fbml">

    GOOD WORK!

  • Thanks for the quick response!  :-)

    Couple more questions tho - where should the code be inserted to?  There are several files for both the facebook & twitter logins and with only basic coding skills I can't tell which file it should be added to.  Also, would this work too for the twitter app?

    Thanks again dude!

    LJ

Stats

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

Other Projects

View Dario Agliottone's plugins