WordPress.org

Forums

YOP Poll
Add picture (2 posts)

  1. Joe Bestseller
    Member
    Posted 1 year ago #

    Yop Poll is exact what I was looking for.
    But ...
    I would like to display a picture when a specified number of votes is achieved. (a mark)
    Is that possible?

    https://wordpress.org/plugins/yop-poll/

  2. YOP
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Joe,

    Edit inc/yop_poll_model and in strip_all_tags function in, in the "tags" array add %POLL-VOTES-LIMIT-REACHED% so in the end you'll have

    $tags = array( '%CAPTCHA-PLAY%', '%CAPTCHA-LABEL%', '%RELOAD-CAPTCHA-IMAGE%', '%CAPTCHA-IMAGE%', '%CAPTCHA-INPUT%', '%POLL-VIEW-ARCHIVE-LINK%', '%POLL-PAGE-URL%', '%POLL-VOTE-BUTTON%', '%POLL-START-DATE%', '%POLL-END-DATE%', '%POLL-ANSWER-RESULT-LABEL%', '%POLL-BACK-TO-VOTE-LINK%', '%POLL-VIEW-RESULT-LINK%', '%POLL-TOTAL-VOTERS%', '%POLL-TOTAL-ANSWERS%', '%POLL-TOTAL-VOTES%', '%POLL-ID%', '%POLL-NAME%', '%POLL-QUESTION%', '%POLL-ANSWER-RESULT-VOTES%', '%POLL-ANSWER-RESULT-PERCENTAGES%', '%POLL-ANSWER-RESULT-LABEL%', '%POLL-ANSWER-LABEL%', '%POLL-ANSWER-RESULT-BAR%', '%POLL-CUSTOM-FIELD-LABEL%', '%POLL-CUSTOM-FIELD-TEXT-INPUT%', '%POLL-OTHER-ANSWER-CHECK-INPUT%', '%POLL-OTHER-ANSWER-LABEL%', '%POLL-OTHER-ANSWER-TEXT-INPUT%', '%POLL-ANSWER-RESULT%', '%POLL-OTHER-ANSWER-RESULT%', '%POLL-ANSWER-RESULT-VOTES%', '%POLL-OTHER-ANSWER-RESULT-VOTES%', '%POLL-ANSWER-RESULT-PERCENTAGES%', '%POLL-OTHER-ANSWER-RESULT-PERCENTAGES%', '%POLL-ANSWER-CHECK-INPUT%', '%POLL-ANSWER-LABEL%', '%POLL-ANSWER-RESULT%','%POLL-VOTES-LIMIT-REACHED%' );

    Also, in the return_poll_html() function, add

    if($poll_options['total_votes']==numarul_de_voturi_dorit){
                    $template = str_ireplace( '%POLL-VOTES-LIMIT-REACHED%', '<img src="path to your image" ></img>', $template );
    
                }

    Finally, add %POLL-VOTES-LIMIT-REACHED% in the Template Before Vote section, where you want the picture to be displayed.

    Best wishes,

    YOP Team

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic