forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: PixelPix on July 11, 2009, 05:04:41 am

Title: [Solved]: Recently Viewed (Last 6 Hours Only)
Post by: PixelPix on July 11, 2009, 05:04:41 am
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
Title: Re: Recently Viewed (Last 6 Hours Only)
Post by: Nibbler on July 11, 2009, 08:56:13 am
Edit index.php, find

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

After that, add a new section for last6

Code: [Select]
                    case 'last6':
                        display_thumbnails('last6', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);
                        flush();
                        break;
Title: Re: Recently Viewed (Last 6 Hours Only)
Post by: PixelPix on July 11, 2009, 12:15:51 pm
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
Title: Re: Recently Viewed (Last 6 Hours Only)
Post by: Nibbler on July 11, 2009, 12:35:16 pm
There are existing threads discussing fixed links. This one is solved.