Posted: 06/09/2009 11:15 PM

Easy way to make your users happier

It's a small part of rating improvements I made recently for one of my dear clients.
 
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:
 
PHP

 
        //------------------------------------------------
        // 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:
 
PHP

        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.
274 7 0 how to, rating

Comments

by radioact 09/16/2009 07:52 AM
Ha-ha, no :)
by godyn 09/16/2009 04:52 AM
Is that picture Radioact, when he got a 1 star score??? :-D
by radioact 09/15/2009 11:25 AM
1. Reverse back your changes.
2. If you can use PHP if statements just wrap sql query by if statement checking if $score > 1.
by firesgame 09/15/2009 11:22 AM
Something wrong with my vers 253 or me.
Its doesnt work - except freezing progress.
by godyn 08/16/2009 04:54 AM
Great ! and works on pictures also :-)
by radioact 06/10/2009 06:18 AM
I wish there were more contributors on this website and I don't care if they ask reward from members, promote their websites or exchange their emails because it's the main goal of the website.
by db3204 06/10/2009 05:33 AM
Thank you Ramil for the great rating mod. Yes, I can now control the rating and more with your great mod.
 
Dan.
Add Comment


You have 1500 characters left We would not recommend you trying hard while expressing your opinion because you are not signed in and comment will not be saved.

Latest visitors

inatmo milojko78 14m3r
mario702 Invision antoniopuntieri
db3204 gugu adboy

radioact's RSS

Subscribe to radioact's Blog  RSS