Ratepic question Ratepic question
 

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

Ratepic question

Started by susied, November 13, 2009, 04:42:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

susied

<code>// Clean votes older votes
$curr_time = time();
$clean_before = $curr_time - $CONFIG['keep_votes_time'] * 86400;
$sql = "DELETE " . "FROM {$CONFIG['TABLE_VOTES']} " . "WHERE vote_time < $clean_before";
$result = cpg_db_query($sql);</code>

I found where in the table keep_votes_time is set to 30 but I am not understanding how this works.
I am setting up a site where we want to keep monthly contests over the course of years.
Right now we have contest information from 2003 but we are only going to put 2009 into Coppermine when it gets moved from development to our live site (it is on the live site now but deep in folders)
http://www.catconnection.net/contest/cpg1.4.25/cpg14x/index.php

Can someone explain to me how this code works in plain english?

Joachim Müller

What exactly do you want to accomplish? Why do you want to edit that piece of code (taken from ratepic.php)? Use the config option to get the lever you want to get.

susied

Quote from: Joachim Müller on November 13, 2009, 11:58:18 PM
What exactly do you want to accomplish? Why do you want to edit that piece of code (taken from ratepic.php)? Use the config option to get the lever you want to get.

I am not wanting to change this code. I am wanting to understand what I can set the what is now 30 to so that monthly votes will stay with each album for at least a year.

Joachim Müller

86400 = 24 x 60 x 60 = one day.
But as far as I can see $CONFIG['keep_votes_time']  doesn't get populated, so that's probably a leftover that was forgotten or a feature that was never implemented.

susied

I read in a thread (and i am sorry i don't know which one I have been on here all day) that the only place to update it was using phpMyAdmin and I do see 30 populated in the table. I just wasn't sure if the 24 hours was then multiplied by the 30 saying keep pics for a month for instance.

All I really care about is that my votes don't get wiped out.

Thanks again.

Joachim Müller