Anti-Moronic Posted January 20, 2010 Share Posted January 20, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/189224-simple-problem-any-simple-solutions/ Share on other sites More sharing options...
ignace Posted January 20, 2010 Share Posted January 20, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/189224-simple-problem-any-simple-solutions/#findComment-999018 Share on other sites More sharing options...
Anti-Moronic Posted January 21, 2010 Author Share Posted January 21, 2010 I see what you mean, but this is not a 5 star rating system. Do you have a solution then? I know the current system isn't ideal, but I'm looking for a solution to that. Thanks for you input. Quote Link to comment https://forums.phpfreaks.com/topic/189224-simple-problem-any-simple-solutions/#findComment-999080 Share on other sites More sharing options...
ignace Posted January 21, 2010 Share Posted January 21, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/189224-simple-problem-any-simple-solutions/#findComment-999317 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.