in this last part of Like/Dislike extension i will explain the change in Javascript
function post_like(postid) { var req = ajax_init(false); if( ! req ) { return; } var thislink = d.getElementById("postlink_like_"+postid); req.onreadystatechange = function() { if( req.readyState != 4 ) { return; } if( req.responseText != "OK" ) { return; } thislink.style.cursor = "pointer"; thislink.style.display = "none"; //d.getElementById("postlink_like_"+postid).style.display = "none"; } req.open("POST", siteurl+"ajax/likepost/r:"+Math.round(Math.random()*1000), true); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.send("postid="+encodeURIComponent(postid)); thislink.style.cursor = "wait"; } function post_dislike(postid) { var req = ajax_init(false); if( ! req ) { return; } var thislink = d.getElementById("postlink_dislike_"+postid); req.onreadystatechange = function() { if( req.readyState != 4 ) { return; } if( req.responseText != "OK" ) { return; } thislink.style.cursor = "pointer"; thislink.style.display = "none"; //d.getElementById("postlink_like_"+postid).style.display = "none"; } req.open("POST", siteurl+"ajax/dislikepost/r:"+Math.round(Math.random()*1000), true); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.send("postid="+encodeURIComponent(postid)); thislink.style.cursor = "wait"; }
if you find any bug please send comment to us,
open file themes\default\js\inside_posts.js
add these functions
save it, and test it, if you find this is very usefull please donate, thanks