|
hyipcharts
|
Hi and thanks for the great poll.
I would like to change how the ip address is remembered.
I would need it to only remember the ip for 24 hours. After that the person could vote again.
If anyone could help me out I would greatly appreciate it. I would need the code and where it goes and in what file.
Thanks again and have a nice day
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
remember as in? it will auto delete after 24 hrs? Why not use sql query to check if the user of that ip has voted within 24 hrs, if more than that it will return false.
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
hyipcharts
|
Thanks for the quick reply.
My only thought is to allow the person to vote once every 24 hours. Say today they voted at 10am so tomorrow at 10am the ip wouold reset so they could vote again.
Thanks again
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
okie I can get what u want easily but the log will stay there. It will just check with ip and time voted instead of ip alone. is that ok?
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
hyipcharts
|
You are awesome!!!!! thanks again 
|
|
|
|
|
Logged
|
|
|
|
|
Ttech
|
That sounds like an interesting feature. 
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
Open up polls.php. Find: $vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH); Replace: $vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 86400, COOKIEPATH); Find: $get_voted_aid = $wpdb->get_var("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."'"); Replace: $get_voted_aid = $wpdb->get_var("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."' AND pollip_timestamp <= '".(current_time('timestamp')+86400)."'"); Untested =)
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
Ttech
|
LOL, but it usually works...
|
|
|
|
|
Logged
|
|
|
|
|
hyipcharts
|
Thanks. I changed the code and no problems. I will let you know tomorrow if everything goes ok.
Thanks again
P.S. I upgraded to WP 2.1 today and no conflict problems. Thanks for the timely poll upgrade.
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
yea, hope u did deactivate the plugin first before activating it back.
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
Ttech
|
Glad it works... 
|
|
|
|
|
Logged
|
|
|
|
|
hyipcharts
|
It has been 24 hours and no change. My poll did not reset from yesterday. I may have made an error, so will try again today. Thanks for you help and I will let you know tomorrow if all is well. I did deactivate the old poll before upgrading, thanks for the tip.
Thanks again.
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
sure sure, if still cant work, try clearing ur cookie also.
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
hyipcharts
|
OK. I did make a mistake. I can't share it with you without sounding stupid. Lets just say to all the newbies, please remember to save you work. I corrected my error and will report tomorrow.
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
lol, i guess u forget to press Ctrl S
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
Ttech
|
Oh, yeah... Each time you take a break to think, save... Thats what I've learned. I've lost lots of work. Once it was while I was saving, that my computer crashed. 
|
|
|
|
|
Logged
|
|
|
|
|
hyipcharts
|
Well I am still having problems. The ip did not reset. I went to the db and deleted all instances of any forum and started from #1 again. I hope this will work tomorrow. When I was in the db I was looking around, under pollsip/pollip_timestamp the default is set to this 0000-00-00 00:00:00. Is that normal or should it be the +86400 in there. Just wondering.
Also in the db under pollsip/pollip_timestamp where it shows the ip address and user I get this:
_id _qid _aid ip address host timestamp user Edit Delete 1 1 1 127.0.0.1 localhost 1169843216 HYIPCHARTS
Thanks
|
|
|
|
« Last Edit: 26 January 2007, 13:40 by hyipcharts »
|
Logged
|
|
|
|
|
GaMerZ
|
I think the logic maybe wrong, lol instead of (current_time('timestamp')+86400) , try (current_time('timestamp')-86400)
|
|
|
|
|
Logged
|
++ lesterchan.net - Lester Chan's WebsiteI DO NOT provide support for any modifications of any plugin to meet your needs/requirements, unless it is a paid job and I have the time to do it due to the large number of request.
|
|
|
|
Ttech
|
Time stamp error?
|
|
|
|
|
Logged
|
|
|
|
|
hyipcharts
|
That did the trick. I set it to -86 for speed purposes and it reset perfectly.
Thanks again
|
|
|
|
|
Logged
|
|
|
|
|