Problem: Back button not working in some instances and you go to the home page vs the last page
Solution: edit the file
/includes/functions/functions_general.php
around lines 989 - 1004 is the function:
PHP Code:
////
// Set back button
function zen_back_link() {
if (sizeof($_SESSION['navigation']->path)-2 > 0) {
$back = sizeof($_SESSION['navigation']->path)-2;
$link = '<a href="' . zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']) . '">';
} else {
if (isset($_SERVER['HTTP_REFERER']) && strstr(HTTP_SERVER, $_SERVER['HTTP_REFERER'])) {
$link= $_SERVER['HTTP_REFERER'];
} else {
$link = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">';
}
$_SESSION['navigation'] = new navigationHistory;
}
return $link;
}
replace it with the following:
PHP Code:
////
// Set back button
function zen_back_link() {
if (sizeof($_SESSION['navigation']->path)-2 > 0) {
$back = sizeof($_SESSION['navigation']->path)-2;
$link = '<a href="' . zen_href_link($_SESSION['navigation']->path[$back]['page'], zen_array_to_string($_SESSION['navigation']->path[$back]['get'], array('action')), $_SESSION['navigation']->path[$back]['mode']) . '">';
} else {
if (isset($_SERVER['HTTP_REFERER']) && strstr($_SERVER['HTTP_REFERER'], HTTP_SERVER)) {
$link= '<a href="' . $_SERVER['HTTP_REFERER'].'">';
} else {
$link = '<a href="' . zen_href_link(FILENAME_DEFAULT) . '">';
}
$_SESSION['navigation'] = new navigationHistory;
}
return $link;
}
Thanks to Absolute for posting this current solution ...
Note: it has been tested to some degree but not to 100% satisfaction ... granted I cannot break it thus far so perhaps it has ...
Bookmarks