Post by Reverse Blade on Jun 26, 2012 21:42:30 GMT
Another old code of mine I found. This will give members a certain amount of money per post, but staff members (with profile editing permissions) are able to add or subtract money from the person via their profile. Some minor edits can be done with the variables on the top of the script.
PREVIEW:
p8.pimg.in/yMgB.png - Admin Editable Example
p8.pimg.in/BB4C.png - Mini Profile Example
PREVIEW:
p8.pimg.in/yMgB.png - Admin Editable Example
p8.pimg.in/BB4C.png - Mini Profile Example
<script type='text/javascript'>
<!--
/*
RB Money Code
By: Reverse Blade(ganderzz)
*/
var description='This is where you can edit member's money count'; // Description for staff
var type='$'; // What money is considered
for(var d=document.getElementsByTagName('td'),t=0;t<d.length;t++) {
if(d[t].width=='20%' && d[t].innerHTML.match(/\[(.+?)\]/i) && d[t].innerHTML.match(/Posts:/i)) {
var e=d[t].innerHTML.match(/\[(\d+)\]/i)? parseInt(RegExp.$1) : 0;
var po=d[t].innerHTML.match(/posts: (\d+)/i)? parseInt(RegExp.$1) : 0;
var total=e+po;
d[t].innerHTML+='<br />'+type+': '+total;
d[t].innerHTML=d[t].innerHTML.replace(/\[(\d+)\]/i,'');
}
if(d[t].innerHTML.match(/Member Group/i) && d[t].width=='160') {
var exp=document.modifyForm.personaltext.value.match(/\[(\d+)\]/i)? parseInt(RegExp.$1) : 0;
var n=document.createElement('tr');
var r=document.createElement('td');
var m=document.createElement('td');
var rr=document.createElement('td');
var f=document.createElement('font');
var ff=document.createElement('font');
var i=document.createElement('input');
i.size='35';
i.value=exp;
i.type='text';
i.name='ex';
ff.size='-1';
ff.innerHTML=type+':';
f.size='-2';
f.innerHTML=description;
r.appendChild(ff);
m.appendChild(i);
rr.appendChild(f);
n.appendChild(r);
n.appendChild(m);
n.appendChild(rr);
d[t].parentNode.parentNode.insertBefore(n,d[t].parentNode.parentNode.nextSibling);
var change=function() {
document.modifyForm.personaltext.maxLength="100";
if(!document.modifyForm.personaltext.value.match(/\[(.+?)\]/i)) {
document.modifyForm.personaltext.value+='['+document.modifyForm.ex.value+']';
document.modifyForm.submit();
}
if(document.modifyForm.personaltext.value.match(/\[(.+?)\]/i)) {
document.modifyForm.personaltext.value=document.modifyForm.personaltext.value.replace(/\[(.+?)\]/i,'['+document.modifyForm.ex.value+']');
document.modifyForm.submit();
}
}
document.modifyForm.onsubmit = change;
}
}
//-->
</script>