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

    (@yourownprogrammer)

    Hi,

    Edit your poll and set “Limit Number of Votes per User: ” to “Yes” and in “Number of Votes per User:” type in 1.

    Next, set “View Results” to “After Vote” and save.

    This way, you users will be able to vote only once and they can see the results only after they vote.

    Best wishes,

    YOP Team

    Thread Starter wp_user232323232

    (@wp_user232323232)

    Hi,

    I already have these settings in place. When a user re-opens the page after voting, say next day, I would like the poll to automatically show the results, not the poll choices. Otherwise, the user votes and then sees the error message “You have run out of votes!”. Is it possible not to give them the option to vote if they already voted in the first place? I believe this is pretty standard behavior for online polls.

    Thank you for a wonderful plugin!

    Plugin Author YOP

    (@yourownprogrammer)

    Hey,

    Sorry it took so long to get back to you.

    Edit inc/yop_poll_model.php and in return_poll_html function, after

    if ( !$is_voted ){
          $template = $template_details['before_vote_template'];

    add

    global $wpdb;
                            $ip     = self::get_ip();
                            $log_id = $wpdb->get_var( $wpdb->prepare( "
         SELECT id
         FROM " . $wpdb->yop_poll_logs . "
         WHERE poll_id = %d AND
         ip = %s
    
         ", $this->poll['id'], $ip) );
                          if(isset($log_id)) {
                              $template = $template_details['after_vote_template'];
    
                          }

    and set View Results to Before Vote.

    Regards,

    YOP Team

    Thread Starter wp_user232323232

    (@wp_user232323232)

    No problem. Thank you for the suggestion. Will I have to modify inc/yop_poll_model.php after every plugin update?

    Plugin Author YOP

    (@yourownprogrammer)

    Hi wp_user232323232,

    Yes, you’ll have to make these changes after every update so make sure you save the code.

    Best wishes,

    YOP Team

    Thread Starter wp_user232323232

    (@wp_user232323232)

    Thanks again. Do you have any plans to add this feature as an option? I believe it’s pretty standard.

    Plugin Author YOP

    (@yourownprogrammer)

    Hi,

    We will take your suggestion into consideration and try to implement it in the future.

    Regards,

    YOP Team

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Poll setup.’ is closed to new replies.