vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Integration with vBulletin - Facebook Connect - Allow your users to login with their Facebook account (https://vborg.vbsupport.ru/showthread.php?t=198499)

Wakey 12-10-2008 11:45 AM

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) . '");');

KevinL 12-10-2008 11:51 AM

This is pretty awesome

digitalnorte 12-10-2008 11:53 AM

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 !

macc 12-10-2008 11:57 AM

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 ...

tidefans 12-10-2008 12:41 PM

Quote:

Originally Posted by yinyang (Post 1682209)
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.

sensimilla 12-10-2008 01:27 PM

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

jammiedodger546 12-10-2008 01:42 PM

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 ;)

KW802 12-10-2008 01:53 PM

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?

nascartr 12-10-2008 02:04 PM

Quote:

Originally Posted by KW802 (Post 1682394)
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.

jammiedodger546 12-10-2008 02:13 PM

Installed and running PERFECTLY on 3.8.0 RC1

jlew24asu 12-10-2008 02:19 PM

Quote:

Originally Posted by jlew24asu (Post 1682301)
can you help me with step 1? :)

Step 1:

Set up a new Facebook Application through which vBulletin and Facebook will be communicating. When setting up the application set the Callback URL to your vBulletin url. Set up a new Facebook Application here: http://www.facebook.com/developers/ (no coding skills required)

when trying to submit, I get

"You need to have at least 5 users before you can submit your application."

for those who got this working, how did you get around the bold statement?

jlew24asu 12-10-2008 02:20 PM

Quote:

Originally Posted by nascartr (Post 1682403)
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.

so all my users who log in to my forum with this hack will have to use a new account?

jammiedodger546 12-10-2008 02:29 PM

Quote:

Originally Posted by jlew24asu (Post 1682414)
for those who got this working, how did you get around the bold statement?

I didn't get that :confused:

jlew24asu 12-10-2008 02:33 PM

Quote:

Originally Posted by jammiedodger546 (Post 1682424)
I didn't get that :confused:

really? maybe I'm doing it wrong. you have to create a facebook application right? when I click submit I get that error --- "You need to have at least 5 users before you can submit your application."

jammiedodger546 12-10-2008 02:39 PM

Quote:

Originally Posted by jlew24asu (Post 1682430)
really? maybe I'm doing it wrong. you have to create a facebook application right? when I click submit I get that error --- "You need to have at least 5 users before you can submit your application."

I went to http://www.facebook.com/developers/#...ditapp.php?new
put a name in (just gave it my forums name)

Then you have to click optional fields. In Callback URL, enter your forums URL. Scroll down and check the tickbox and click submit

macc 12-10-2008 02:42 PM

which nick should we use when make facebook connection- and why database error?

my antivirus program show attack every time when i come to my board and attack come from facebook server static.ak.facebook.com ...??

some help

regards

macc

yinyang 12-10-2008 02:44 PM

Quote:

Originally Posted by AlexanderT (Post 1682296)
Ahh ok. So that nickname is then permanently tied to the person's facebook id?

the "nickname" will be your forum's new username.

Quote:

Originally Posted by jlew24asu (Post 1682301)
can you help me with step 1? :)

Step 1:

Set up a new Facebook Application through which vBulletin and Facebook will be communicating. When setting up the application set the Callback URL to your vBulletin url. Set up a new Facebook Application here: http://www.facebook.com/developers/ (no coding skills required)

when trying to submit, I get

"You need to have at least 5 users before you can submit your application."

Quote:

Originally Posted by jammiedodger546 (Post 1682442)
I went to http://www.facebook.com/developers/#...ditapp.php?new
put a name in (just gave it my forums name)

Then you have to click optional fields. In Callback URL, enter your forums URL. Scroll down and check the tickbox and click submit

You're submitting the wrong button. You're trying to submit it to the Application Directory. Scroll down and hit "save", that's what you need.

fattony69 12-10-2008 02:46 PM

I subscribed. I want to wait until this becomes more stable (going by other's posts). Looks great and can't wait for it!

jlew24asu 12-10-2008 03:03 PM

ok thanks guys for the feedback. I was doing it wrong. I installed everything and when I click

"Connect with Facebook" (at login) I get this....

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.402%22%7D) must have the application's callback url (http://sundeviltalk.com) as a prefix. You can configure the callback url in the application's settings.

macc 12-10-2008 03:16 PM

works not for me ... myself can not use this on my board - get # in my link -webpage when click to facebook connect...and users get database erorrs when should write nickname...

unistall

regards

macc

KW802 12-10-2008 03:25 PM

Quote:

Originally Posted by nascartr (Post 1682403)
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.

nascartr, thanks for clarifying that one.

jlew24asu 12-10-2008 03:34 PM

Quote:

Originally Posted by jlew24asu (Post 1682469)
ok thanks guys for the feedback. I was doing it wrong. I installed everything and when I click

"Connect with Facebook" (at login) I get this....

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.402%22%7D) must have the application's callback url (http://sundeviltalk.com) as a prefix. You can configure the callback url in the application's settings.


I just thought of something....

I have CMPS on my site, how does this affect my callback URL??

I tried http://sundeviltalk.com and my actual forums http://sundeviltalk.com/forums, neither worked

jlew24asu 12-10-2008 03:37 PM

Quote:

Originally Posted by nascartr (Post 1682403)
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.

so as I understand it, this hack only works for new registrations?

nascartr 12-10-2008 03:57 PM

Quote:

Originally Posted by jlew24asu (Post 1682490)
so as I understand it, this hack only works for new registrations?


Yes, that's correct so far. Another member mentioned above that they couldn't link their current user account with the Facebook login...only able to create a new account on their forum.

nascartr 12-10-2008 04:18 PM

I do have a ton of errors when viewing the cpanel error log. There's at least a hundred and they're all like this...

Quote:

[Wed Dec 10 13:13:39 2008] [error] [client 67.186.54.89] File does not exist: /home/nascartr/public_html/xd_receiver.htm, referer: http://www.connect.facebook.com/exte...d_receiver.htm
[Wed Dec 10 13:11:41 2008] [error] [client 67.186.54.89] File does not exist: /home/nascartr/public_html/xd_receiver.htm, referer: http://www.connect.facebook.com/exte...d_receiver.htm
[Wed Dec 10 13:11:04 2008] [error] [client 138.162.0.41] File does not exist: /home/nascartr/public_html/xd_receiver.htm, referer: http://www.connect.facebook.com/exte...d_receiver.htm
[Wed Dec 10 13:08:00 2008] [error] [client 138.162.0.42] File does not exist: /home/nascartr/public_html/xd_receiver.htm, referer: http://www.connect.facebook.com/exte...d_receiver.htm

thepretorian 12-10-2008 04:34 PM

like it saids, the file doesn't exist. Re-upload it or change the feedback url to http://diecastcrazy.com without the "/" at the end.

yinyang 12-10-2008 04:49 PM

Quote:

Originally Posted by nascartr (Post 1682501)
Yes, that's correct so far. Another member mentioned above that they couldn't link their current user account with the Facebook login...only able to create a new account on their forum.

yup, i wrote an earlier post stating that i'd happy to donate more funds if he could bridge this with existing users.

I haven't tried it, and it seems like it will be a big pain in the ass, but i guess you could merge the current users with the new facebook account.

jlew24asu 12-10-2008 04:53 PM

Quote:

Originally Posted by yinyang (Post 1682529)
yup, i wrote an earlier post stating that i'd happy to donate more funds if he could bridge this with existing users.

I haven't tried it, and it seems like it will be a big pain in the ass, but i guess you could merge the current users with the new facebook account.

thanks for that suggestion, I didnt even realize that feature exists. that should be a good work around right?

yinyang 12-10-2008 05:06 PM

Quote:

Originally Posted by jlew24asu (Post 1682532)
thanks for that suggestion, I didnt even realize that feature exists. that should be a good work around right?

let me know if you try it!

macc 12-10-2008 05:08 PM

tried to login on http://diecastcrazy.com
and get also database error .... (used- "test" username)

Warning: implode() [function.implode]: Invalid arguments passed in [path]/fblogin.php on line 194

(had same error on my site )
macc

jlew24asu 12-10-2008 05:14 PM

Quote:

Originally Posted by macc (Post 1682538)
tried to login on http://diecastcrazy.com
and get also database error .... (used- "test" username)

Warning: implode() [function.implode]: Invalid arguments passed in [path]/fblogin.php on line 194

(had same error on my site )
macc

worked for me, I logged in as tester

sllik 12-10-2008 05:20 PM

Quote:

Originally Posted by jlew24asu (Post 1682469)
ok thanks guys for the feedback. I was doing it wrong. I installed everything and when I click

"Connect with Facebook" (at login) I get this....

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.402%22%7D) must have the application's callback url (http://sundeviltalk.com) as a prefix. You can configure the callback url in the application's settings.

Hi guys, I'm here again to give some support.... Those who have problems with cross-domain receiver make sure the Callback URL (a setting on the facebook application that you created in step1) is set to your forum's url

sllik 12-10-2008 05:21 PM

Quote:

Originally Posted by macc (Post 1682538)
tried to login on http://diecastcrazy.com
and get also database error .... (used- "test" username)

Warning: implode() [function.implode]: Invalid arguments passed in [path]/fblogin.php on line 194

(had same error on my site )
macc

I'll release an update in a sec... do you have friends on your facebook account?

jlew24asu 12-10-2008 05:24 PM

edit

sllik 12-10-2008 05:24 PM

Quote:

Originally Posted by jlew24asu (Post 1682489)
I just thought of something....

I have CMPS on my site, how does this affect my callback URL??

I tried http://sundeviltalk.com and my actual forums http://sundeviltalk.com/forums, neither worked

the callback url needs to point to the directory where you uploaded the xd_receiver.htm file

sllik 12-10-2008 05:24 PM

Quote:

Originally Posted by jlew24asu (Post 1682551)
edit

yes, i think your can!

jlew24asu 12-10-2008 05:26 PM

Quote:

Originally Posted by sllik (Post 1682555)
yes, i think your can!

hehe that was quick. but my first problem still exists.

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.650%22%7D) must have the application's callback url (http://sundeviltalk.com/forums) as a prefix. You can configure the callback url in the application's settings.

:(

my forum address is Http://sundeviltalk.com/forums (other page is www.chicagophotoshop.com/forums

what is my callback URL?

sllik 12-10-2008 05:29 PM

Quote:

Originally Posted by jlew24asu (Post 1682556)
hehe that was quick. but my first problem still exists.

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.650%22%7D) must have the application's callback url (http://sundeviltalk.com/forums) as a prefix. You can configure the callback url in the application's settings.

:(

my forum address is Http://sundeviltalk.com/forums (other page is www.chicagophotoshop.com/forums

what is my callback URL?

your callbackurl needs to be
http://sundeviltalk.com/forums/

jlew24asu 12-10-2008 05:35 PM

Quote:

Originally Posted by sllik (Post 1682557)
your callbackurl needs to be
http://sundeviltalk.com/forums/

it is..

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.650%22%7D) must have the application's callback url (http://sundeviltalk.com/forums) as a prefix. You can configure the callback url in the application's settings.

edit: I see I missed the last /

but I added it and still invalid

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.224%22%7D) must have the application's callback url (http://sundeviltalk.com/forums/) as a prefix. You can configure the callback url in the application's settings.

sllik 12-10-2008 05:38 PM

Quote:

Originally Posted by jlew24asu (Post 1682560)
it is..

Invalid Argument

The Facebook Connect cross-domain receiver URL (http://www.sundeviltalk.com//xd_rece...%220.650%22%7D) must have the application's callback url (http://sundeviltalk.com/forums) as a prefix. You can configure the callback url in the application's settings.

make sure you set your vbulletin url to: http://sundeviltalk.com/forums
in your vbulletin settings


All times are GMT. The time now is 05:03 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02099 seconds
  • Memory Usage 1,879KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (28)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete