4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: V@no on June 08, 2003, 07:41:58 AM

Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 08, 2003, 07:41:58 AM
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 ;)
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.php
Find:
Code: [Select]
unset($image_id_cache);Add before:
Code: [Select]
$cur_page = ceil((array_search($image_id, $image_id_cache) + 1) / $perpage);
Step 1.2.
Find:
Code: [Select]
$clickstream .= get_category_path($cat_id, 1).$config['category_separator'];Replace with:
Code: [Select]
$clickstream .= get_category_path($cat_id, 1, $cur_page).$config['category_separator'];
Step 2.
Open /includes/functions.php
Find:
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0) {Replace with:
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0) {
Step 2.2a original
I leave this "version" of Step 2.2a so u have a chose ;)
Personaly I'd suggest use Step 2.2b by effemmess

Find:
Code: [Select]
       if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
         if (!empty($regs[1]) && $regs[1] != 1) {
           $cat_url .= "&".URL_PAGE."=".$regs[1];
         }
       }
Replace with:
Code: [Select]
      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 effemmess
Find:
Code: [Select]
 return $path;Add before:
Code: [Select]
 if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">page ".$page."</a>";
  }

Demo:
http://gallery.vano.org/5686
(click at category name in top-left corner)
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: drhtm on June 08, 2003, 11:13:03 AM
works like a charm.  Great idea!
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 08, 2003, 08:11:57 PM
Excellent.  It's annoyed me too and I meant to look into it but didn't have the time.

Thanks!
Title: useful
Post by: Sheep707 on June 08, 2003, 08:53:28 PM
:D Useful Mod!!!

Thx V@no
Title: Extra Link to Subcat on Detail Page
Post by: rp on June 08, 2003, 11:49:35 PM
Thank you V@no this is very usefull Mod!

Is it possible to have an extra link on the detail Page which brings you directly to the page where the thumbnail image is. This would be some kind of an extract from the clickstream on the detail Page.

Example
Clickstream:  Home / cat name / subcat name / image name
Extra Link to: subcat name

For Your Demo this would be:
http://come.no-ip.com/categories.php?cat_id=6&page=64

Any Idea, how this could be done?
Thank you, Romeo
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: effemmess on June 11, 2003, 03:45:35 AM
Hi all,
I have little addon to v@no´s addon:

If you would to have the clickstream in the form as
Home / cat name / subcat name / page2 / image name
then you must do the following in addition to (after!) v@no´s steps:
Step 3.1.
Open /includes/functions.php
Find:
Code: [Select]
$cat_url .= "&amp;".URL_PAGE."=".$page;
Replace with:
Code: [Select]
$pagereg= "&amp;".URL_PAGE."=".$page;

Step 3.2
Find:
Code: [Select]
 return $path;
Add before:
Code: [Select]
 if ($page>1){
    $path=$path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url.$pagereg)."\" class=\"clickstream\">"."Seite ".$page."</a>";
  }


greetz
effemmess
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 11, 2003, 03:57:02 AM
exelent! great idea! :D :idea:
added to my site too ;)

P.S. with your modifications, u dont even need do Step 2.2
u can simply add your modifications like this:
Code: [Select]
 if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">page ".$page."</a>";
  }
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 11, 2003, 04:19:13 AM
Alright, now I'm confused.  I already implemented this mod when it was posted.  

What do I have to change to include the changes from effemmess and V@no  :?:  I can't get this to work.

<cough>  Maybe edit the original post?  :wink:
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 11, 2003, 04:46:32 AM
ok, I've added it to the original post.
I left old Step 2.2., so ppl who already installed it, could restore the changes.
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 11, 2003, 05:29:56 AM
If anyone would like to see this clickstream in categories.php
Home / cat name / subcat name / Page2

Open categories.php

Find:
Code: [Select]
$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)."</span>";

Replace with:
Code: [Select]
$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, ($page > 1), $page)."</span>";
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: effemmess on June 11, 2003, 03:05:06 PM
Hi,
I have a new addon to my addon of v@no´s addon...,  :D
and a question to discuss.
First the addon:
If you want it in your language you must do following:

In Step 2.2. by effemmess
do not add:
Code: [Select]
 if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">page ".$page."</a>";
  }

but
Code: [Select]
 if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">".$lang['page']." ".$page."</a>";
  }

Step 2.3. by effemmess
Find:
Code: [Select]
 global $site_sess, $config, $cat_cache, $url;
Replace:
Code: [Select]
 global $site_sess, $config, $cat_cache, $url,$lang;
Step 3. by effemmess
Open /lang/.../main.php
Add wherever you want after
Code: [Select]
<? and before
Code: [Select]
?>
this
Code: [Select]
$lang['page'] = "Seite"; // or whatever you want (e.g. straniza  :-) )

That´s all.
--------------------------
And now the question:
If I do not do
Code: [Select]
        if ($page > 1) {
           $extension= "&amp;".URL_PAGE."=".$page;
         }else{
           if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
             if (!empty($regs[1]) && $regs[1] != 1) {
               $cat_url .= "&amp;".URL_PAGE."=".$regs[1];
             }
           }
         }

and in consequence
Code: [Select]
 if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url.$extension."=".$page)."\" class=\"clickstream\">".$lang['page']." ".$page."</a>";
  }

the value of $regs[1] == $page and in consequence the subcat hasn´t the link to page1. In v@no´s demolink it´s okay, but why??? :?:
Here is my complete not functioning function get_category_path
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0) { //nicht i.O.
  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;
        if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
          if (!empty($regs[1]) && $regs[1] != 1) {
            $cat_url .= "&amp;".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
  if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">".$lang['page']." ".$page."</a>";
  }
  return $path;
}

And here is my complete at my site functioning function get_category_path
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0) { // i.O.
  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;
        if ($page > 1) {
          $cat_url_ext = "&amp;".URL_PAGE."=".$page;
        }
        else{
          if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
            if (!empty($regs[1]) && $regs[1] != 1) {
              $cat_url .= "&amp;".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
  if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url.$cat_url_ext)."\" class=\"clickstream\">".$lang['page']." ".$page."</a>";
  }
  return $path;
}

Has anybody (v@no) an idea? :?:  :?
cu
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 11, 2003, 08:28:17 PM
Quote from: effemmess
I have a new addon to my addon of v@no´s addon...,  :D
LMAO :lol: good one ;)
actualy I cheated...:D ;)
I have modifyed the function, so, it wont show link for / page 2 when u are browsing categories, and only show as a link from details.php
I think would be better if I just show u my function:
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0, $page_details = 0) {
  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 && ($page > 1 || $page_details)) {
        $cat_url = ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id;
       if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
         if (!empty($regs[1]) && $regs[1] != 1) {
           $cat_url .= "&amp;".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
  if ($page > 1){
    $pagereg = "&amp;".URL_PAGE."=".$page;
    $page = ($page_details) ? "<a href=\"".$site_sess->url($cat_url.$pagereg)."\" class=\"clickstream\">".$lang['lang_userlist_page'].$page."</a>" : $lang['lang'].$page;
    $path = $path.$config['category_separator'].$page;
  }
  return $path;
}

then, in details.php I changed call function to this:
Code: [Select]
 $clickstream .= get_category_path($cat_id, 1, $cur_page, 1).$config['category_separator'];
and in categories.php to this:
Code: [Select]
$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>";

P.S. not sure why this happend, but sometimes when I enter in details.php, both / cat_name / and / page 2 / have link with &page=2
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 11, 2003, 08:46:22 PM
I know why and I already fixed it yesterday.  :wink:

I'll post what I did in a few minutes.
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Xwall on June 11, 2003, 08:58:14 PM
Well somebody can put all the correct steps in only one post   :?
i´m feeling  :evil:   :!:  :idea:  :lol:
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 11, 2003, 09:04:51 PM
Quote from: Xwall
i´m feeling  :evil:   :!:  :idea:  :lol:

ah, no, its not good when Xwall feels :evil:.... 8O
;) j/k
lets way for Chris. but for now, u can do:
1) steps from 1 to 2.1 and chose step 2.2. from either of two in the original post
2) do "version" from my post above. (it's compleate mod there just search in details.php and categories.php for $clickstream find very simular to the one u need change it ;))
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 11, 2003, 09:22:15 PM
Quote from: V@no
P.S. not sure why this happend, but sometimes when I enter in details.php, both / cat_name / and / page 2 / have link with &page=2

ok, I figured out when this happend and why:
it happends when I enter in details page from categories.php with page=xx
so, to solve this problem, in my lattest code replace
Code: [Select]
         if (!empty($regs[1]) && $regs[1] != 1) { with:
Code: [Select]
         if (!empty($regs[1]) && $regs[1] != 1 && !$page_details) {
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 11, 2003, 09:30:34 PM
Sorry, I'm stuck on something at work and can't do the post now.  I'll try to do it tonight.
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 12, 2003, 02:12:21 AM
Okay, here's what I can contribute.

V@no:  The reason sometimes you have $page=2 on category name from details.php is because the variable $url in the function get_category_path() stores the referer URL, not the current URL.  So that affects this line:
Code: [Select]
if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) { since the while loop is executing one more time than before the mod (for the page number)

Next post is my complete version of this mod.

P.S.:  You can use print_r to output variable information.  It's a great php built-in function that's useful for testing/debugging.  For example:
Code: [Select]
print_r($regs);might output something like this:
Quote
Array (
  • => page=3 [1] => 3 )
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 12, 2003, 02:36:44 AM
Here is the clickstream I set up with this version of the mod.  Note that all bold items would be a clickable link.  When CategoryName is bold, the link would take you to page 1 for that category.

Clickstream from categories.php while on page 1
Home | CategoryName

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 | ImageName

Clickstream from details.php when image is on page 2 or higher
Home | CategoryName | Page 4 | ImageName

 :wink:  Looks like V@no and I took a similar approach with the addition of another parameter for get_category_path()

1.  Open includes/functions.php

1.1 Locate
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0)
Replace with:
Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0, $category_path = 0) {

1.2 Locate:
Code: [Select]
         if (!empty($regs[1]) && $regs[1] != 1) {
            $cat_url .= "&amp;".URL_PAGE."=".$regs[1];
          }

Replace with:
Code: [Select]
         if (!empty($regs[1]) && $regs[1] != 1 && $page == 0) {
            $cat_url .= "&amp;".URL_PAGE."=".$regs[1];
          }

1.3 Locate:
Code: [Select]
 return $path;
Insert before:
Code: [Select]
 if ($page > 1){
    $path .= $config['category_separator'];
    if( $detail_path && !$category_path )
      $path .= "<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">Page ".$page."</a>";
    else
      $path .= "Page ".$page."</a>";
  }


2. Open details.php
Locate:
Code: [Select]
 $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
Replace with:
Code: [Select]
 $clickstream .= get_category_path($cat_id, 1, $cur_page).$config['category_separator'];

3. Open categories.php
Code: [Select]
$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)."</span>";
Replace with:
Code: [Select]
$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, ($page > 1), $page, 1)."</span>";

Note:  This makes clickstream a little inconsistent because lightbox.php has the potential to span multiple pages.  So does member.php.  In fact, I did a quick search and here are the files that use get_category_path()
Quote
$ find . -name "*.php" -print -exec grep get_category_path {} \;
./admin/admin_functions.php
./admin/admin_global.php
./admin/backup.php
./admin/categories.php
./admin/checkimages.php
./admin/comments.php
./admin/email.php
./admin/home.php
./admin/images.php
./admin/index.php
./admin/progress.php
./admin/resizer.php
./admin/settings.php
./admin/stats.php
./admin/templates.php
./admin/thumbnailer.php
./admin/usergroups.php
./admin/users.php
./admin/validateimages.php
./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)."</span>";
./config.new.php
./details.php
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
./download.php
./global.php
./includes/auth.php
./includes/constants.php
./includes/db_field_definitions.php
./includes/db_mysql.php
./includes/db_utils.php
./includes/email.php
./includes/functions.php
function get_category_path($cat_id = 0, $detail_path = 0) {
./includes/image_utils.php
./includes/page_footer.php
./includes/page_header.php
./includes/paging.php
./includes/search_utils.php
./includes/sessions.php
./includes/template.php
./includes/upload.php
./includes/upload_definitions.php
./includes/zip.php
./index.php
./install.php
./lang/deutsch/admin.php
./lang/deutsch/install.php
./lang/deutsch/main.php
./lang/english/admin.php
./lang/english/install.php
./lang/english/main.php
./lang/french/admin.php
./lang/french/install.php
./lang/french/main.php
./lang/spanish/admin.php
./lang/spanish/install.php
./lang/spanish/main.php
./lightbox.php
./login.php
./logout.php
./member.php
  $txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".$comment_row['image_name']."</a>".$config['category_separator'];
  $txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".$comment_row['image_name']."</a>".$config['category_separator'];
  $txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".$comment_row['image_name']."</a>".$config['category_separator'];
  $txt_clickstream = get_category_path($comment_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row['image_id'])."\" class=\"clickstream\">".$comment_row['image_name']."</a>".$config['category_separator'];
  $txt_clickstream = get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
  $txt_clickstream = get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
  $txt_clickstream = get_category_path($image_row['cat_id'], 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
    $txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
    $txt_clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
./phpinfo.php
./postcards.php
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator']."<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id)."\" class=\"clickstream\">".$image_row['image_name']."</a>".$config['category_separator'];
./register.php
./search.php
./top.php
  $clickstream .= get_category_path($cat_id, 1).$config['category_separator'];
./config.php
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 12, 2003, 02:47:51 AM
very nice, Chris!
but I didnt get this part:
Quote from: Chris
Note:  This makes clickstream a little inconsistent because lightbox.php has the potential to span multiple pages.  So does member.php.

what were u talking about?
what lightbox has with get_category_path() ?
all it add in clickstream is name "lighbox" that's all...
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: Chris on June 12, 2003, 02:53:45 AM
Exactly my point.  If you have 3 pages of images stored in your lightbox and you click on an image from page 2, you only get:

Home | Light Box

and there's no easy way to get:

Home | Light Box | Page 2
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 12, 2003, 03:02:53 AM
Quote from: Chris
Exactly my point.  If you have 3 pages of images stored in your lightbox and you click on an image from page 2, you only get:

Home | Light Box

and there's no easy way to get:

Home | Light Box | Page 2
ah oh uh now I got it...
and u are right, its not easy to do...
Title: [MOD] Cat name in clickstream->to the page# where image i
Post by: effemmess on June 12, 2003, 04:46:12 AM
Hi ladies and gentlemen,

do I have an addon for the addon of the addon to the addon ... ???
Yes!!! :D

But first my version of our function:
Code: [Select]
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 .= "&amp;".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  = "&amp;".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:
Code: [Select]
$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:
Code: [Select]
 $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. :roll:
@Xwall
How do you feel now?  :D

And now:
In all other php-files with paging you can do following:
before $clickstream="..." add
Code: [Select]
$page= (empty($page)) ? 1 :$page;

and edit the clickstream-row!
for example in lightbox.php:
Code: [Select]
$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.de
bye
Title: Re: Extra Link to Subcat on Detail Page
Post by: pietg on June 14, 2003, 11:50:15 PM
Quote from: rpiatti
Thank you V@no this is very usefull Mod!
Is it possible to have an extra link on the detail Page which brings you directly to the page where the thumbnail image is. This would be some kind of an extract from the clickstream on the detail Page.
Example
Clickstream:  Home / cat name / subcat name / image name
Extra Link to: subcat name

From me the same question.
But I would like to have the link "hidden" under a button (picture).

(http://test.totaaldigitaal.nl/clickstream.jpg)

Piet
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: TIMT on October 22, 2005, 09:00:55 AM
Quote
Is it possible to have an extra link on the detail Page which brings you directly to the page where the thumbnail image is. This would be some kind of an extract from the clickstream on the detail Page.
Example
Clickstream:  Home / cat name / subcat name / image name
Extra Link to: subcat name

I have the same need. Can anybody help me?
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: JensF on January 15, 2006, 01:14:24 PM
And now:
In all other php-files with paging you can do following:
before $clickstream="..." add
Code: [Select]
$page= (empty($page)) ? 1 :$page;
and edit the clickstream-row!
for example in lightbox.php:
Code: [Select]
$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>";

I have install the Multi Lightbox Box. What must i change to have this function in lightbox (see on which site i am)???

The Original from the Multi Lightbox Mod

Quote
/*
  MOD MULTI-LIGHTBOXES
  START REPLACE
*/
}
$clickstream = "<span class=\"clickstream\"><a href=\"".$site_sess->url(ROOT_PATH."index.php")."\" class=\"clickstream\">".$lang['home']."</a>".$config['category_separator'].$txt_clickstream."</span>";
/*
  MOD MULTI-LIGHTBOXES
  END REPLACE
*/
Title: Re: Extra Link to Subcat on Detail Page
Post by: Lunique on May 19, 2006, 09:26:11 PM
Quote from: rpiatti
Thank you V@no this is very usefull Mod!
Is it possible to have an extra link on the detail Page which brings you directly to the page where the thumbnail image is. This would be some kind of an extract from the clickstream on the detail Page.
Example
Clickstream:  Home / cat name / subcat name / image name
Extra Link to: subcat name

I need the same, or only the extra link. Is this possible?

editet: I found what I need here: http://www.4homepages.de/forum/index.php?topic=2683.msg70658#msg70658
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: MetallicAchu on May 21, 2006, 01:55:20 AM
Excellent!

Exactly what I was looking for.
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: MetallicAchu on May 21, 2006, 07:39:47 AM
BTW, I noticed that this feature doesn't really work on searched pictures.
Eg. if search for something (or press the "new images" for say) and you detail an image, this mod will take you back to the start, not the page you were in. :)

Any thoughts on that?
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: bunelul on June 21, 2006, 08:09:15 AM


Ok, i installed this mod but now i have this url-s from clickstrean: categories.php?cat_id=19&page=4&page=4 and can`t figure out what is wrong...
Could somebody enlight me?

Thanks.
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on June 21, 2006, 08:24:05 AM
You must have installed two versions of Step 2.2
You should use only one of them.

P.S. I've updated original post and added color to these steps, should be less confusing now :)
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: bunelul on June 21, 2006, 08:51:05 AM
You must have installed two versions of Step 2.2
You should use only one of them.

P.S. I've updated original post and added color to these steps, should be less confusing now :)

Thanks for fast replay, Vano

Just want to let you know i`ve reversed to backup and installed again, now it printed on the page (clickstream) page 2 / page 2 with same in the url.
Now, for a while i`ve decided not to use this MOD.

Thank you.
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: Ch*yeuk on July 23, 2006, 10:25:54 PM
Just what I was looking for! Excellent =D I found the clickstream page thing annoying too. I prefer the first method though. I tried the second one and it just didn't.. look that good heh.
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: idijotaz on July 24, 2006, 08:06:59 AM
wow thats really nice mod  :)
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: masterred on February 06, 2008, 08:55:18 PM
hi

show me one error in details.php line 176

Code: [Select]
$cur_page = ceil((array_search($image_id, $image_id_cache) + 1) / $perpage);
this is the error message

Quote
Warning: array_search() [function.array-search]: Wrong datatype for second argument in C:\AppServ\www\encanto\details.php on line 176

used MySQL 5.0.27
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: thunderstrike on February 07, 2008, 02:12:16 AM
Is no mySQL error. Is PHP error. What PHP version you use ?
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: masterred on February 07, 2008, 04:09:24 PM
hi

used PHP Version 5.2.5

thank
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: lkw-modellbau.de on March 21, 2008, 11:21:32 PM
Hallo zusammen,

wollte mal fragen, ob es auch möglich ist einfach unter dem Bild in der Navigationsleite (Bild vorwärts, Bild zurück) in details.php einen Link "zurück zur Übersicht" zu erschaffen, zusätzlich zum Pfad der oben angezeigt wird ? Der sollte dann auf die aktuelle Unterseite gehen von der der Besucher gekommen ist (auch wenn er vorher vll schon 1, 2 Fotos ausgewählt hat). Wenn man im Browser zurück klickt erscheint nämlich immer die Fehlermeldung, dass die Seite nicht mehr aktuell ist..

Vielen Dank für eure Hilfe !!
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: honda2000 on May 24, 2008, 05:07:54 PM
erstens würde ich Bild zurück / Bild vor über und unter dem Bild einfügen

...und außerdem den Clickstream in die Tabelle einfügen
dann kommst du ja automatisch immer in die jeweilige Kategorie/Unterkategorie (die wird ja im Clickstream angezeigt) oder eben sogar noch mehr Ebenen höher, ganz nach belieben

in details.html vor:

Quote
<div align="center">
 {image}

Quote
<table width="100%" border="0" cellspacing="0" cellpadding="1">
                    <tr>
                      <td class="bordercolor">

<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><img src="{template_url}/images/spacer.gif" width="4" height="4" alt="" />{clickstream}</td>
</tr>
</table>
</td>
</tr>

<tr>
<td class="bordercolor">


                        <table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr valign="top">
                            <td class="row2"> {if prev_image_name}{lang_prev_image}<br />
                              <b><a href="{prev_image_url}">{prev_image_name}</a></b>
                              <!-- <br /><br /><a href="{prev_image_url}"><img src="{prev_thumb_file}" border="1"></a> -->
                              {endif prev_image_name}&nbsp;</td>
                            <td align="right" class="row2"> &nbsp;{if next_image_name}{lang_next_image}<br />
                              <b><a href="{next_image_url}">{next_image_name}</a></b>
                              <!-- <br /><br /><a href="{next_image_url}"><img src="{next_thumb_file}" border="1"></a> -->
                              {endif next_image_name}</td>
                          </tr>
                        </table>
                      </td>
                    </tr>
                  </table>

einfügen
(kannst du dir einrichten, wie du möchtest)
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: Crazymodder on February 15, 2010, 11:27:10 PM
Hi at first thanks for that great mod...It works nearly perfectly. I have installed the Google friendly urls. Now there is a problem if i use the orginal code.
 in functions.php i change the code to:

Code: [Select]
  if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$cat_url."&amp;page=".$page."\" class=\"clickstream\">Seite ".$page."</a>";

no it works but the format is:
categories.php?cat_id=1&page=2 and not k_catname_1.html?page=2

i know i have to use:
.$site_sess->url but if i do this the url categories.php?cat_id=1&page=2 looks so: k_1.2.

I hope someone have an idea;) thanks
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on February 16, 2010, 12:51:22 AM
Which exactly google friendly url are you referring to?
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: Crazymodder on February 16, 2010, 11:47:16 AM
i used that mod:
http://www.4homepages.de/forum/index.php?topic=17598.0
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on February 16, 2010, 03:59:46 PM
Did you actually try use 2.2b version without any extra modifications? it should work just fine...
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: Crazymodder on February 16, 2010, 05:28:57 PM
Yes i have try 2.2b...But there the url looks like this:
k1.2.html
and thats wrong my functions.php look so:

Code: [Select]
function get_category_path($cat_id = 0, $detail_path = 0, $page = 0) {
  global $site_sess, $config, $cat_cache, $url;
  $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;
        if (preg_match("/".URL_PAGE."=([0-9]+)/", $url, $regs)) {
          if (!empty($regs[1]) && $regs[1] != 1) {
            $cat_url .= "&amp;".URL_PAGE."=".$regs[1];
          }
        }
        $path = "<a href=\"".$site_sess->url($cat_url)."\" class=\"clickstream\">".format_text($cat_cache[$cat_id]['cat_name'], 2)."</a>";
      }
      else  {
        $path = format_text($cat_cache[$cat_id]['cat_name'], 2);
      }
    }
    else {
      $path = "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"clickstream\">".format_text($cat_cache[$cat_id]['cat_name'], 2)."</a>".$config['category_separator'].$path;
    }
    $cat_id = $parent_id;
  } // end while
  if ($page > 1){
    $path = $path.$config['category_separator']."<a href=\"".$site_sess->url($cat_url."&amp;".URL_PAGE."=".$page)."\" class=\"clickstream\">page ".$page."</a>";
  }
  return $path;
}
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on February 17, 2010, 06:33:31 AM
Sorry, it's a bug in the mod you've mentioned. Perhaps the author of that mod can assist you or this already was covered in the replies of that mod somewhere...
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: GaYan on February 17, 2010, 08:48:32 AM
Works Great  :D
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: khansahib on September 17, 2010, 06:59:35 AM
nice mod..
can anybody tell how to fix the link on "Page #"

In my case..

Home / Category / Sub-Cat / Page 6

everything is fine but page 6 link is wrong.. it is something like "cat#.6.htm" where 6 is page number.

thanks
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on September 17, 2010, 08:35:11 AM
and what is it supposed to be?
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: khansahib on September 17, 2010, 08:43:42 AM
sorry for the bad explanation

the original link is
http://www.my-site.com/wallpapers/cat-automobiles-3.htm?page=6

while in clickstream it directs to
http://www.my-site.com/wallpapers/cat3.6.htm

which does not exist..
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on September 17, 2010, 09:00:31 AM
Which SEO mod you've installed? and is it the "original" mod or modified version from replies?
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: khansahib on September 17, 2010, 09:07:29 AM
.htaccess from here
http://www.4homepages.de/forum/index.php?topic=17598.0

and session.php from here
http://www.4homepages.de/forum/index.php?topic=6729.0
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on September 17, 2010, 02:28:38 PM
That is one your problems, you should do both changes from the same mod..
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: khansahib on September 17, 2010, 03:07:40 PM
now i'm running both .htaccess and session.php of this thread "http://www.4homepages.de/forum/index.php?topic=17598.0" but even then my problem is not solved, still same not working hyperlink on page is coming.. please help me out.. Thanks
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: V@no on September 17, 2010, 03:24:54 PM
Try this:
http://www.4homepages.de/forum/index.php?topic=17598.msg147338#msg147338

P.S. any further questions regarding this issue, please reply to the SEO mod ;)
Title: Re: [MOD] Cat name in clickstream->to the page# where image i
Post by: khansahib on September 17, 2010, 03:40:31 PM
Worked like a charm.. you made my day :D
Thanks alot :)