coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: aps on December 11, 2006, 02:34:43 PM

Title: Want to change the Vote Statistics page
Post by: aps 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.
Title: Re: Want to change the Vote Statistics page
Post by: Joachim Müller on December 11, 2006, 08:22:31 PM
edit stat_details.php
Title: Re: Want to change the Vote Statistics page
Post by: aps on December 11, 2006, 11:51:26 PM
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.
Title: Re: Want to change the Vote Statistics page
Post by: Joachim Müller 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.
Title: Re: Want to change the Vote Statistics page
Post by: aps on December 12, 2006, 12:15:18 PM
Thanks GauGau.