|
bloginterviewer
|
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?
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
Do a IP check with date Openup postratings.php: Find: $get_rated = $wpdb->get_var("SELECT rating_ip FROM $wpdb->ratings WHERE rating_postid = $post_id AND rating_ip = '".get_ipaddress()."'"); Replace: $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));
|
|
|
|
|
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.
|
|
|
|
bloginterviewer
|
Thanks, I just put the code in. Let's see how it works.
Mike
|
|
|
|
|
Logged
|
|
|
|
|
bloginterviewer
|
Put the code in.
I voted, deleted the cookies, and it let me vote again...any suggestions?
|
|
|
|
|
Logged
|
|
|
|
|
Ttech
|
Do you have the ip check option checked?
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
did u choose logged by IP and Cookie
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
bloginterviewer
|
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
|
|
|
|
|
Logged
|
|
|
|
|
bloginterviewer
|
Once this is fixed I'll stop pestering you...for today 
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
Try this replacement: $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))."'");
|
|
|
|
|
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.
|
|
|
|
bloginterviewer
|
Thanks, no more error message. Now it's time to see if it lets me vote again in 24 hours.
Mike
|
|
|
|
|
Logged
|
|
|
|
|
bloginterviewer
|
Hey,
Should I have it by IP and Cookie for this? Is that more secure or will it mess things up?
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
yes IP/Cookie
|
|
|
|
|
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.
|
|
|
|
bloginterviewer
|
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?
|
|
|
|
|
Logged
|
|
|
|
|
GaMerZ
|
yeap =)
|
|
|
|
|
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.
|
|
|
|
|
|