Can you disable IP address verification?

Kristi's Avatar

Kristi

11 Nov, 2010 12:23 AM

Love this plugin! But, am using it for a major corporation and we are getting complaints that they can't vote more than once, since they share IP addresses. Any way to disable that? I'm not a code person AT ALL, so if you could explain exactly what I need to do, the client won't kill me :)

  1. Support Staff 1 Posted by LeBen on 13 Nov, 2010 05:29 PM

    LeBen's Avatar

    Change your file like.php like this:

    <?php
    require_once '../../../wp-config.php';
    
    global $wpdb;
    $post_ID = $_POST['id'];
    //$ip = $_SERVER['REMOTE_ADDR'];
    $like = get_post_meta($post_ID, '_liked', true);
    
    if($post_ID != '') {
        //$voteStatusByIp = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->prefix."ilikethis_votes WHERE post_id = '$post_ID' AND ip = '$ip'");
    
        //if (!isset($_COOKIE['liked-'.$post_ID]) && $voteStatusByIp == 0) {
        if (!isset($_COOKIE['liked-'.$post_ID])) {
            $likeNew = $like + 1;
            update_post_meta($post_ID, '_liked', $likeNew);
    
            setcookie('liked-'.$post_ID, time(), time()+3600*24*365, '/');
            //$wpdb->query("INSERT INTO ".$wpdb->prefix."ilikethis_votes VALUES ('', NOW(), '$post_ID', '$ip')");
    
            echo $likeNew;
        }
        else {
            echo $like;
        }
    }
    ?>
  2. LeBen closed this discussion on 13 Nov, 2010 05:29 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

24 Feb, 2016 05:49 PM
30 Nov, 2013 03:31 PM
30 Nov, 2013 03:10 PM
30 Nov, 2013 11:55 AM
30 Nov, 2013 11:24 AM

Recent Articles