rating images problem - need help rating images problem - need help
 

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]

Main Menu

rating images problem - need help

Started by Singular, May 29, 2007, 05:58:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Singular

Hi all,
I would like to keep the rating feature active for visitors on my forum gallery. I hold monthly art contests and the finalists are determined by my visitors' vote. However, I keep getting multiple votes from the same ip address for many images. Each time with a rating of 0 stars. I do not know how this is being done when I thought that each user could only rate an image once. Also, the ip address turned out to be one of my registered members. She told me that she hasn't rated any images. So I am assuming that a spyware has taken control of her computer and is disputing my contests.

Does anyone have any ideas on how to fix this issue without turning off the rating option to nonregistered users.

thanks and best regards,
Joe

Joachim Müller

There's no real fix: when allowing anonymous votings, coppermine uses cookies to make sure an anonymous user doesn't vote twice on the same pic. Users who know their way around just delete their cookies (or even don't accept cookies from your site in the first place) and are subsequently not allowed to vote a second time. I strongly doubt though that some piece of spyware is responsible for this: my guess is rather that the user in question either has got some pre-caching software on the client that pre-loads frequently-visited pages. Such a script would be performing a voting as well, as the voting currently is implemented as HTML-driven links (will be changed in the next release). If this is the case, tell her to disable that piece of software for your site. Second possible option would be that the user in question deliberately cheats. If this is the case, ban him/her by IP.

I can understand that you want to keep anonymous voting for guests, but your best bet would be to allow it for registered users only. Second best option would be to modify the coppermine code and change the voting links from being HTML-driven to JavaScript driven (spiders and pre-loaders usually don't follow JavaScript-driven links).

HTH

Singular

Thank you so much for your reply. That is very helpful information. Do you think it would be possible to point me in the right direction on how to change the voting links from being HTML-driven to JavaScript driven. I really appreciate your time.

all the best,
Joe

Joachim Müller

Edit themes/yourtheme/theme.php, find// HTML template for the image rating box
$template_image_rating = <<<EOT
and edit the stuff beneath it as suggested below. If this section does not exist in your custom theme, copy// HTML template for the image rating box
$template_image_rating = <<<EOT
<table align="center" width="{WIDTH}" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td colspan="6" class="tableh2_compact"><b>{TITLE}</b> {VOTES}</td>
        </tr>
        <tr>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE0}" title="{RUBBISH}" rel="nofollow"><img src="{LOCATION}images/rating0.gif" border="0" alt="{RUBBISH}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE1}" title="{POOR}" rel="nofollow"><img src="{LOCATION}images/rating1.gif" border="0" alt="{POOR}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE2}" title="{FAIR}" rel="nofollow"><img src="{LOCATION}images/rating2.gif" border="0" alt="{FAIR}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE3}" title="{GOOD}" rel="nofollow"><img src="{LOCATION}images/rating3.gif" border="0" alt="{GOOD}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE4}" title="{EXCELLENT}" rel="nofollow"><img src="{LOCATION}images/rating4.gif" border="0" alt="{EXCELLENT}" /><br /></a></td>
                <td class="tableb_compact" width="17%" align="center"><a href="{RATE5}" title="{GREAT}" rel="nofollow"><img src="{LOCATION}images/rating5.gif" border="0" alt="{GREAT}" /><br /></a></td>
        </tr>
</table>
EOT;
from themes/sample/theme.php into a new line before?>of themes/yourtheme/theme.php

To change the links from HTML to JavaScript, find<a href="{RATE5}" title="{GREAT}" rel="nofollow"><img src="{LOCATION}images/rating5.gif" border="0" alt="{GREAT}" /><br /></a>and replace with<img src="{LOCATION}images/rating5.gif" border="0" alt="{GREAT}" title="{GREAT}" onclick="window.location.href = '{RATE5}';" style="cursor:hand;" /><br />Do the similar thing for the other links. Not tested, but should work.

Not related to pnCPG, moving accordingly.

Singular

Thanks. I made the changes to themes/mytheme/theme.php and uploaded the new file, but when I tried to vote, it was not recorded. I didn't receive any error messages, but the votes did not record.