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

    (@yourownprogrammer)

    Hi Craig,

    Edit yop_poll_model.php and in return_poll_html() function, specifically in if(!is_voted) add

    $actual_link =  "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
                            if($actual_link=="your archive url"){
                                $template = str_ireplace( '%POLL-VOTE-BUTTON%', '<button style="visibility:hidden" class="yop_poll_vote_button" id="yop_poll_vote-button-' . $poll_id . $unique_id . '" onclick="yop_poll_register_vote(\'' . $poll_id . '\', \'' . $location . '\', \'' . $unique_id . '\'); return false;">' . $poll_options['vote_button_label'] . '</button>', $template );

    Best wishes,

    YOP Team

    Thread Starter ckalan1

    (@ckalan1)

    Thank you very much. I will let you know how it works.

    By the way, I am definitely interested in beta testing the new version.
    https://www.iamadreammaker.com/dm/

    Craig

    Thread Starter ckalan1

    (@ckalan1)

    Hello YOP Team,

    I searched yop_poll_model.php and could not find “return_poll_html()” function, or “if(!is_voted)”

    I added the quotes here but not in my search.

    Could you give me a line number.

    Thanks,
    Craig

    Plugin Author YOP

    (@yourownprogrammer)

    Hey Craig,

    The return_poll_html() functions starts on line 2954.
    Please try again and let us know if you need more help.

    Regards,

    YOP Team

    Thread Starter ckalan1

    (@ckalan1)

    I found “return_poll_html() but I still cannot find “if(!is_voted)”

    This is what is on line 2951-2956

    public function return_poll_html( $attr = array( ‘tr_id’ => ”, ‘location’ => ‘page’, ‘load_css’ => false, ‘load_js’ => false ) ) {
    $tr_id = isset( $attr[‘tr_id’] ) ? $attr[‘tr_id’] : ”;
    $location = isset( $attr[‘location’] ) ? $attr[‘location’] : ‘page’;
    $unique_id = $this->unique_id;
    $load_css = isset( $attr[‘load_css’] ) ? $attr[‘load_css’] : false;
    //$load_js = isset( $attr[‘load_js’] ) ? $attr[‘load_js’] : false;

    I am not very experienced with PHP so I am probably doing something wrong.

    Any ideas?

    Thanks,
    Craig

    Plugin Author YOP

    (@yourownprogrammer)

    Hi Craig,

    if ( !$is_voted ) is located around line 3006. All you have to do next is to add the code we provided previously inside this “if”.

    Best wishes,

    YOP Team

    Thread Starter ckalan1

    (@ckalan1)

    I inserted the code like this. After I did that, I could not login as an administrator. After I removed it everything went back to normal.
    if ( !$is_voted $actual_link = “https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]&#8221;;
    if($actual_link==”your archive url”){
    $template = str_ireplace( ‘%POLL-VOTE-BUTTON%’, ‘<button style=”visibility:hidden” class=”yop_poll_vote_button” id=”yop_poll_vote-button-‘ . $poll_id . $unique_id . ‘” onclick=”yop_poll_register_vote(\” . $poll_id . ‘\’, \” . $location . ‘\’, \” . $unique_id . ‘\’); return false;”>’ . $poll_options[‘vote_button_label’] . ‘</button>’, $template ); )

    Is this the correct way to insert the line of code you provided

    Plugin Author YOP

    (@yourownprogrammer)

    Hey Craig,

    Please email us at yop.help (@] gmail.com and we will provide a .txt file that includes the code with all the modifications.

    Regards,

    YOP Team

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘How can I hide the vote button on the polls in the Yop Polls archive page?’ is closed to new replies.