Every popular website has a few angry maniacs browsing pictures, videos, profiles and giving them one star rating. Nobody deserves 1!
Let's consider those guys as psychos and won't record their votes to database but still giving them illusion rating has been recorded.
Open your /includes/hp/hp.rate.php and find at the bottom:
//------------------------------------------------
// Insert rating
//------------------------------------------------
$DB->query("UPDATE " . DB_PREFIX . "$type"."s
SET totalvotes=totalvotes+1, totalscore=totalscore+$score
WHERE member_id=$member_id AND $type"."_id='$content_id' LIMIT 1");
echo "ok\nok";
exit;
Modify it to look like this:
if ( $score > 1 )
{
//------------------------------------------------
// Insert rating
//------------------------------------------------
$DB->query("UPDATE " . DB_PREFIX . "$type"."s
SET totalvotes=totalvotes+1, totalscore=totalscore+$score
WHERE member_id=$member_id AND $type"."_id='$content_id' LIMIT 1");
}
echo "ok\nok";
exit;
That's it! No more disappointed users wishing to cancel their membership because of ugly "one star" after 50 "five stars" in a row.








Comments
radioact
godyn
radioact
2. If you can use PHP if statements just wrap sql query by if statement checking if $score > 1.
firesgame
Its doesnt work - except freezing progress.
godyn
radioact
db3204
Dan.
Log in to leave a comment