forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Themes/Skins/Templates => Topic started by: Roi Danton on October 27, 2005, 05:11:37 pm

Title: Rating pics - how to change the supported extension?
Post by: Roi Danton on October 27, 2005, 05:11:37 pm
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?
Title: Re: Rating pics - how to change the supported extension?
Post by: Stramm on October 27, 2005, 06:11:20 pm
function get_pic_data() in functions.inc.php , few lines below case 'toprated':
and in theme.php ... search for $template_image_rating
Title: Re: Rating pics - how to change the supported extension?
Post by: Roi Danton on October 27, 2005, 06:26:35 pm
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).
Title: Re: Rating pics - how to change the supported extension?
Post by: kegobeer on October 27, 2005, 06:59:26 pm
Already done for 1.4.x.
Title: Re: Rating pics - how to change the supported extension?
Post by: Roi Danton on June 27, 2006, 11:26:48 am
No, it isn't done ;) :

displayimage.php
in html_picinfo()
Code: [Select]
$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())
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>';
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 ).