• Resolved corijn87

    (@corijn87)


    Hi,

    I want to create a YOP poll and use it for an election.
    A hundred users inside the company are qualified to vote.
    At the results, I want to let show the number of people
    who did not vote yet.

    For example:

    # I choose Ford as supplier for company cars (50 votes)
    # I choose Chevrolet as supplier for company cars (25 votes)
    # People who did not voted yet (25)

    Is this possible at YOP Poll?

    https://www.ads-software.com/plugins/yop-poll/

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

    (@yourownprogrammer)

    Hi corijn87,

    Edit the template you used for your poll and in “Template Before Vote” and “Template After Vote” sections, after <div>%POLL-TOTAL-VOTES%</div> add

    <div>%POLL-TOTAL-VOTES-LEFT%</div>

    Next, edit inc/yop_poll_model.php and look for this function: return_poll_html(…

    After
    if( ‘yes’ == $poll_options[‘view_total_votes’] ) {
    $template = str_ireplace( ‘%POLL-TOTAL-VOTES%’, $poll_options[‘view_total_votes_label’], $template );
    $template = str_ireplace( ‘%POLL-TOTAL-VOTES%’, $poll_details[‘total_votes’], $template );
    }

    add
    $people_left_to_vote = 100 – $poll_details[‘total_votes’];
    $template = str_ireplace( ‘%POLL-TOTAL-VOTES-LEFT%’, sprintf( __(‘People who did not voted yet (%d)’, ‘yop_poll’), $people_left_to_vote ) , $template );

    where “100” (people_left_to_vote = 100) shows how many users are qualified to vote.

    Best wishes,

    YOP Team

    Thread Starter corijn87

    (@corijn87)

    Hi YOP Team,

    Thanks for the quick reply.

    It works fine ??

    Many thanks for your support !

    Greetings.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Number of people who did not vote yet’ is closed to new replies.