forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: susied on November 13, 2009, 04:42:08 pm

Title: Ratepic question
Post by: susied on November 13, 2009, 04:42:08 pm
<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?
Title: Re: Ratepic question
Post by: 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.
Title: Re: Ratepic question
Post by: susied on November 14, 2009, 12:18:27 am
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.
Title: Re: Ratepic question
Post by: Joachim Müller on November 14, 2009, 12:31:15 am
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.
Title: Re: Ratepic question
Post by: susied on November 14, 2009, 12:45:28 am
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.
Title: Re: Ratepic question
Post by: Joachim Müller on November 14, 2009, 12:51:30 am
They do not get wiped out.