Want to change the Vote Statistics page Want to change the Vote Statistics page
 

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

Main Menu

Want to change the Vote Statistics page

Started by aps, December 11, 2006, 02:34:43 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

aps

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.

Joachim Müller


aps

Thanks for replying.

I guess it's in the code:

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.

Joachim Müller

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

aps