Gossamer Forum
Home : Products : DBMan : Installation :

Add a rating system

Quote Reply
Add a rating system
I have a database with famous quotes. I want that users could rate the different quotes. How does I add a rating system into Dbman?
Quote Reply
Re: Add a rating system In reply to
You'd need to add two fields to your database -- one for rating and one for number of votes. You could even have another new field which would hold the current rating. That way you wouldn't have to compute it every time.

You'd need to add a new subroutine to html.pl to print out a form to enter the rating. (Or I guess you could just have a little form in your display where someone could enter the rating.)

You'd need to add a new subroutine to db.cgi to add the new rating to the record. If you added the third field above, you would also compute the new rating here. This would be an altered version of the modify_record subroutine.

The above doesn't take into account users who vote over and over again so their favorite quote will have the highest rating. (Or their least favorite quote will have the lowest rating.) I don't know how you would do that. You might look at the Links script for some more ideas.


------------------
JPD





Quote Reply
Re: Add a rating system In reply to
This is exactly what I´m looking for!! Anybody tried to implement it yet?
Quote Reply
Re: Add a rating system In reply to
I'm sorta working on something like this for my own site. Once I get it up and running, I'll post it here.


------------------
JPD