Lester Chan's Forums
06 January 2009, 04:54 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Lester Chan’s WordPress Plugins July 2008 Update
 
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: ip logging configuration  (Read 6123 times)
0 Members and 1 Guest are viewing this topic.
hyipcharts
Newbie
*
Offline Offline

Posts: 13


View Profile
« Topic Start: 23 January 2007, 06:48 »

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
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #1: 23 January 2007, 07:55 »

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 Website

I 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
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #2: 23 January 2007, 08:16 »

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
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #3: 23 January 2007, 08:17 »

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 Website

I 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
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #4: 23 January 2007, 08:22 »

You are awesome!!!!!

thanks again Grin
Logged
Ttech
Official Support
Administrator
*****
Offline Offline

Posts: 4,294



View Profile WWW
« Reply #5: 23 January 2007, 23:45 »

That sounds like an interesting feature. Smiley
Logged

Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers
GaMerZ
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #6: 24 January 2007, 02:30 »

Open up polls.php.
Find:
Code:
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH);
Replace:
Code:
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 86400, COOKIEPATH);

Find:
Code:
$get_voted_aid = $wpdb->get_var("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."'");
Replace:
Code:
$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 Website

I 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
Official Support
Administrator
*****
Offline Offline

Posts: 4,294



View Profile WWW
« Reply #7: 24 January 2007, 02:31 »

LOL, but it usually works...
Logged

Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers
hyipcharts
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #8: 24 January 2007, 09:50 »

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
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #9: 24 January 2007, 13:14 »

yea, hope u did deactivate the plugin first before activating it back.
Logged


++ lesterchan.net - Lester Chan's Website

I 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
Official Support
Administrator
*****
Offline Offline

Posts: 4,294



View Profile WWW
« Reply #10: 25 January 2007, 00:41 »

Glad it works... Smiley
Logged

Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers
hyipcharts
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #11: 25 January 2007, 10:43 »

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
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #12: 25 January 2007, 10:55 »

sure sure, if still cant work, try clearing ur cookie also.
Logged


++ lesterchan.net - Lester Chan's Website

I 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
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #13: 25 January 2007, 12:01 »

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
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #14: 25 January 2007, 14:11 »

lol, i guess u forget to press Ctrl S
Logged


++ lesterchan.net - Lester Chan's Website

I 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
Official Support
Administrator
*****
Offline Offline

Posts: 4,294



View Profile WWW
« Reply #15: 26 January 2007, 02:06 »

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. Cheesy
Logged

Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers
hyipcharts
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #16: 26 January 2007, 13:04 »

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
lesterchan.net
Administrator
*****
Online Online

Posts: 8,202



View Profile WWW
« Reply #17: 26 January 2007, 15:33 »

I think the logic maybe wrong, lol instead of
Code:
(current_time('timestamp')+86400)
, try
Code:
(current_time('timestamp')-86400)
Logged


++ lesterchan.net - Lester Chan's Website

I 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
Official Support
Administrator
*****
Offline Offline

Posts: 4,294



View Profile WWW
« Reply #18: 26 January 2007, 23:52 »

Time stamp error?
Logged

Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers
hyipcharts
Newbie
*
Offline Offline

Posts: 13


View Profile
« Reply #19: 27 January 2007, 00:41 »

That did the trick. I set it to -86 for speed purposes and it reset perfectly.

Thanks again
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.7 | SMF © 2006-2008, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.091 seconds with 23 queries.