Archive Archive
 

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

Archive

Started by Stramm, July 02, 2005, 09:07:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Stramm

Hi, I'd like to suggest an archive feature for 1.5
It should be able to rotate out MySQL data from the cpg_picture table to an archive table after a certain amount of time using cron etc.
This would help to keep the main table clean and fast to process. A link to the archive could be placed eg below each album. Browsing the archive's using the same routines than the main image gallery.

donnoman

You could code this without cron.

create your archive  table, create a config table entry like 'last_archive'

create code in your init.inc.php

if $config['last_archive'] is < today then run archive()

function archive runs the sql select into query and then delete from, then updates last_archive to todays date.

Thats pretty much it.

It will run once a day at some point, then not try to run again until the next day, and you only waste one "if" test, and the entire config table gets loaded in init anyway, so its not like you had to do an extra sql query to find out when it ran last..

coding user access to the archive is going to be the same with/without cron.

hth