Changing The Value Of Each Vote Changing The Value Of Each Vote
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Changing The Value Of Each Vote

Started by Davis, December 17, 2007, 10:04:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Davis

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,

Sami

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>';
‍I don't answer to PM with support question
Please post your issue to related board