forum.coppermine-gallery.net

Support => Older/other versions => cpg1.3.x Support => Topic started by: Chopper on May 05, 2005, 06:23:47 am

Title: Changing rating system to just votes.
Post by: Chopper on May 05, 2005, 06:23:47 am
I am currently working on a contest website. I was hoping maybe someone might know how to change or edit the script so that instead of a rating system, only the amount of votes is counted. So when the contest closes, image with 16 votes would win over another image that has 13 votes (no stars involved).

Not sure how hard this is to do, but thought I'd ask anyway.
Title: Re: Changing rating system to just votes.
Post by: pulz on May 05, 2005, 06:56:22 pm
that should be pretty easy and several ways to do this. You could for instance add a new variable to the picture table and quote out the existing rating sytem and place your own rate buttton. This button should update the value in your DB. Shouldn't  be so hard if you have some php / database knowledge

You can also use the already existing votes table.
Title: Re: Changing rating system to just votes.
Post by: Joachim Müller on May 06, 2005, 07:25:58 am
I suggest you just remove the unneeded rating images (0 stars to 4 stars) and only leave the 5 stars html. You might want to replace the graphic and you're done. I wouldn't mess with additional database tables...
Title: Re: Changing rating system to just votes.
Post by: pulz on May 07, 2005, 04:51:15 pm
I totally agree with gaugua!

Just go to your theme.php and find someting like:

Code: [Select]
<tr>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}"><img src="images/rating0.gif" alt="{RUBBISH}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}"><img src="images/rating1.gif" alt="{POOR}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}"><img src="images/rating2.gif" alt="{FAIR}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}"><img src="images/rating3.gif" alt="{GOOD}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}"><img src="images/rating4.gif" alt="{EXCELLENT}" border="0" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}"><img src="images/rating5.gif" alt="{GREAT}" border="0" /><br /></a></td>
        </tr>

And just quote out everything except the last rating (the one with rate5)

Note: If you still want to have normal ratings in other albums you have to do it another way

Title: Re: Changing rating system to just votes.
Post by: Chopper on May 08, 2005, 12:35:26 am
This is a great idea and very simple solution. Thanks GauGau! Thanks Pulz!