• Resolved panterpato

    (@panterpato)


    If you click fast on Like Submit button it couts all your votes before it get the Ajax response.

    So you can like a comment or a post more than once if you know this bug (you don’t need to be too fast).

    I made a weak quick patch directly in the JS function (located on main.php) changing this:

    function alter_ul_post_values(obj,post_id,ul_type)
    		{
    			if(!working){
    				working = true;
    				jQuery(obj).find("span").html("..");
    				jQuery.ajax({
    				type: "POST",
    				url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
    				data: "post_id="+post_id+"&up_type="+ul_type,
    				success: function(msg){
    					jQuery(obj).find("span").html(msg);
    					working = false;
    					}
    				});
    			}
    		}

    for this

    var working = false;
    		function alter_ul_post_values(obj,post_id,ul_type)
    		{
    			if(!working){
    				working = true;
    				jQuery(obj).find("span").html("..");
    				jQuery.ajax({
    				type: "POST",
    				url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
    				data: "post_id="+post_id+"&up_type="+ul_type,
    				success: function(msg){
    					jQuery(obj).find("span").html(msg);
    					working = false;
    					}
    				});
    			}
    		}

    I know it’s a temporal solution. If I got more time ill try to fix it directly from php function.

    https://www.ads-software.com/extend/plugins/like-dislike-counter-for-posts-pages-and-comments/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter panterpato

    (@panterpato)

    Sorry, I Made a mistake, I pasted the same patched code twice.
    The original function is:

    function alter_ul_post_values(obj,post_id,ul_type)
    		{
    				jQuery(obj).find("span").html("..");
    				jQuery.ajax({
    				type: "POST",
    				url: "<?php echo plugins_url( 'ajax_counter.php' , __FILE__ );?>",
    				data: "post_id="+post_id+"&up_type="+ul_type,
    				success: function(msg){
    					jQuery(obj).find("span").html(msg);
    					}
    				});
    		}
    Plugin Author tikendramaitry

    (@tikendramaitry)

    Hi,

    Thank you for contacting us. We are extremely apologetic for replying to your query this late but we’ve been experiencing some issues in our support system. Thankfully, we have now upgraded our support system and will be able to solve issues more efficiently.

    First of all thanks for your contribution.
    We have fixed this problem in our new release. As well as users even don’t have to write a single line of code to setup this plugin now. Please upgrade and enjoy the new look and feel with enhanced and bug free functionalists of the plugin.

    Best,
    Tikendra

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fast clicking bug’ is closed to new replies.