Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Facebook Connect - Allow your users to login with their Facebook account Details »»
Facebook Connect - Allow your users to login with their Facebook account
Version: 2.0.5, by sllik sllik is offline
Developer Last Online: Dec 2011 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.7.x Rating:
Released: 12-09-2008 Last Update: 03-23-2009 Installs: 499
DB Changes Uses Plugins Template Edits
Additional Files Translations  
No support by the author.

Facebook Connect
This add-on allows your guests and existing users to login with their Facebook account through Facebook Connect.

WORKS WITH 3.8!

Benefits of Facebook Connect
  • Users can simply login with their Facebook account without going through the registration process.
  • Increase user interaction and your traffic through Facebook notifications and news-feeds!
Features
Facebook users will be able to receive Facebook notifications when:
  • There is a reply to their thread or a thread that they're subscribing to
  • They receive a new PM
News-Feed will be published on to the user's wall when the user:
  • Logs in for the first time
  • Replies to a thread
  • Creates a new thread
Fetch user data from Facebook
Fetch data like name, location, profile picture and use it on your forums! (NOTE: Some data may not be available for some users)

Automatically befriend user's friends
If any of the user's friends are also registered on the forum, they will automatically be friends!

How to Upgrade From 2.0.0 to 2.0.1
  • Upgrade the product. (Import the product XML again and set overwrite to yes).
  • Update Feed Template IDs in the settings (make sure they are the same as at: FB Connect Options -> News-Feed Templates)
How to Upgrade From 2.0.1 to 2.0.2
See UPGRADE.html
  • Fixed the notification problem (notifications were sent to wrong people)
  • Login button will now be displayed on vbAdvanced pages
How to Upgrade From 2.0.2 to 2.0.3
See UPGRADE.html
  • Fixed the Facebook avatar displayed for the wrong people problem.
  • Added Facebook UID & Profile URL field to data map.
Professional Install/Upgrade/Support Services
Want this mod professionally installed? It's guaranteed to work on your forum! Download the archive and see INSTALL.html/UPGRADE.html for more details!

Troubleshooting
Server Requirements:
PHP 5

If you get an error:

Code:
The Facebook Connect cross-domain receiver URL http://www.SITEURL.com/xd_receiver.h...%220.699%22%7D must have the application's callback URL http://www.SITEURL.com/forums/ as a prefix. You can configure the callback URL in the application's settings.
Means that there is something wrong with your callback URL. Your callback URL must be where xd_receiver.htm is; so when you enter [callbackurl]/xd_receiver.htm into your browser you should see a blank page (not a 404 page not found error or anything else).

If you get a continues this means there is a javascript error. Make sure you've done all the template edits correctly (especially footer & navbar). Clear your cache and reload the page.

If nothing happens when you click the Facebook Connect button make sure your callback url domain is the same as you forum domain (the one set in your forum settings) - more specifically make sure that there is a www (or isn't) in both domains.


Many more features may be implemented in the future so keep checking for updates.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #42  
Old 12-10-2008, 11:45 AM
Wakey Wakey is offline
 
Join Date: Dec 2008
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I got my initial issue resolved. However now when I try and connect I get the following after I click the button and ok the facebook request

Quote:
facebook == null) $vbulletin->facebook = new Facebook($vbulletin->options['fbconnect_apikey'], $vbulletin->options['fbconnect_secret']); $facebook = $vbulletin->facebook; $fbuid = intval($vbulletin->facebook->get_loggedin_user()); //$facebook->api_client->users_getInfo($fbuid, array('name')); if ($fbuid > 0) { $vbuser = $db->query_first(" SELECT userid FROM " . TABLE_PREFIX . "fbuser AS fbuser WHERE fbuid = " . $fbuid . " LIMIT 1 "); if ($vbuser['userid']) { $vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE userid = '" . $vbuser['userid'] . "'"); if ($vbulletin->userinfo['username']) { //login vb user process_new_login('', false, ''); // do redirect do_login_redirect(); } else { $db->query_write("DELETE FROM " . TABLE_PREFIX . "fbuser WHERE fbuid = $fbuid"); $templatename = 'fbconnect_login'; } } else { //request username to create a new vb user $templatename = 'fbconnect_login'; } } else { eval(standard_error(fetch_error('badlogin', $vbulletin->options['bburl'], $vbulletin->session->vars['sessionurl']))); } if ($_POST['do'] == 'addmember') { $vbulletin->input->clean_array_gpc('p', array( 'username' => TYPE_STR )); if (!$vbulletin->options['allowregistration']) { eval(standard_error(fetch_error('noregister'))); } $fbuserinfo = $facebook->api_client->users_getInfo($fbuid, array('proxied_email')); $fbuserinfo = $fbuserinfo[0]; // init user datamanager class $userdata =& datamanager_init('User', $vbulletin, ERRTYPE_ARRAY); if ($vbulletin->options['moderatenewmembers']) { $newusergroupid = 4; } else { $newusergroupid = ((intval($vbulletin->options['fbconnect_defaultgroup']) > 0) ? $vbulletin->options['fbconnect_defaultgroup'] : 2); } $userdata->set('username', $vbulletin->GPC['username']); //generate random password $userdata->set('password', generate_password()); // set usergroupid $userdata->set('usergroupid', $newusergroupid); // set languageid $userdata->set('languageid', $vbulletin->userinfo['languageid']); // set user title $userdata->set_usertitle('', false, $vbulletin->usergroupcache["$newusergroupid"], false, false); // register IP address $userdata->set('ipaddress', IPADDRESS); $userdata->pre_save(); // check for errors if (!empty($userdata->errors)) { $_REQUEST['do'] = 'register'; $errorlist = ''; foreach ($userdata->errors AS $index => $error) { $errorlist .= "
$error"; } $username = htmlspecialchars_uni($vbulletin->GPC['username']); $show['errors'] = true; } else { $show['errors'] = false; $userdata->set('email', $fbuserinfo['proxied_email']); // save the data $vbulletin->userinfo['userid'] = $userid = $userdata->save(); if ($userid) { //map fbuser to vbuser $db->query_write(" INSERT INTO " . TABLE_PREFIX . "fbuser (fbuid, userid) VALUES (" . $fbuid . ", " . intval($userid) . ") "); $vbulletin->userinfo['fbuid'] = $userid; $userinfo = fetch_userinfo($userid); $userdata_rank =& datamanager_init('User', $vbulletin, ERRTYPE_SILENT); $userdata_rank->set_existing($userinfo); $userdata_rank->set('posts', 0); $userdata_rank->save(); // force a new session to prevent potential issues with guests from the same IP, see bug #2459 require_once(DIR . '/includes/functions_login.php'); $vbulletin->session->created = false; process_new_login('', false, ''); //post news-feed if ($vbulletin->options['fbconnect_firstlogintemplateid']) { $tokens = array( 'bbtitle' => $vbulletin->options['bbtitle'], 'bburl' => $vbulletin->options['bburl'], 'images' => array() ); try { $vbulletin->facebook->api_client->feed_publishUserAction($vbulletin->options['fbconnect_firstlogintemplateid'], $tokens, '', '', 1); } catch(FacebookRestClientException $ex) { } } //find friends and add to friend's list $friends = $facebook->api_client->friends_get(); $vbfriends = $db->query_read(" SELECT user.userid FROM " . TABLE_PREFIX . "user AS user, " . TABLE_PREFIX . "fbuser AS fbuser WHERE fbuser.fbuid IN (" . implode(',', $friends) . ") AND user.userid = fbuser.userid "); while ($friend = $db->fetch_array($vbfriends)) { $db->query_write(" INSERT IGNORE INTO " . TABLE_PREFIX . "userlist (userid, relationid, type, friend) VALUES (" . intval($userid) . ", " . $friend['userid'] . ", 'buddy', 'yes') "); } $username = $vbulletin->GPC['username']; $email = $fbuserinfo['proxied_email']; // send new user email if ($vbulletin->options['newuseremail'] != '') { $ipaddress = IPADDRESS; eval(fetch_email_phrases('newuser', 0)); $newemails = explode(' ', $vbulletin->options['newuseremail']); foreach ($newemails AS $toemail) { if (trim($toemail)) { vbmail($toemail, $subject, $message); } } } if ($newusergroupid == 2) { if ($vbulletin->options['welcomemail']) { eval(fetch_email_phrases('welcomemail')); vbmail($email, $subject, $message); } } $vbulletin->url = str_replace('"', '', $vbulletin->url); if (!$vbulletin->url) { $vbulletin->url = $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q']; } else { $vbulletin->url = iif(strpos($vbulletin->url, 'register.php') !== false, $vbulletin->options['forumhome'] . '.php' . $vbulletin->session->vars['sessionurl_q'], $vbulletin->url); } if ($vbulletin->options['moderatenewmembers']) { eval(standard_error(fetch_error('moderateuser', $username, $vbulletin->options['forumhome'], $vbulletin->session->vars['sessionurl_q']), '', false)); } else { eval(standard_error(fetch_error('registration_comp lete', $username, $vbulletin->session->vars['sessionurl'], $vbulletin->options['bburl'] . '/' . $vbulletin->options['forumhome'] . '.php'), '', false)); } } } } eval('print_output("' . fetch_template($templatename) . '");');
Reply With Quote
  #43  
Old 12-10-2008, 11:51 AM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is pretty awesome
Reply With Quote
  #44  
Old 12-10-2008, 11:53 AM
digitalnorte digitalnorte is offline
 
Join Date: Jan 2008
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

God ! Good Job, Excellent JOB !
I´ll see more to integrate with my VB and tell you.
Reserved but Installing in a near time.
Congrats !
Reply With Quote
  #45  
Old 12-10-2008, 11:57 AM
macc's Avatar
macc macc is offline
 
Join Date: Feb 2008
Posts: 647
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello!

have installed and have one problem ...when user (facebook user) will login on my vbulletin and must write username - he/she get database error -

Code:
Database error in vBulletin 3.7.4:Invalid SQL:                SELECT user.userid                FROM user AS user, fbuser AS fbuser                WHERE fbuser.fbuid IN () AND user.userid = fbuser.userid;MySQL Error   : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND user.userid = fbuser.userid' at line 3Error Number  : 1064Request Date  : Wednesday, December 10th 2008 @ 08:52:37 AMError Date    : Wednesday, December 10th 2008 @ 08:52:38 AMScript        : http://libar-libar.com/libar/vb/fblogin.phpReferrer      : http://libar-libar.com/libar/vb/fblogin.phpIP Address    : 93.138.102.155Username      : test03Classname     : vB_DatabaseMySQL Version :
some help or solutinos?

regards

macc

edit: after this error - user come to forum - made new usergroup for this users.
call back url is http://libar-libar.com/libar/vb/ and connections works ...
Reply With Quote
  #46  
Old 12-10-2008, 12:41 PM
tidefans tidefans is offline
 
Join Date: Jul 2004
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by yinyang View Post
I will happily add to the paypal donation if you can figure out how to tie in established forum users with their facebook accounts.
Same here. Looks like a great mod.
Reply With Quote
  #47  
Old 12-10-2008, 01:27 PM
sensimilla sensimilla is offline
 
Join Date: Dec 2004
Location: Poland
Posts: 555
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When I go to News-Feed Templates i get

Fatal error: Class 'FacebookRestClient' not found in /var/www/httpdocs/includes/facebook/facebook.php on line 68
Reply With Quote
  #48  
Old 12-10-2008, 01:42 PM
jammiedodger546 jammiedodger546 is offline
 
Join Date: May 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Sllik, I can't seem to find the "Facebook Connect App", any chance you could post the url?

edit: Sorry, misread the install file
Reply With Quote
  #49  
Old 12-10-2008, 01:53 PM
KW802's Avatar
KW802 KW802 is offline
 
Join Date: Jul 2003
Location: A galaxy far, far away...
Posts: 1,450
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've read all of the posts so far but I'm not clear on one item yet...

When a guest visitor logs in using their Facebook credentials, does a user account then actually get created on the vBulletin site?
Reply With Quote
  #50  
Old 12-10-2008, 02:04 PM
nascartr nascartr is offline
 
Join Date: Jun 2008
Posts: 317
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KW802 View Post
I've read all of the posts so far but I'm not clear on one item yet...

When a guest visitor logs in using their Facebook credentials, does a user account then actually get created on the vBulletin site?

I tested with my facebook account and after I entered what username I wanted to use it created a new account on my forum for me.

By the way, I'm running this on vB 3.8 RC1. Works great so far.
Reply With Quote
  #51  
Old 12-10-2008, 02:13 PM
jammiedodger546 jammiedodger546 is offline
 
Join Date: May 2008
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and running PERFECTLY on 3.8.0 RC1
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:26 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.13799 seconds
  • Memory Usage 2,329KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete