Rating pics - how to change the supported extension? Rating pics - how to change the supported extension?
 

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

Rating pics - how to change the supported extension?

Started by Roi Danton, October 27, 2005, 05:11:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Roi Danton

I've added the line define('THEME_HAS_RATING_GRAPHICS', 1); to my theme to use my own rating graphics. Unfortunately this function only supports the files ratingX.gif but the graphics I'm using are only available in PNG format (the pics have the format png-24, in gif format they have poor quality).

So where can I change the supported extensions?
Style Tahun for cpg --> review

Stramm

function get_pic_data() in functions.inc.php , few lines below case 'toprated':
and in theme.php ... search for $template_image_rating

Roi Danton

Thanks.

If someone else is interested to change it, too ... additional to the things Stramm mentioned you also have to change the name/extension in the function html_picinfo() (file displayimage.php).

Solved.

(To devs: Maybe you can change this in further versions ... so that the path is defined within the theme).
Style Tahun for cpg --> review

kegobeer

Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

Roi Danton

#4
No, it isn't done ;) :

displayimage.php
in html_picinfo()

$info[sprintf($lang_picinfo['Rating'], $CURRENT_PIC_DATA['votes'])] = '<img src="' . $prefix . 'images/rating' . round($CURRENT_PIC_DATA['pic_rating'] / 2000) . '.gif" align="middle" alt="" />'.$detailsLink;


functions.inc.php
Some lines below function build_caption(&$rowset,$must_have=array())

$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>';
In both there is still only .gif as available extension and you have to replace it manually with png.

Btw, "Solved" status should be removed and the thread could be moved to cpg1.4 Support Forums b/c this issues is still present in v1.4.x (I'm using 1.4.8 ).
Style Tahun for cpg --> review