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: Changing The Value Of Each Vote  (Read 2245 times)

0 Members and 1 Guest are viewing this topic.

Davis

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 45
Changing The Value Of Each Vote
« 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,
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Changing The Value Of Each Vote
« Reply #1 on: December 20, 2007, 05:46:25 am »

Find this line under function.inc.php (around #866)
Code: [Select]
$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
Code: [Select]
$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>';
Logged
‍I don't answer to PM with support question
Please post your issue to related board
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 20 queries.