Advanced search  

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

Pages: [1]   Go Down

Author Topic: Ratepic question  (Read 2935 times)

0 Members and 1 Guest are viewing this topic.

susied

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Ratepic question
« 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Ratepic question
« Reply #1 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.
Logged

susied

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Ratepic question
« Reply #2 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Ratepic question
« Reply #3 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.
Logged

susied

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 23
Re: Ratepic question
« Reply #4 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Ratepic question
« Reply #5 on: November 14, 2009, 12:51:30 am »

They do not get wiped out.
Logged
Pages: [1]   Go Up
 

Page created in 0.026 seconds with 20 queries.