Archive Archive
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

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