MyBB Community Forums

Full Version: Compatibility thanks plugin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi.
Someone know which one plugin "thanks" can work with MyBB 1.8 ?
No plugins are updated to MyBB 1.8 yet.
Just wait a few weeks and you'll see some plugins updated.
This one cannot work... it require mybbstuff core system...
Hello again.
I resolved problem with compatibility this plugin. http://mods.mybb.com/view/thanks
Now this plugin can also work with new mybb 1.8.

Bellow i put fixed java script code for plugin thanks.
All work good with ajax Smile

/**

 *
 * Thanks Plugin fixed for MyBB 1.8 by Glover(http://cqpolska.pl)
 * Developed by SaeedGH ([email protected])
 * www.mybbhelp.ir
 *
 */

var pid=-1;
var spinner=null;

var my_spinner = {

content:  '<div id="my_spinner" style="position: fixed;display: inline;top: 50%;left: 50%;"><img  src="images/spinner_big.gif"></div>',

show: function (){
$("body").append(my_spinner.content);
return true;
},
destroy: function (){
$("#my_spinner").remove();
return false;}
};

function thx_common(xml)
{
try
{
remove=xml.getElementsByTagName('del').item(0).firstChild.data=="1";
lin=document.getElementById('a'+pid);
if (remove) {
table = document.getElementById('thx' + pid);
table.style.display = xml.getElementsByTagName('display').item(0).firstChild.data != 0 ?
'' : 'none';
list = document.getElementById('thx_list' + pid);
list.innerHTML = xml.getElementsByTagName('list').item(0).firstChild.data;

img = document.getElementById('i' + pid);
img.src = xml.getElementsByTagName('image').item(0).firstChild.data;
}
else 
{
lin.innerHTML="";
lin.onclick=null;
lin.href="";
lin = null;
}
}
catch(err)
{
alert("an Error had occured please contact administrator")
alert(err);
}
finally
{
spinner=my_spinner.destroy();
return lin;
}

}
function thx_action(response)
{
lin=thx_common(response)
if(lin!=null)
{
lin.onclick= new Function("","return rthx("+pid+");");
lin.href='showthread.php?action=remove_thank&pid='+pid;
}
}

function rthx_action(response)
{
lin=thx_common(response)
if (lin!=null) 
{
lin.onclick = new Function("", "return thx(" + pid + ");");
lin.href = 'showthread.php?action=thank&pid=' + pid;
}
}

function thx(id)
{
if(spinner)
return false;
my_spinner.show();
pid=id;
pb="pid="+pid;
$.ajax('xmlhttp.php?action=thankyou',{type: 'post',data:pb, success: thx_action});

return false;
}

function rthx(id)
{
if(spinner)
return false;
my_spinner.show();
pid=id;
b="pid="+pid;
$.ajax('xmlhttp.php?action=remove_thankyou',{type: 'post',data:b, success: rthx_action});
return false;
}
I released a thanks plugin working on 1.8 i made all ajax script and entire almost code, works and its compatible with that thanks plugin and have many more opts and css styled buttons.

I tested since beta appears and after upgrade my forum and make some tests i release it here on mods zone.
I understand Dark Neo but i wanted only this simple fast thanks(without any add code like myallerts), same is with CSS styles buttons (on my modifications) because most users on my site wanted only this one...
[attachment=32354]