Forum
Welcome, Guest
Please Login to access forum.
Refer user to the page where he came from (1 viewing) 
Go to bottom
TOPIC: 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.
#5997
Raycho Raychev
Fresh Boarder
Posts: 11
User Offline
Re:Refer user to the page where he came from Karma: 0  

Hi, i need help 1!!!

Need to show modul in not login users in review on VM2 product details.
And when user login redirect on same page?

The code up not work on me!!!
 
Logged Logged  
  The administrator has disabled public write access.
#5998
John Dagelmore
Admin
Posts: 3722
User Online Now
Re:Refer user to the page where he came from Karma: 79  
You can't if VM doesn't support for example {loadmodule} or {loadposition} like Joomla content does.
In the configuration of the component 'Login redirect page' -> 'Default' normally redirects to the same page.
 
Logged Logged  
  The administrator has disabled public write access.
Go to top