Hi ladies and gentlemen,
do I have an addon for the addon of the addon to the addon ... ???
Yes!!!
But first my version of our function:
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0, $page_details = 0) { // V3 by effemmess
global $site_sess, $config, $cat_cache, $url, $lang;
$parent_id = 1;
while ($parent_id) {
if (!isset($cat_cache[$cat_id]['cat_parent_id'])) {
return false;
}
$parent_id = $cat_cache[$cat_id]['cat_parent_id'];
if (empty($path)) {
if ($detail_path) {
$cat_url = ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id;
/* imo we do not need this, because we do later our own page-handling...
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
printf($regs[1]."<br />");
if (!empty($regs[1]) && $regs[1] != 1 && !$page_details) {
$cat_url .= "&".URL_PAGE."=".$regs[1];
}
}
*/
$path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>";
}
else {
$path = $cat_cache[$cat_id]['cat_name'];
}
}
else {
$path = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"clickstream\">".$cat_cache[$cat_id]['cat_name']."</a>".$config['category_separator'].$path;
}
$cat_id = $parent_id;
} // end while
$pagereg = "&".URL_PAGE."=".$page;
$page = ($page_details) ? "<a href=\"".$site_sess->url($cat_url.$pagereg)."\" class=\"clickstream\">".$lang['page']." ".$page."</a>" : $lang['page']." ".$page;
$path = $path.$config['category_separator'].$page;
return $path;
}
clickstream in categories.php:
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].get_category_path($cat_id, 1, $page)."</span>";
clickstream in details.php:
$clickstream .= get_category_path($cat_id, 1, $cur_page, 1).$config['category_separator'];
It produces following:
Clickstream from categories.php while on page 1
Home | CategoryName | Page 1
Clickstream from categories.php while on page 2 or higher
Home | CategoryName | Page 4
Clickstream from details.php when image is on page 1
Home | CategoryName | Page 1 | ImageName
Clickstream from details.php when image is on page 2 or higher
Home | CategoryName | Page 4 | ImageName
Note that all bold items are clickable, the categorie-items are links to page 1.
Imo this is the best solution...what do you think.
@Xwall
How do you feel now?
And now:
In all other php-files with paging you can do following:
before $clickstream="..." add
$page= (empty($page)) ? 1 :$page;
and edit the clickstream-row!
for example in lightbox.php:
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'];
$clickstream.= "<a href=\"".$site_sess->url(ROOT_PATH."lightbox.php")."\" class=\"clickstream\">".$lang['lightbox']."</a>".$config['category_separator'];
$clickstream.= $lang['page']." ".$page."</span>";
cu and good night...mhhh only 2,5 h to sleep...
effemmess
PS: you can show, how it looks at:
http://www.auf-einem-blick.debye