Changing star image to text Changing star image to text
 

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

Changing star image to text

Started by SimonSays, August 17, 2005, 05:12:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SimonSays

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

Nibbler

Look in include/functions.inc.php

case 'toprated': // Top rated pictures

and change the caption generating code as you like.

jgsketch

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.  :)

jgsketch

After a week of trying various combinations, I still cannot figure this out, can anyone help me with this one. Thanks.

Stramm

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>';



jgsketch

Wow, thanks. That looked alot easier than the different one's I tried. Works great. Thanks.