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: want users to be able to vote once a day...some are cheating by erasing cookie..  (Read 5867 times)

0 Members and 1 Guest are viewing this topic.

Offline bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
So on http://www.bloginterviewer.com users are allowed to vote once a day due to a cookie that is stored on their computer.  Unfortunately some have figured out that you can simply erase the cookie and vote multiple times.  Is there any way to prevent this?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Do a IP check with date

Openup postratings.php:
Find:
Code: [Select]
$get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."'");Replace:
Code: [Select]
$get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."' AND rating_timestamp  > ".current_time('timestamp')-(24*60*60));

++ 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 bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Thanks, I just put the code in.  Let's see how it works.

Mike

Offline bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Put the code in.

I voted, deleted the cookies, and it let me vote again...any suggestions?

Offline Ttech

  • Official Support
  • Global Moderator
  • *****
  • Posts: 4,294
    • View Profile
Do you have the ip check option checked?
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
did u choose logged by IP and Cookie

++ 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
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
I did choose both, then I went to change it to just ip.  I think that will work, right?

But now I'm just trying to get it to function again: http://forums.lesterchan.net/index.php/topic,809.60.html

Offline bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Okay, I got it to work right the normal way, but I changed the code like our recommended above and got this error:



WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-86400' at line 1]
-86400

Offline bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Once this is fixed I'll stop pestering you...for today  ;D

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
Try this replacement:
Code: [Select]
$get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."' AND rating_timestamp  > '".(current_time('timestamp')-(24*60*60))."'");

++ 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 bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Thanks, no more error message.  Now it's time to see if it lets me vote again in 24 hours.

Mike

Offline bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Hey,

Should I have it by IP and Cookie for this?  Is that more secure or will it mess things up?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
yes IP/Cookie

++ 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 bloginterviewer

  • Newbie
  • *
  • Posts: 23
    • View Profile
Thanks,

I do believe you also have to replace this, too:

In postratings.php
Find:
Code:

$rate_cookie = setcookie("rated_".$post_id, 1, time() + 30000000, COOKIEPATH);

Replace:
Code:

$rate_cookie = setcookie("rated_".$post_id, 1, time() + 86400, COOKIEPATH);



I just wanted to make sure others know...I'm correct, right?

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4

++ 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
Learning and Helping one day at a time.




DevNode.org Operator - The IRC network for Programers

Offline skyman

  • Newbie
  • *
  • Posts: 2
    • View Profile
I've have recently upgraded to 2.7.1 however I've been having this same issue as well even before the upgrade. I tried the methods in this post and still can revote after erasing cookies. Does anybody have a fix for this, it's irritating that users can vote multiple times on the same post via this problem. Thanks.

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,536
    • View Profile
  • WordPress Version: WordPress 2.9.x
  • Theme Name: lesterchan.net v3.4
You can logged by IP and Cookie. There is not such thing as fail proof way. Even going through proxy or deleting cookie or ADSL (where IP keep changing) there is no 100% to prevent it.

++ 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 skyman

  • Newbie
  • *
  • Posts: 2
    • View Profile
I'm sure there is, I've seen rating systems used on WP before that do not allow to re-vote after wiping out cookies. Only problem is, I have this integrated through my WordPress and static site and I would hope there's a fix for it rather than having to find another rating system to go with.