Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

Review again

Quote Reply
Review again
Just another problem:

I have rewritten the review, so users have not to login, befor writing a review, but with validation before showing it.
The problem now is how to handle the "Votes"; i could set it to build_update, when someone writes a review; but what´s if i delete this ? Then the vote will still add, when build.

Some ideas?
Robert



Quote Reply
Re: Review again In reply to
Hmm, as is see the same problem is at Jeerry´s Mod; if you delete Reviews manually, the votes will stay!
Robert

Quote Reply
Re: Review again In reply to
In order to delete votes properly, and adjust counts, you'd need to keep a log of _all_ the results, and when a review, or user, or whatever is deleted, those results are also deleted, then the affected record re-calculated.

I'm doing that for voting now, and have a "rate_log" table that has tracked each vote to each ID. Now, the log also tracks user/ID/vote so that each user can only vote once on each link.

Theoretically, this means the votes/rating table could grow to the size of #users x #links, but in reality this probably would never happen.

The more "features" you try to add in, the more data you need to track, and simply trying to keep a running average of votes is innacurate.

PUGDOG®
PUGDOG® Enterprises, Inc.
FAQ: http://postcards.com/FAQ


Quote Reply
Re: Review again In reply to
Yea...I have codes where the VOTES and REVIEWS are decreased by one when a review is deleted by a user.

It is quite easy to do if you reverse the logic in the rate.cgi script where the codes update the Build_Updates and Rate_Track tables.

Regards,

Eliot Lee
Quote Reply
Re: Review again In reply to
hehe.. i don't care about my mods anymore ;)

i have moved on to java.. the only perl i need anymore is a backend to more complex applets.. like a java chat using a perl chat server..

umm.. if i didn't record the rating by the user.. then you'll have to add that in.. but you could just do like..

$votes--;
$ratings = sprintf "%.2f", ( $rating - $rate ) / $votes;

Jerry Su
widgetz sucks