Support » Plugin: Vote It Up » [Plugin: Vote It Up] Bug: Multiple Clicks possible with Ajax Voter

  • Nice Plugin!

    Found a bug (maybe it’s already known):

    If you are using the Ajax Voting Function (I recognized it in the Ticker Skin, don’t know if its also in other skins) and voting as a guest, you can vote multiple times if you click multiple times before page reloads…

    I solved it just with adding a Boolean variable which is set true after the first click:

    var clicked = false;
    function vote(obj, votelinkobj, aftervote, postID ,userID, baseURL) {
    	if (clicked == false) {
    		currentobj = obj;
    		voteobj = votelinkobj;
    		aftervotetext = aftervote;
    		var scripturl = baseURL+"/voteinterface.php?type=vote&tid=total&uid="+userID+"&pid="+postID+"&auth="+Math.random();
    		lg_AJAXrequest(scripturl);
    	}
    	clicked = true;
    }

    can you solve this issue in general for the next version?

    http://wordpress.org/extend/plugins/vote-it-up/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thanks for fixing this bug! Hope the developer can implement it.

    Quick question:

    What file/where should I paste this solution? (I’m not a back-end programmer). Thanks a million!

    go into the plugins directory

    vote-it-up_1_2/skins/skinname/voterajax.js

    as appearantly every skin is using its own js, you have to replace the vote() function inside the voterajax.js of the skin you are yousing. find

    function vote(obj, votelinkobj, aftervote, postID ,userID, baseURL) {
    currentobj = obj;
    voteobj = votelinkobj;
    gpostid = postID;
    aftervotetext = aftervote;
    var scripturl = baseURL+”/voteinterface.php?type=vote&tid=total&uid=”+userID+”&pid=”+postID+”&auth=”+Math.random();
    lg_AJAXrequest(scripturl);
    }

    and replace it with the code i posted above.

    i’m not sure but i guess every the voterajax.js is looking the same in every skin so once you changed one file you can replace the other js with a copy of the changed one…but you should check that first…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Vote It Up] Bug: Multiple Clicks possible with Ajax Voter’ is closed to new replies.