[Solved]: Recently Viewed (Last 6 Hours Only) [Solved]: Recently Viewed (Last 6 Hours Only)
 

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

[Solved]: Recently Viewed (Last 6 Hours Only)

Started by PixelPix, July 11, 2009, 05:04:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PixelPix

I have just found this mod from a couple of years ago that limits the "Recently Viewed" images to those viewed in the last 6 hours.  http://forum.coppermine-gallery.net/index.php/topic,44587.0.html

Having over 60000 images in my gallery (http://www.potd.com.au/gallery) I am always looking for ways to reduce the load on my server and am hoping that this will be of use, as clicking the "Recently Viewed Images...." link above my gallery thumbs creates links to over 2200 pages.

Naturally, pages around #2200 could hardly be considered "Recently Viewed"  :)  ...in fact anything past just a few pages is overkill for my needs.

I have tested the code in my secondary dev site and it works fine, so I was wondering if it would be possible (and if so, how?) to include it as "Content of the main page" (ie. /breadcrumb/catlist/alblist/last6,1/lastup,3/lastcom,2), in place of the current recently viewed thumbs?

Many thanks

Rusty

Nibbler

Edit index.php, find


                    case 'lasthits':
                        display_thumbnails('lasthits', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                        flush();
                        break;


After that, add a new section for last6


                    case 'last6':
                        display_thumbnails('last6', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                        flush();
                        break;

PixelPix

Thank you Nibbler that worked a treat. 

Unfortunately, now that I have installed it on my much busier main site, I see that the original mod does not create "fixed" links to the intermediate images. (ie. new views by other users in the background effect the links and clicking on a thumb will not always see you arrive at that particular image.)

I will investigate the mod a little more and see if I can figure out what it is doing by comparing it with the regular "lasthits' code.

I am not good at this stuff and don't fancy my chance of success. That being the case, do you think it's worth a new thread to solve this new issue, or being an old mod is it best left to die? 

Thanks again for your help.

Rusty

Nibbler

There are existing threads discussing fixed links. This one is solved.