All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.


Author Topic: ip logging configuration  (Read 8782 times)

0 Members and 1 Guest are viewing this topic.

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
ip logging configuration
« on: 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

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #1 on: 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.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #2 on: 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

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #3 on: 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?

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #4 on: 23 January 2007, 08:22 »
You are awesome!!!!!

thanks again ;D

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,294
    • View Profile
Re: ip logging configuration
« Reply #5 on: 23 January 2007, 23:45 »
That sounds like an interesting feature. :)
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #6 on: 24 January 2007, 02:30 »
Open up polls.php.
Find:
Code: [Select]
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 30000000, COOKIEPATH);Replace:
Code: [Select]
$vote_cookie = setcookie("voted_".$poll_id, $poll_aid, time() + 86400, COOKIEPATH);
Find:
Code: [Select]
$get_voted_aid = $wpdb->get_var("SELECT pollip_aid FROM $wpdb->pollsip WHERE pollip_qid = $poll_id AND pollip_ip = '".get_ipaddress()."'");Replace:
Code: [Select]
$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 =)

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,294
    • View Profile
Re: ip logging configuration
« Reply #7 on: 24 January 2007, 02:31 »
LOL, but it usually works...
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #8 on: 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.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #9 on: 24 January 2007, 13:14 »
yea, hope u did deactivate the plugin first before activating it back.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,294
    • View Profile
Re: ip logging configuration
« Reply #10 on: 25 January 2007, 00:41 »
Glad it works... :)
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #11 on: 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.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #12 on: 25 January 2007, 10:55 »
sure sure, if still cant work, try clearing ur cookie also.

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #13 on: 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.


Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #14 on: 25 January 2007, 14:11 »
lol, i guess u forget to press Ctrl S

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,294
    • View Profile
Re: ip logging configuration
« Reply #15 on: 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. :D
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #16 on: 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 »

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Re: ip logging configuration
« Reply #17 on: 26 January 2007, 15:33 »
I think the logic maybe wrong, lol instead of
Code: [Select]
(current_time('timestamp')+86400), try
Code: [Select]
(current_time('timestamp')-86400)

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,294
    • View Profile
Re: ip logging configuration
« Reply #18 on: 26 January 2007, 23:52 »
Time stamp error?
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline hyipcharts

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: ip logging configuration
« Reply #19 on: 27 January 2007, 00:41 »
That did the trick. I set it to -86 for speed purposes and it reset perfectly.

Thanks again