Solution for Fbconnect Redirecting to Index page
If you really love your site and have taken time to build your site and if you know the workflow, you will find one absurd behavior of the Nayar FB connect plugin. When you register or login, you will be redirected to the index page rather than the page from where you had clicked fbconnect.
To rectify this, Find
$my_url = $mybb->settings['bburl']."/fbcore/fbconnect.php";
1. Place this code below it.
2. Replace all occurrences ofif($_SERVER['HTTP_REFERER'])
{
$redirect_url = htmlentities($_SERVER['HTTP_REFERER']);
//echo $redirect_url;
}
else
{
$redirect_url = 'index.php';
}
if(!$_COOKIE["LastURL"])
{
setcookie("LastURL", $redirect_url, time()+60);
}
window.location = \"../index.php\"
by
window.location = \"".$_COOKIE["LastURL"]."\"
3. Replace
by//Add his Facebbok UID into database
if($mybb->input['url'] != "" )That's it now, your plugin works fine...
{
redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);
}
else
{
if($_COOKIE["LastURL"])
{
redirect($_COOKIE["LastURL"]);
}
$fbconnectjavascript = "";
}
//Add his Facebbok UID into database
No comments:
Post a Comment