WordPress.org

Ready to get started?Download WordPress

Forums

YOP Poll
[resolved] Problem with logged out users trying to vote (5 posts)

  1. Bloopie
    Member
    Posted 6 months ago #

    When users who are not logged in try to vote on a YOP Poll on my site, there is no message saying the vote was unsuccessful. Instead, a pop-up window opens up for logging in.

    The problem with this pop-up window is that it gets blocked for many users, and others say that even though they're not blocking pop-ups, it just doesn't come up.

    I would much prefer to have a message showing under the poll if the login attempt was unsuccessful, asking the user to "Please login to cast your vote." Then I can redirect them to a page on my site dedicated for logging in.

    Is this possible to change in the code?

    Thanks!

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

  2. YOP
    Member
    Plugin Author

    Posted 6 months ago #

    Hi Bloopie,

    Please send us a link to the page where you have the poll so we may assist.

    Best wishes,

    YOP Team

  3. YOP
    Member
    Plugin Author

    Posted 6 months ago #

    Hi Bloopie,

    Please send us a link to the page where you have the poll so we may assist.

    Regards,

    YOP Team

  4. Bloopie
    Member
    Posted 6 months ago #

    Thanks for your reply YourOwnProgrammer,

    I emailed you the link to my poll.

  5. YOP
    Member
    Plugin Author

    Posted 6 months ago #

    Hey Bloopie,

    We ran some tests and it looks like the problem is caused by the pop up blocker. Even if the user deactvates or doesn't use this function, for security reasons the browser automatically blocks untrusted pop ups.

    To notify users that they have to login please make the changes below

    edit js/yop-poll-public.js and in function, replace

    jQuery('#yop_poll_vote-button-' + yop_poll_various_config.poll_id + yop_poll_various_config.unique_id ).popupWindow({
    windowURL: yop_poll_public_config_general.vote_with_wordpress_login_url + yop_poll_urlencode( yop_poll_various_config_to_get_params( yop_poll_various_config ) ),
    windowName:'yop_poll_popup_window',
    height:500,
    left:0,
    location:0,
    menubar:0,
    resizable:0,
    scrollbars:1,
    status:0,
    width:450,
    top:0,
    toolbar:0,
    centerScreen:1
    });

    with

    jQuery( '#yop-poll-container-error-' + yop_poll_various_config.poll_id + yop_poll_various_config.unique_id ).html( "The-message-you-want" );

    Best wishes,

    YOp Team

  6. Bloopie
    Member
    Posted 6 months ago #

    Hey again,

    Thanks for taking the time to check for a solution to the problem.

    EDIT:
    I said it didn't work but stupidly I just replaced the wrong line.

    Your solution is spot on. It works great now.

    Thanks again for your fantastic support!

Reply

You must log in to post.

About this Plugin

About this Topic