Support » Plugin: YOP Poll » Block Users By 1 Day Doesn't Work

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author YOP

    (@yourownprogrammer)

    Hi Chuck,

    With those settings it will reset after 24 hours.

    If some one votes right now then he will be able to vote again at exactly the same time, tomorrow.

    Best wishes,

    YOP Team

    Thread Starter Chuck

    (@meandisis)

    So how do we get it to restart at midnight? It seems like your 1 day option comes down to choosing 24 hours?

    Plugin Author YOP

    (@yourownprogrammer)

    Hi Chuck,

    Sorry it took so long to get back to you.

    Please edit inc/yop_poll_model.php and in set_vote_cookie function (located approximately on line 3813) in case ‘days’: replace

    $expire_cookie = time() + ( 60 * 60 * 24 * $value );
                            break;

    with

    if( $value == 1 ) {
                            $expire_cookie = mktime(0, 0, 0, date('n'), date('j') + 1);
                            break;
                        }
                        else{
                            $expire_cookie = time() + ( 60 * 60 * 24 * $value );
                            break;
                        }

    By making these changes the cookies will expire at 00:00:00, the browser will no longer send them and the user will be able to vote again after midnight.

    This will work only if you set Blocking Voters : by Cookie.

    Regards,

    YOP Team

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Block Users By 1 Day Doesn't Work’ is closed to new replies.