coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: SimonSays on August 17, 2005, 05:12:24 AM

Title: Changing star image to text
Post by: SimonSays on August 17, 2005, 05:12:24 AM
Hi All,

I'm currently developing my site to have ratings until 10 as you can see below:

http://www.epsonio.com/displayimage.php?album=toprated&cat=0&pos=2

As you can see I swapped out the star images (for now).  How can I do the same on the "Top Rated" Page?  Currently the images show up as follows:

http://www.epsonio.com/thumbnails.php?album=toprated&cat=0

Any help would be greatly appreciated!

-Simon
Title: Re: Changing star image to text
Post by: Nibbler on August 17, 2005, 05:17:33 AM
Look in include/functions.inc.php

case 'toprated': // Top rated pictures

and change the caption generating code as you like.
Title: Re: Changing star image to text
Post by: jgsketch on October 05, 2005, 07:58:39 PM
I too would like to get rid of the stars and add the rating in numbers. I was able to get rid of the image tag in the function page, and found the "current rating" code that I would like to insert. I found this code in displayimage page for "toprated"

$votes = $CURRENT_PIC_DATA['votes'] ? sprintf($lang_rate_pic['rating'], round($CURRENT_PIC_DATA['pic_rating'] / 2000, 3), $CURRENT_PIC_DATA['votes']) : $lang_rate_pic['no_votes'];

I just cannot figure out how to get that code into the Function code

$caption = "<span class=\"thumb_caption\">".  .'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']).'</span>';

I tried just adding

sprintf($lang_rate_pic['rating'], round($CURRENT_PIC_DATA['pic_rating'] / 2000, 3) into the function code, but got a parse error. I'm just not that good yet with PHP.

So am I even close or am I on another Island somewhere.  :)
Title: Re: Changing star image to text
Post by: jgsketch on October 10, 2005, 02:51:26 PM
After a week of trying various combinations, I still cannot figure this out, can anyone help me with this one. Thanks.
Title: Re: Changing star image to text
Post by: Stramm on October 10, 2005, 03:08:02 PM
for the toprated meta album:

find in functions.inc.php
                        $caption = "<span class=\"thumb_caption\">".'<img src="'.$prefix.'images/rating'.round($row['pic_rating']/2000).'.gif" align="absmiddle"/>'.'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']).'</span>';


replace with
                        $caption = "<span class=\"thumb_caption\"> Rating: ".round($row['pic_rating']/2000).'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']).'</span>';


Title: Re: Changing star image to text
Post by: jgsketch on October 10, 2005, 10:29:38 PM
Wow, thanks. That looked alot easier than the different one's I tried. Works great. Thanks.