Jonathan Dart Posted September 21, 2013 Share Posted September 21, 2013 Hi Guys, I've decided to share my work on a Fieldtype for adding star ratings to page items. I used @apeisa's FieldtypePoll as a starting point. Check out the readme on github for usage: https://github.com/jdart/FieldTypeRate I've got a couple screenshots that should demonstrate the functionality. Feel free to give me any feedback. Regards, Jonathan 13 Link to comment Share on other sites More sharing options...
adrian Posted September 21, 2013 Share Posted September 21, 2013 This looks fantastic Jonathan. I know that Ryan was planning on releasing something along these lines, based on the recommend button in the modules directory: http://processwire.com/talk/topic/4206-thinking-about-a-likerecommend-button-module/?p=41222 I am curious to see what overlap there is between these two modules - hopefully they will both have their strengths and will be useful for different scenarios. Thanks for this! Link to comment Share on other sites More sharing options...
Pete Posted September 21, 2013 Share Posted September 21, 2013 Nice work - I like it. Just one question though: getUaString concatenates the user agent and IP address - surely that means I can switch to other browsers and vote multiple times? Wouldn't IP be enough on its own? Link to comment Share on other sites More sharing options...
adrian Posted September 21, 2013 Share Posted September 21, 2013 Aren't cookies the best option for this? I know you guys know this already, but surely IP address is more problematic in that it can prevent other people on the same network from voting. And even people using the same ISP may not be able to vote if they end up with an IP that is already recorded. What about a combination of cookie and number of hits from the same IP address in a certain timeframe to prevent people from clearing their cookies and voting multiple times in a short time period. I would think this would also help to limit bot rating? Link to comment Share on other sites More sharing options...
Jonathan Dart Posted September 21, 2013 Author Share Posted September 21, 2013 Limiting by IP or cookie both have their drawbacks. You can imagine an office with 100 workers all behind one ip address. Cookies can also be deleted. For my needs the implementation is good enough, but if you really wanted to prevent bots taking advantage you'd require users to be logged in to vote. That being said the voted detection could be a lot more sophisticated. 4 Link to comment Share on other sites More sharing options...
Pete Posted September 22, 2013 Share Posted September 22, 2013 Good point on the IP in an office - I hadn't thought of that yet I'm subject to it daily! Link to comment Share on other sites More sharing options...
ryan Posted September 28, 2013 Share Posted September 28, 2013 Aren't cookies the best option for this? I know you guys know this already, but surely IP address is more problematic in that it can prevent other people on the same network from voting. And even people using the same ISP may not be able to vote if they end up with an IP that is already recorded. I think the best option is both. At least, that's what I used in the rating module I wrote. The problem of two people on the same IP is a compromise for the reasons you mentioned, but it can be mitigated quite a bit by using the $_SERVER['HTTP_CLIENT_IP'] or $_SERVER['HTTP_X_FORWARDED_FOR'] headers instead of $_SERVER['REMOTE_ADDR'], when they are available. My opinion is that the compromises in relying on a cookie for any kind of rating are much bigger compromises than occasionally blocking a vote due to IP. Link to comment Share on other sites More sharing options...
MilenKo Posted March 8, 2017 Share Posted March 8, 2017 Hello @Jonathan Dart. Are you aware if the module would work in PW 3+ and if so, could you share some details about installing the module? I tried to place the extracted folder to site/modules, but that did not work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now