[cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent [cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[cpg1.4.x]: URLs to images of "Last viewed" & etc. are not permanent

Started by Makc666, September 15, 2008, 11:41:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Makc666

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:
            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:
            } 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...

Makc666

Also I think that all links on the main page must be permanent...

This one can be "fixed" very easy in this code:
            } 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...

  • 'random': random files (leaving random files "on" for huge galleries with more than 10,000 pics might result in performance problems; switch random "off" in this case)
  • 'lastup': last uploads
  • 'topn': most viewed
  • 'toprated': top rated
  • 'lastcom': last comments
  • 'lasthits': last viewed
  • 'anycontent': inserts php-generated content that has to reside within the file 'anycontent.php' into the index page. Can be used to include banner-rotation scripts or similar.
  • 'lastalb': last created albums

mahdi1234

thanks a lot! I was missing this, especially for last comments :)

Stramm

a mod for that has been posted a long time ago... still missing are eg. the prev/ next links, filmstrip

Makc666

Quote from: 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
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.