forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Makc666 on September 15, 2008, 11:41:33 pm

Title: [cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent
Post by: Makc666 on September 15, 2008, 11:41:33 pm
One of the users in Russian sub-forum pointed out to the fact that for example in "Last viewed" section
(The content of the main page -> lasthits)
it happens so that on big galleries the last viewed images changes very often.

1. User opens the main gallery page and in "Last viewed" sees some thumbnails of some images.

2. Then user clicks the URL of say the first thumbnail like:
http://coppermine-gallery.net/demo/cpg14x/displayimage.php?album=lasthits&cat=0&pos=0

3. And after that he is been get not to the image thumbnail of which he just saw but to another one image.

This happened because while he was scrolling (looking) on the homepage some one looked other images.
And they became "Last viewed".


That it.

The fix for this one is follow.

1. Open file:
./include/themes.inc.php

2. Fined the code:
Code: [Select]
            if ($aid == 'lastalb') {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "thumbnails.php?album={$thumb['aid']}",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );

3. After add the code:
Code: [Select]
            } elseif ($aid == 'lasthits') {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?pos=-{$thumb['pid']}",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );

That it...
Title: Re: [cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent
Post by: Makc666 on September 15, 2008, 11:48:12 pm
Also I think that all links on the main page must be permanent...

This one can be "fixed" very easy in this code:
Code: [Select]
            } else {
                $params = array('{CELL_WIDTH}' => $cell_width,
                    '{LINK_TGT}' => "displayimage.php?album=$aid$cat_link&pos={$thumb['pos']}$uid_link",
                    '{THUMB}' => $thumb['image'],
                    '{CAPTION}' => $thumb['caption'],
                    '{ADMIN_MENU}' => $thumb['admin_menu']
                    );
            }

Really I was trying to understand why you use links like:
http://coppermine-gallery.net/demo/cpg14x/displayimage.php?album=lasthits&cat=0&pos=0
on the main page...

But I couldn't :)

Just for bookmarks...
Title: Re: [cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent
Post by: mahdi1234 on September 16, 2008, 07:40:03 pm
thanks a lot! I was missing this, especially for last comments :)
Title: Re: [cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent
Post by: Stramm on September 16, 2008, 10:37:56 pm
a mod for that has been posted a long time ago... still missing are eg. the prev/ next links, filmstrip
Title: Re: [cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent
Post by: Makc666 on September 21, 2008, 08:36:07 pm
a mod for that has been posted a long time ago... still missing are eg. the prev/ next links, filmstrip
May be the mod was posted, but... the current way how "Last viewed" & etc. are working with the URL waking them not permanent is not right.