coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: Davis on December 17, 2007, 10:04:56 PM

Title: Changing The Value Of Each Vote
Post by: Davis on December 17, 2007, 10:04:56 PM
In my Top Rated section you see the thumbnails. Under each is the stars value and the number of votes a picture has gotten.  My question is how do I alter the code so that every 1 vote shows up as 21 under the thumbnail?

I use this code in the functions.inc.php to increase the number of "Views" from 1 per click to 21 but I can't figure out how to do the same with the "Votes"


function add_hit($pid)
{
        global $CONFIG, $raw_ip;
        cpg_db_query("UPDATE {$CONFIG['TABLE_PICTURES']} SET hits=hits+21, lasthit_ip='$raw_ip', mtime=CURRENT_TIMESTAMP WHERE pid='$pid'");



Thanks,
Title: Re: Changing The Value Of Each Vote
Post by: Sami on December 20, 2007, 05:46:25 AM
Find this line under function.inc.php (around #866)

$caption .= "<span class=\"thumb_caption\">".'<img src="'.$prefix.'images/rating'.round($row['pic_rating']/2000).'.gif" alt=""/>'.'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']).'</span>';


and replace it with this

$caption .= "<span class=\"thumb_caption\">".'<img src="'.$prefix.'images/rating'.round($row['pic_rating']/2000).'.gif" alt=""/>'.'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']*21).'</span>';