Blocked user message – doesnt show up
-
Hi,
I am having an issue where once the user voted and our settings are this (http://imgur.com/MDdP9Jb)
We do not see any message. It is blank. Where can we insert a message here? Shouldn’t there be a message that says the user already voted?
You can try it here: http://www.mtlblog.com/poll-test-page/
Thanks for your help!
-
Hi Chuck,
You can edit inc/yop_poll_model.php and in register_vote function you can replace the message in
$this->error = __( ‘You Already voted!’, ‘yop_poll’ ); with a custom message.Regards,
YOP Team
I already tried that- the message doesnt appear. Did you try it on our site?
Hey Chuck,
Do you want that message to be displayed after the user has clicked on Vote or should it come up when the poll is displayed ?
YOP Team
The message should be displayed when the poll is displayed (not after the person voted, we already tell them to come back to vote tomorrow in the Success message).
Right now it just displays the Question without any error message… which is very confusing for the user.
I did a few tests and the voting options only disappear when we “resave” the page/post where the Poll is in.
If I create a new poll, insert it in the page and then go vote, it will give me the error “You have already voted!”.
When I go back to the Edit mode of the page, resave, and then reload the page, the poll answers will disappear without any text or error.
Hi Chuck,
If you defined %POLL-ERROR-MSG% in your template then edit inc/yop_poll_model.php and in return_poll_html function replace
$template = str_ireplace( ‘%POLL-ERROR-MSG%’, ‘<div id=”yop-poll-container-error-‘ . $poll_id . $unique_id . ‘” class=”yop-poll-container-error”></div>’, $template );
(on line 3109) with
if( !$is_voted ){
$template = str_ireplace( ‘%POLL-ERROR-MSG%’, ‘<div id=”yop-poll-container-error-‘ . $poll_id . $unique_id . ‘” class=”yop-poll-container-error”></div>’, $template );
}
else {
$template = str_ireplace( ‘%POLL-ERROR-MSG%’, ‘<div id=”yop-poll-container-error-‘ . $poll_id . $unique_id . ‘” class=”yop-poll-container-error”>You already Voted</div>’, $template );
}If you did not define %POLL-ERROR-MSG% in your template then in the inc/yop_poll_model.php function replace the content of if ( !$msgDivE ){ } (approximately on line 3138) with
if( $is_voted ){
$template .= ‘<div id=”yop-poll-container-error-‘ . $poll_id . $unique_id . ‘” class=”yop-poll-container-error”>You already voted once! Come back Tomorow</div>’;
}
else {
$template .= ‘<div id=”yop-poll-container-error-‘ . $poll_id . $unique_id . ‘” class=”yop-poll-container-error”></div>’;
}Best wishes,
YOP Team
Amazing, thank you!
Hey,
I want to add a Text, too. But unfortunately I can’t find the inc/yop_poll_model.php. – Is this solution still up-to-date?
The topic ‘Blocked user message – doesnt show up’ is closed to new replies.