Page 1 of 1

Help? Design for Restaurant Descript with Comment and Rating

Posted: Wed Jul 30, 2003 1:44 pm
by illiquid050
:!: Total newbie question but I figure a little help with design and planning can save me hours later on.

I'm about to try to make a site that lists all the local campus eateries around the school here. I want users to be able to leave a comment as well as a 1-5 rating.

I envision a main page
Restaurant Name | Restaurant Phone | Rating
Clicking on a restaurant will display Restaurant Name and Averaged Rating some other info (delivery hours, phone, address, etc.) followed by user comments (with individual rating) and a form for comment and rating.
Restaurant Name Rating
Restaruant Phone
Restaurant Address

Comments:
[comment1] [comment1rating]
[comment2] [comment2rating]

etc.
I realize I have to use multiple tables. But the set up is tricky. I probably need one table for the restaurant info, a second for the comments and a third for the ranking?

I was hoping to cheat by using a 5star ratings script i picked up and somehow combining it with a comment script from hotscripts.com but now I'm thinking it might be more efficient to go from scratch (borrowing from other scripts as needed). Any advice/pointers/ideas would be super super helpful.

Many thanks in advance.

Posted: Wed Jul 30, 2003 11:59 pm
by jmarcv
actually, seems to me the ranking would be related to the comment directly, so they can go in the same table, no? If no comment, just use rating. If no rating, just use comment. Though I would probably make them both required.

thanks

Posted: Fri Aug 01, 2003 12:49 pm
by illiquid050
true. that's a great idea. the ranking seems easy enough to implement but as far as 'comments' go, is it worth just modifying an existing script or starting from scratch. If i start from scratch I have to worry about creating some kind of processing code that disallows HTML etc.

Any recommendations on that?

Posted: Fri Aug 01, 2003 1:01 pm
by jmarcv
I usually spend more time analyzing and modifying a script then doing it from scratch. Thats me.
In any event, dissallowing html is pretty minor. one strip_tags() and they be gone!

Other useful commands for comments type data:
htmlentities
ln2br