News:

CPG Release 1.6.29
During HTML5 upload, keep pseudo blank code 200 messages from triggering error condition
added Russian language
correct failure to use theme menu icons in album manager
minor vulnerabilities mitigation

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