Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Solved]: Recently Viewed (Last 6 Hours Only)  (Read 1982 times)

0 Members and 1 Guest are viewing this topic.

PixelPix

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
[Solved]: Recently Viewed (Last 6 Hours Only)
« 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
« Last Edit: July 11, 2009, 12:35:25 pm by Nibbler »
Logged

Nibbler

  • Guest
Re: Recently Viewed (Last 6 Hours Only)
« Reply #1 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;
Logged

PixelPix

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 24
Re: Recently Viewed (Last 6 Hours Only)
« Reply #2 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
Logged

Nibbler

  • Guest
Re: Recently Viewed (Last 6 Hours Only)
« Reply #3 on: July 11, 2009, 12:35:16 pm »

There are existing threads discussing fixed links. This one is solved.
Logged
Pages: [1]   Go Up
 

Page created in 0.033 seconds with 19 queries.