If you are not registered or logged in, you may still use these forums but with limited features. Show recent topics
  [Search] Search   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [FAQ]  FAQ 
[Register] Register / 
[Login] Login 
Advanced Poll & IP/Cookie Tracking  XML
Forum Index » Support Forum
Author Message
Anonymous



There have been a number of posts over the past few weeks and months about AP's ability to prevent people from voting too often via IP logging and tracking (IP Table Check & locking timeout).

I was unable to get this working. Actually, what was happening was that once someone voted -- they couldn't vote again. Even after the 'x' number of hours I set for the locking timeout.

I could be wrong about this, but it appears that the cookie handling features of AP are interfering with the IP tracking/locking.

If you're like me, the first thing I did after installing AP was to do what the faq.txt said and put <?php require "poll_cookie.php"; ?> at the top of my html/php page. This appears to be a mistake if you intend to use IP checking. The first time you fire up your browser to look at your poll a cookie is set. And it doesn't expire for 96 hours. The 96 is hardcoded inside poll_cookie.php.

At this point, whatever changes you make to the IP tracking/locking stuff in the admin tool are moot. The code that checks IPs, etc., will never be excuted because the cookie checking code comes first. So, even though I turned IP checking completely off, I still couldn't get people to vote because they had a cookie set and it wasn't going to expire for 96 hours. Well, I guess it was about 60 hours by the time I figured this out.

What I did to "fix" this (it's more of a hack really) is to comment out the first 5 lines in the has_voted() function in the class_poll.php file in the ./include subdirectory. This disables the cookie check and allows the IP checking to actually be executed. Of course you should only do this if you want to use IP checking. An alternative fix might be to change the '96' hour cookie expiration in poll_cookie.php to something shorter to fit your needs. Or take out the reference to poll_cookie.php altogether if you won't be using the cookie checking. But, keep in mind, for people who have already voted, that 96-hour cookie will still be in effect if you leave the cookie check code in place in the has_voted() function in class_poll.php.

Again, I hope I have this right and I would appreciate someone coming behind and checking my work. It would be nice to see the admin tool updated so that I can pick which method I want to track voters (IP checking vs. cookies) and be able to control cookie expiration. And, I'd like to do it on a poll-by-poll basis, rather than poll-system-wide. There are other things too that should be moved out of 'general settings' so that they can be set on a poll-by-poll basis, like colors, fonts, diplay order, number of options, etc. But that's a different post...

kwade
Auron
Expert
[Avatar]

Joined: 23/06/2003 22:02:17
Messages: 1053
Offline

Yeah thats some good ideas there I wish the Admin would turn up. But from looking at the posts he has only posted on the first few pages when the forum started and has never been seen again.

The IP logging / tracking bit you mentioned I think is true coz I did the the IP logging and it only let me vote once, so I didn't bother putting the poll_cookie.php include in and it worked fine. It was after I put the poll_cookie.php include in that it started screwing around a bit. I'm not sure how long the cookie that is set locks users out before they can vote again but if its something like 60*60*24=...secs (thats a day in seconds) it may be different maybe something like 3600*24 (same amount of time as before)

Auron
[Email] [WWW]
entoone
Newbie

Joined: 19/07/2003 19:19:15
Messages: 4
Offline

I have been chasing my tail too.. and decided to come and see if others had the same thing. All the scripts here are nice, and graphical.. but we need functionality too. I am willing to pay for my version etc, but need things to work properly. Anyhow, yes, I have the same situation. I have everything set to 0 so you could vote over and over. This is for testing only of course and would go back to no being able to vote for whatever time frame is selected, but right now. Its as if I can't vote again for whatever time frame is set as was stated by a previous user.. anyhow, I sure hope that the author gets excited about getting it working a bit more so hey can get lots of 15.00's from those that really appreciate his/her efforts.

If anyone gets this to work, please share, so we can all get it working. Thanks!
 
Forum Index » Support Forum
Go to:   
Based on the open source JForum