Forum
Welcome, Guest
Please Login to access forum.
Re:Refer user to the page where he came from (1 viewing) 
Go to bottom
TOPIC: Re:Refer user to the page where he came from
#3908
Samira
Fresh Boarder
Posts: 4
User Offline
Re:Refer user to the page where he came from Karma: 0  
Very nice John! Thank you, that did the trick!

just in case anyone else want the same, below is the added code in the modules\mod_instantfblogin\helper.php file, added to the getReturnURL function.

Cheers,
Samira


//ADDED code
$urlTmp = cmsFramework::getCurrentUrl();
$urlPieces = explode("#", $urlTmp);
$url = $urlPieces[0];


//OVERVIEW WHERE I ADDED It.
if (! $url) {
// stay on the same page
$uri = clone JFactory::getURI ();
$vars = $router->parse ( $uri );
unset ( $vars ['lang'] );
if ($router->getMode () == JROUTER_MODE_SEF) {
if (isset ( $vars ['Itemid'] )) {
$itemid = $vars ['Itemid'];
$menu = $app->getMenu ();
$item = $menu->getItem ( $itemid );
unset ( $vars ['Itemid'] );
$url = $domain . (JRoute::_ ( 'index.php?Itemid=' . $itemid ));
} else {
$url = $domain . (JRoute::_ ( 'index.php?' . JURI::buildQuery ( $vars ), false ));
}
} else {
$url = 'index.php?' . JURI::buildQuery ( $vars );
}
//SZS start
$urlTmp = cmsFramework::getCurrentUrl();
$urlPieces = explode("#", $urlTmp);
$url = $urlPieces[0];
//SZS ends
}
 
Logged Logged  
  The administrator has disabled public write access.
Go to top