Jump to content

Simple problem - any simple solutions?


Anti-Moronic

Recommended Posts

I have a little issue and not entirely how I should be going about this.

 

I have a comment rating system where people can rate each comment. To reduce abuse, I restrict each rating to one ip....my question is, what happens if 10,000 users rate a single comment (it's happened)? It just doesn't save the new ip to the database, so when it reaches that threshold, anybody can rate without their ip being recorded.

 

Is there a solution to this or a better way to go about it?

 

Should I flush ip's at set intervals or when the field fills up or can I store in a better way?

 

Finally, I use in_array() to search for ip when a new comment is processed. Is that ok? Is there a faster or better way to confirm?

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/189224-simple-problem-any-simple-solutions/
Share on other sites

Don't restrict on IP that just doesn't work and only frustrates people because IP's change and users will think your system is flawed because they get a "can't vote because you already voted today" while they just met your website. One of these websites that has this annoyance is megaupload.com when it tells me I already downloaded 10GB.. unless I sleepwalk what I doubt.

 

Plus you also have another problem for example 5 users vote on an item giving it a 5-star rating giving it a total of 5 stars. Now second item received 400 votes and gets an average of 4 stars. You see my point?

Yes Daniel0 gave them to me recently

 

http://en.wikipedia.org/wiki/Bayesian_average

http://en.wikipedia.org/wiki/Binomial_proportion_confidence_interval

 

I recommend Bayesian average as it is the easiest to implement

 

The simplest of them all is calculating the median altough I'm not sure if this correct the previous stated problem:

http://en.wikipedia.org/wiki/Median

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.