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: Want to change the Vote Statistics page  (Read 2490 times)

0 Members and 1 Guest are viewing this topic.

aps

  • Coppermine novice
  • *
  • Country: au
  • Offline Offline
  • Gender: Female
  • Posts: 24
Want to change the Vote Statistics page
« on: December 11, 2006, 02:34:43 pm »

Hi there

When someone clicks on Details (next to Rating) in the album, it displays the voting statistics.
I need to change mine from 5 to 15 and replace the stars with gifs of numbers (from 1 to 15).

How do I change the page that is headed Vote Statistics (is it somewhere in displayimage.php - sorry, very much a newbie to php) and replace the stars with my gifs and add an extra 10.

Hope this is clear. :)

Thanks.
« Last Edit: December 13, 2006, 02:54:22 am by GauGau »
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Want to change the Vote Statistics page
« Reply #1 on: December 11, 2006, 08:22:31 pm »

edit stat_details.php
Logged

aps

  • Coppermine novice
  • *
  • Country: au
  • Offline Offline
  • Gender: Female
  • Posts: 24
Re: Want to change the Vote Statistics page
« Reply #2 on: December 11, 2006, 11:51:26 pm »

Thanks for replying.

I guess it's in the code:

Code: [Select]
EOT;

if ($type == 'vote') { // type == vote start

$query = "SELECT rating, count(rating) AS totalVotes FROM {$CONFIG['TABLE_VOTE_STATS']} WHERE pid=$pid GROUP BY rating";
$result = cpg_db_query($query);

$rateArr = array();

starttable("100%", $lang_stat_details_php['stats'], 2);

while ($row = mysql_fetch_array($result)) {
      $voteArr[$row['rating']] = $row['totalVotes'];
}
    for ($i=0; $i<6;$i++){
        $voteArr[$i] = isset($voteArr[$i]) ? $voteArr[$i] : 0;
        $width = $voteArr[$i]*10;
        echo <<<EOT
        <tr class="tableh2">
            <td width="20%">
                <img src="images/rating$i.gif" />
            </td>
            <td>
                <img src="images/vote.jpg" width="$width" height="15" border="0" alt="" />
                {$voteArr[$i]}
            </td>
        </tr>

EOT;
    }
endtable();

My gif's are the same name as the stars, that is rating1.gif up to 15. So, how is it that it still pulls up the Vote Stats page with stars on them and there are no stars gifs in the images folder?

Thanks.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: Want to change the Vote Statistics page
« Reply #3 on: December 12, 2006, 06:30:48 am »

use another path, i.e. store your images somewhere else than inside the "image" folder and change <img src="images/rating$i.gif" /> accordingly.
Logged

aps

  • Coppermine novice
  • *
  • Country: au
  • Offline Offline
  • Gender: Female
  • Posts: 24
Re: Want to change the Vote Statistics page
« Reply #4 on: December 12, 2006, 12:15:18 pm »

Thanks GauGau.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.