Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Changing star image to text  (Read 5329 times)

0 Members and 1 Guest are viewing this topic.

SimonSays

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Changing star image to text
« 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
« Last Edit: October 10, 2005, 10:34:52 pm by GauGau »
Logged

Nibbler

  • Guest
Re: Changing star image to text
« Reply #1 on: August 17, 2005, 05:17:33 am »

Look in include/functions.inc.php

Code: [Select]
case 'toprated': // Top rated pictures
and change the caption generating code as you like.
Logged

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: Changing star image to text
« Reply #2 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"

Code: [Select]
$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

Code: [Select]
$caption = "<span class=\"thumb_caption\">".  .'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']).'</span>';
I tried just adding

Code: [Select]
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.  :)
Logged

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: Changing star image to text
« Reply #3 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.
Logged

Stramm

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Male
  • Posts: 6006
    • Bettis Wollwelt
Re: Changing star image to text
« Reply #4 on: October 10, 2005, 03:08:02 pm »

for the toprated meta album:

find in functions.inc.php
Code: [Select]
                        $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
Code: [Select]
                        $caption = "<span class=\"thumb_caption\"> Rating: ".round($row['pic_rating']/2000).'<br />'.sprintf($lang_get_pic_data['n_votes'], $row['votes']).'</span>';

jgsketch

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 47
Re: Changing star image to text
« Reply #5 on: October 10, 2005, 10:29:38 pm »

Wow, thanks. That looked alot easier than the different one's I tried. Works great. Thanks.
Logged
Pages: [1]   Go Up
 

Page created in 0.045 seconds with 19 queries.