I am looking for a script that will let users rate a product (say out of 5)
and write a review on the product. I have been looking for a while now but I
can really only find ones that only do one or the other but not both :(
I have searched all the usual places hotscripts, google and various other
places but with no luck. I have access to a mysql server so its ok if it
supports mysql
Thanks in advance
aSp
"aSp" <a...@digicorpse.net> wrote in message
news:tlfoja...@sentinel.digicorpse.net...
-Joe
"aSp" <a...@digicorpse.net> wrote in message
news:tlfoja...@sentinel.digicorpse.net...
Sometimes, if you have some special task, you won't find any ready
solution and need to write it by yourself or hire someone to do it for
you.
A module for PostNuke does this and is quite nice. Maybe this can be a
starting point for your quest.
Write by yourself.
The best choice will be using database with table for example 'items'
with fields like: 'id', 'name', 'rating_sum', 'rating_count' and
second table 'reviews': 'id', 'item_id', 'author' and 'content'.
Then on your item's page (it's URL may be sth like
item.php?item_id=666) execute example query "SELECT author, content
FROM reviews WHERE item_id = '$_GET[item_id]". Then fetch_array and
display for example 30 words of each review with link to
review.php?rev_id=111. On that page run "SELECT author, content FROM
reviews WHERE id='$_GET[rev_id]" and do what you like with result.
Display somewhere on your item's page form with TEXTAREA for user's
review and handle that form data with proper UPDATE query. Then with
ratings it would be quite easy. In your 'items' table you have two
fields: 'rating_sum' & 'rating_count'. For each new vote increment
rating_count and add vote's value to rating_sum giving rating_sum
(wow, like COBOL ;)). Display average rate with
rating_sum/rating_count and probably round() it to wanted precision.
HTH
--
[-- "Stubborn from the start, obey no one, no matter what..." --]
[-- Zbyszek 'antyqjon' Siciarz --]
[-- email: anty...@wp.pl | URL: www.antyqjon.prv.pl --]
Thanks
aSp
"Zbyszek" <anty...@poczta.gazeta.pl> wrote in message
news:ajtqvl$89d$2...@news.tpi.pl...