WordPress.org

Support

Support » Plugins and Hacks » YOP Poll » [Resolved] Multiple votes per cookie

[Resolved] Multiple votes per cookie

Viewing 1 replies (of 1 total)
  • Plugin Author YOP

    @yourownprogrammer

    Hi fgrosjean,

    You can not allow multiple votes per cookie but we can provide a fix that will allow multiple votes per IP.

    Go to yop_poll_model.php and in this function, private function is_voted_ip() {, look for

    SELECT id
    FROM …

    replace this with

    SELECT count( *) as votes
    FROM

    Also, before return $log_id; add

    if ($log_id <= 4 )
    return false;

    In the end you should have

    $log_id = $wpdb->get_var(
    $wpdb->prepare(

    SELECT count( *) as votes
    FROM “.$wpdb->yop_poll_logs.”
    WHERE poll_id = %d AND
    ip = %s AND
    vote_date >= DATE_ADD( NOW(), INTERVAL -%d “.$unit.”)
    “,
    $this->poll[‘id’],
    $ip,
    $value
    )
    );

    if ($log_id <= 4 )
    return false;
    return $log_id;

    For all this to work, edit your poll and in “Other Options” choose “Blocking Voters: ” – “By Ip” and save.

    Best wishes,

    YOP team

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Multiple votes per cookie’ is closed to new replies.
Skip to toolbar