PDA

View Full Version : Ratings Script


pgowder
11-28-2001, 07:35 PM
I need some help on a project.

I'm developing an event script for my site. I want to let the users rate each event.

I need to first make sure the users is logged in, then let them rate it, and make sure they only rate it once.

Also how do people display the ratings in stars?

Does anybody have some samples of rating scripts that I can use to get me started?

thanks

Palmer ofShinra
11-29-2001, 10:23 AM
$bbuserinfo is the key.

if ($bbuserinfo[userid]==0) {
// not logged in message goes here
} else {
// they are logged in, check to see if they've voted
}

You would use $DB_Site->query_first("SELECT * FROM eventratings WHERE userid='$bbuserinfo[userid]'");

If that returns an empty array, they haven't voted.

When they do vote, be sure to note down their userid as a check that they have voted.