Support » Plugin: WP-Polls » Ajax call and max votes ?

  • Resolved kuzma031

    (@kuzma031)


    Hello,

    Very nice plugin.

    Im developer myself and i needed to build advanced voting but had no time so i used your plugin and modified it a little. I hide your frontend and build my own( needed to have videos, check more etc.. ). After clicking something on my frontend javascript will check what is clicked and find that in your pool and click it using click() function. Everything is working good. My question is what is the way to use ajax to check if user voted or no ?

    Currently i use this function to check if user voted or not, its not perfect but its working( thats why i want to use ajax to check db. Im not skilled with wordpress plugin development but i can make this)

    function checkElements() { // ??? is this best way to check ?
    // checkbox for voting
    var checkCheckbox = $(‘.wp-polls ul input[type=”radio”]’);

    if(checkCheckbox.length > 0) { // if there are buttons on page
    voted = false;
    } else {
    voted = true;
    }
    }

    Also, one more question if there is limit for voters since i saw in admin panel “This default filter is limited to display only 2,000 records.””

    Thank you

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

    (@gamerz)

    There is no AJAX function that exposed an API whether the user has voted or not. So you will need to build it.

    There is no max votes, the 2000 is just for displaying on the admin panel for performance reason.

    Ok, thank you 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.