PDA

View Full Version : FaceBook Connect Problem With vBadvanced


simba6666
04-26-2010, 12:42 AM
FaceBook Connect Problem With vBadvanced,

Hi 2 all,

I have been installed vBulletin 4.0.3 with vBadvanced 4 Gold, But i have problem with facebook connect account in home page only (vBadvanced).

But with vBulletin /vb worked well.

Problem is . . . when i sign in from vBadvanced (home page) Connect went me to this link automatically: http://www.MYDOMAIN.com/register.php
and this link is wrong the right is: http://www.MYDOMAIN.com/vb/register.php

Brian
04-27-2010, 11:29 AM
I'm not exactly sure what the issue might be, but if you would like to submit a support ticket via the Members' Area here I'll be glad to take a look at things for you.

Our Sponsors
 

hbalagh
04-27-2010, 03:31 PM
We are having the same issue

lowfd
05-20-2010, 12:16 AM
The problem is the URL is incorrect - when on the vbadvanced cmps, clicking the facebook connect link makes it look for register.php in the same directly as the cmps_index.php. But it 404's because it isn't there, register.php is in the forum subdirectory.

So when you click through to the forum main page, it finds register.php and works perfectly, as you are now in the forum subdirectory. I hope this is clear.

Our Sponsors
 

lowfd
05-20-2010, 12:37 AM
I also checked to see if register.php was in my Header replacements list - it was, but it doesn't work in this case.

lowfd
05-20-2010, 08:49 PM
It's ok, I solved the problem by quitting facebook ;)

TeknoSounds
05-27-2010, 01:21 AM
Was this ever fixed? Or anyone come up with a solution?

I have my vba not in my forum root, and its missing the forum root address when going to the page. I tried adding the ~bburl]/register.php to rewrites, but didn't appear to help. Will try n delve into this a bit more.

Brian
05-27-2010, 10:52 AM
I haven't been able to reproduce any issues with Facebook locally, but if you would like to submit a support ticket via the Members' Area here I'll be glad to take a look at things for you.

TeknoSounds
05-28-2010, 09:06 AM
ticket submitted. Ty for looking into it Brian

lowfd
06-16-2010, 03:10 AM
I hope you find the problem Brian :)

I may not have explained my problem very clearly. My cmps index file is not in the forum root either.
I have the cmps page: http://www.xfalcon.com/index.php
and my forum root is here: http://www.xfalcon.com/forum/index.php

I have FB connect disabled at the moment due to this problem, so unfortunately you can't test it on my website. However if on the CMPS index, clicking it will try to load the url http://www.xfalcon.com/register.php. It fails to realise that it needs to look into the /forum/ folder in order to find it.

So when on any other forum page, you are in the forum root and the facebook connect link works perfectly. Tekno already launched a ticket with you and the solution for me should be the same as him.. so I'll wait and see. Hope this is helpful.

TeknoSounds
06-16-2010, 03:19 AM
I ended up closing out my ticket, theres lots of facebook connect changes coming with v4.0.4 and was waiting to upgrade to that before i reopened the ticket to see if anything was fixed on vB's end.

TeknoSounds
06-24-2010, 05:57 AM
Okay finally got everything working on my dev site so that I could test the issue again.
Running 4.0.4,
My vBA lives in my root http://dev.teknosounds.com/index.php
Forums are in http://dev.teknosounds.com/messageboard/
Mousing over the link shows the correct address http://dev.teknosounds.com/messageboard/#
Clicking the link causes it to redirect to register.php, but when on the vBA page it doesn't append the forum root, so http://dev.teknosounds.com/register.php instead of http://dev.teknosounds.com/messageboard/register.php

Think this might be an actual vB issue that's not appending the forum url variable to the register.php redirect?

Opening a new ticket here.

oly51
06-30-2010, 04:43 PM
I have the same problem. it started after I upgraded to vB4.0.4 and VBA CMPS 4.0.1.

If you are logged onto Facebook, every time you go to the home page (cmps-index.php) you are directed to the facebook platform, link your account part of /register.php.
Log off facebook and all is normal.

Edit: It looks like changes to /includes/class_bootstrap.php in vB4.0.4 is what is causing the problem.

oly51
07-03-2010, 01:21 PM
I have the same problem. it started after I upgraded to vB4.0.4 and VBA CMPS 4.0.1.

If you are logged onto Facebook, every time you go to the home page (cmps-index.php) you are directed to the facebook platform, link your account part of /register.php.
Log off facebook and all is normal.

Edit: It looks like changes to /includes/class_bootstrap.php in vB4.0.4 is what is causing the problem.Any fix for this?

Acido
07-21-2010, 02:08 PM
Strange that there are not updates for this issue. I'm having the problem, and surely many other users too.
Someone with a solution or a single track about, please share it to found a final fix.

concreteweb
07-22-2010, 04:21 PM
Another vote! Yes, having problem with FB forcing the link when trying to go to cmps index.

Had to turn off FB Connect until this gets answered.

kyle
07-23-2010, 01:42 AM
Have the same problem and have been playing around tonight trying to figure things out. Have VBA CMPS 4.0.1 as portal and vbulletin forums in /forum directory.

Now went to facebook vbulletin application as I wondered what would happen if I removed the /forum from the urls set in the application.

Result so far is that the facebook connect works for me when on the portal page and also works when on the forum main page.

But when you are on the portal page and not logged into facebook yet and you click the f connect button the first time to link the accounts, it works but you get an error that shows at the top of the page right after you click the allow button.

Warning: array_intersect() [function.array-intersect]: Argument #1 is not an array in [path]/includes/class_bootstrap.php(517) : eval()'d code on line 54

But this is the only time you see the error, after linking the accounts and then loggin out and back in through either the portal or forum you are automatically signed in to facebook. I will leave this as it is now until a solution either comes from vbulletin as we do not want to turn the facebook connection off.

The only thing I can see that doing this affects is when you publish a post to facebook, it shows the portal url and not the forum url, but when you click on the published post it takes you straight to the post in the forum. Again I can live with that until a solution is found.

So what I did (copy the settings if you try this) go to facebook developers page, click on application, then click on edit settings, then click on "connect".

Now our original connect url settings was http://luvinpokerplayers.com/forum/ and now it is http://luvinpokerplayers.com/

Same with the account reclamation url, was http://luvinpokerplayers.com/forum/register.php?do=fbdisconnect and changed it so its now http://luvinpokerplayers.com/register.php?do=fbdisconnect

As I mentioned this is not perfect but it is working for us when someone tries to link to their facebook account when they are on the vBa cmps page.

Haven't tested it yet with facebook auto registration as we have it turned off.

Acido
07-24-2010, 02:23 AM
Well i was playing with the code on the vbadvanced plugis, and i found a solution, but not sure if it's the best option. But it's working.

Looking the code of the plugin called "Query Page Data", i found the redirection to the register.php page. I remove that from the code, and seems work fine all. Also the facebook conection, and link accounts feature as optional to the users.

This is the plugin code as i have in running on my site:

if (defined('VBA_PORTAL'))
{
/*
// ##### Facebook Redirect
if (THIS_SCRIPT == 'adv_index' AND function_exists('is_facebookenabled') AND is_facebookenabled() AND $show['facebookuser'] = vB_Facebook::instance()->userIsLoggedIn())
{
if (do_facebook_redirect() AND
($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId())
OR (!$vbulletin->userinfo['userid'] AND !vB_Facebook::instance()->getVbUseridFromFbUserid())
)
{
exec_header_redirect($vbulletin->options['bburl'] . '/register.php' . $vbulletin->session->vars['sessionurl_q']);
}
}
*/
global $phrasegroups;

// Figure out which page to grab
$pagevar = false;
if (THIS_SCRIPT == 'adv_index')
{
$pagevar = $vbulletin->adv_portal_opts['adv_portal_main']['portal_pagevar'];
}

if (defined('VBA_PAGE'))
{
$getpage = VBA_PAGE;
}
else if($pagevar AND isset($_REQUEST[$pagevar]))
{
$getpage = $_REQUEST[$pagevar];
}
else
{
$getpage = 'home';
}

$initialize_dynamics = false;

($hook = vBulletinHook::fetch_hook('vba_cmps_include_getpage')) ? eval($hook) : false;

// ##### Now grab the page
if ($getpage == 'home')
{
$pages =& $vbulletin->adv_portal_home;
}
else
{
$pages = $db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "adv_pages
WHERE name = '" . $db->escape_string($getpage) . "'
" . iif(!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']), 'AND active = 1')
);

$pages['modules'] = unserialize($pages['modules']);
$pages['userperms'] = explode(',', $pages['userperms']);
$pages['advanced'] = unserialize($pages['advanced']);
$pages['meta'] = unserialize($pages['meta']);
}

$vbulletin->adv_pages =& $pages;

if (!empty($pages['modules']))
{
foreach ($pages['modules'] AS $pagecol => $pagemodules)
{
if (!empty($pagemodules))
{
foreach ($pagemodules AS $advmodid => $advmodorder)
{
if ($vbulletin->adv_modules[$advmodid]['dyna_prefix'])
{
$initialize_dynamics = true;
$phrasegroups[] = $vbulletin->adv_modules[$advmodid]['dyna_prefix'];
}
}
}
}
}
}
else if (defined('VBA_CMPS_ADMIN_FILE') AND in_array($_REQUEST['do'], array('addmodule', 'editmodule', 'copymodule', 'addpage', 'editpage', 'copypage', 'modifysettings')))
{
global $phrasegroups;
$getdyna = false;
if (!empty($vbulletin->adv_modules))
{
foreach ($vbulletin->adv_modules AS $modid => $mod)
{
if ($mod['dyna_prefix'])
{
$getdyna = true;
}
}

if ($getdyna)
{
$phrasegroups[] = 'adv_dyna';
$phrasegroups[] = 'adv_dyna_cp';
}
}
}
else if ($vbulletin->options['vba_portal_navtabs'])
{
$datastore_fetch[] = "'adv_portal_page'";
}Notice that i commented from the third line, where is the comment of Facebook Redirect, to the end of the "if" sentence. By remove that code it looks work fine. But again, i'm not sure if it's the Best Option.

I'll be waiting for some feedback from brian or another coder that can give us a hand to close this issue.

I hope this help.

neoboi
08-13-2010, 01:34 AM
I am also facing the same redirect problem too. I am voting for vbadvanced to look into a good solution to stop this redirect problem to the register page

neoboi
08-13-2010, 02:18 AM
Well i was playing with the code on the vbadvanced plugis, and i found a solution, but not sure if it's the best option. But it's working.

Looking the code of the plugin called "Query Page Data", i found the redirection to the register.php page. I remove that from the code, and seems work fine all. Also the facebook conection, and link accounts feature as optional to the users.

This is the plugin code as i have in running on my site:

if (defined('VBA_PORTAL'))
{
/*
// ##### Facebook Redirect
if (THIS_SCRIPT == 'adv_index' AND function_exists('is_facebookenabled') AND is_facebookenabled() AND $show['facebookuser'] = vB_Facebook::instance()->userIsLoggedIn())
{
if (do_facebook_redirect() AND
($vbulletin->userinfo['userid'] AND $vbulletin->userinfo['fbuserid'] != vB_Facebook::instance()->getLoggedInFbUserId())
OR (!$vbulletin->userinfo['userid'] AND !vB_Facebook::instance()->getVbUseridFromFbUserid())
)
{
exec_header_redirect($vbulletin->options['bburl'] . '/register.php' . $vbulletin->session->vars['sessionurl_q']);
}
}
*/
global $phrasegroups;

// Figure out which page to grab
$pagevar = false;
if (THIS_SCRIPT == 'adv_index')
{
$pagevar = $vbulletin->adv_portal_opts['adv_portal_main']['portal_pagevar'];
}

if (defined('VBA_PAGE'))
{
$getpage = VBA_PAGE;
}
else if($pagevar AND isset($_REQUEST[$pagevar]))
{
$getpage = $_REQUEST[$pagevar];
}
else
{
$getpage = 'home';
}

$initialize_dynamics = false;

($hook = vBulletinHook::fetch_hook('vba_cmps_include_getpage')) ? eval($hook) : false;

// ##### Now grab the page
if ($getpage == 'home')
{
$pages =& $vbulletin->adv_portal_home;
}
else
{
$pages = $db->query_first("
SELECT *
FROM " . TABLE_PREFIX . "adv_pages
WHERE name = '" . $db->escape_string($getpage) . "'
" . iif(!($permissions['adminpermissions'] & $vbulletin->bf_ugp_adminpermissions['cancontrolpanel']), 'AND active = 1')
);

$pages['modules'] = unserialize($pages['modules']);
$pages['userperms'] = explode(',', $pages['userperms']);
$pages['advanced'] = unserialize($pages['advanced']);
$pages['meta'] = unserialize($pages['meta']);
}

$vbulletin->adv_pages =& $pages;

if (!empty($pages['modules']))
{
foreach ($pages['modules'] AS $pagecol => $pagemodules)
{
if (!empty($pagemodules))
{
foreach ($pagemodules AS $advmodid => $advmodorder)
{
if ($vbulletin->adv_modules[$advmodid]['dyna_prefix'])
{
$initialize_dynamics = true;
$phrasegroups[] = $vbulletin->adv_modules[$advmodid]['dyna_prefix'];
}
}
}
}
}
}
else if (defined('VBA_CMPS_ADMIN_FILE') AND in_array($_REQUEST['do'], array('addmodule', 'editmodule', 'copymodule', 'addpage', 'editpage', 'copypage', 'modifysettings')))
{
global $phrasegroups;
$getdyna = false;
if (!empty($vbulletin->adv_modules))
{
foreach ($vbulletin->adv_modules AS $modid => $mod)
{
if ($mod['dyna_prefix'])
{
$getdyna = true;
}
}

if ($getdyna)
{
$phrasegroups[] = 'adv_dyna';
$phrasegroups[] = 'adv_dyna_cp';
}
}
}
else if ($vbulletin->options['vba_portal_navtabs'])
{
$datastore_fetch[] = "'adv_portal_page'";
}Notice that i commented from the third line, where is the comment of Facebook Redirect, to the end of the "if" sentence. By remove that code it looks work fine. But again, i'm not sure if it's the Best Option.

I'll be waiting for some feedback from brian or another coder that can give us a hand to close this issue.

I hope this help.

Your method works for FireFox, Safari, and Chrome browsers. But it does not work for Internet Explorer browsers ( IE shows Error 500 without that line of code there)

I try changing the redirect url to /index.php and it ended in my forum root. not my mainpage root. THen i try my mainpage root, then it caused a redirect loop problem.....

Let's try harder.

Acido
08-13-2010, 03:07 PM
The crazy thing, is that now i'm unable to reproduce the issue in my installation. Brian was checking my ticket and when he come to my site, the issue simply has disappeared.

Actually i'm using the original plugin code and all is running good.

I suggest to who be able to reproduce the problem, open a ticket inmediatly to escalate the issue to him.

Really it have a very strange behavior, very difficult to reproduce between different installations.

Blind Dragon
11-27-2010, 12:20 PM
I know this may seem like a basic thing to check, but I had the same issue after install and fixed it by adjusting the permissions (see screenshot) - sorry if I brought up old thread, but found this thread through google, thought it may be helpful

http://img525.imageshack.us/img525/5654/fbconnect.png