This little addon will make category link in the clickstream (on details.php page) pointing on the page where the image is.
Lets try explain one more time with an example
![Wink ;)](https://www.4homepages.de/forum/Smileys/default/icon_wink.gif)
Lets say u click on an image from "random image", then, u can see in the clickstream path of that image (
Home / cat name / subcat name / image name )
then, u click on category name in the clickstream (
subcat name ). It will open categories.php page on first page, but to find where was that image u might need go next page, then maybe next and next and next... I found this little bit anoying, so this mod will help with that "problem" - it will open categories.php page on page where the image is (
categories.php?cat_id=xx&page=xx )
Step 1.Open
/details.phpFind:
unset($image_id_cache);
Add before:
$cur_page = ceil((array_search($image_id, $image_id_cache) + 1) / $perpage);
Step 1.2.Find:
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
Replace with:
$clickstream .= get_category_path($cat_id, 1, $cur_page).$config['category_separator'];
Step 2.Open
/includes/functions.phpFind:
function get_category_path($cat_id = 0, $detail_path = 0) {
Replace with:
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0) {
Step 2.2a originalI leave this "version" of
Step 2.2a so u have a chose
![Wink ;)](https://www.4homepages.de/forum/Smileys/default/icon_wink.gif)
Personaly I'd suggest use
Step 2.2b by effemmessFind:
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$cat_url .= "&".URL_PAGE."=".$regs[1];
}
}
Replace with:
if ($page > 1) {
$cat_url .= "&".URL_PAGE."=".$page;
}else{
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
if (!empty($regs[1]) && $regs[1] != 1) {
$cat_url .= "&".URL_PAGE."=".$regs[1];
}
}
}
Step 2.2b by effemmessFind:
return $path;
Add before:
if ($page > 1){
$path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&".URL_PAGE."=".$page)."\" class=\"clickstream\">page ".$page."</a>";
}
Demo:
http://gallery.vano.org/5686(click at category name in top-left corner)