Post by CrAzY_J on Sept 15, 2005 19:29:48 GMT -8
Description: This code will add a couple of RPG stats to your mini profile/profile depending on your post count.
The stats will be editable by the admin in the profile area (see preview)
Code placement: Global Footers
Code creator: CrAzY_J
Software: Proboards Version 4 only
Previews:
Preview1
Preview2
Preview3
NOTE: The personal text will be disabled in the code, sorries
<script type='text/javascript'>
/* RPG Me V1.0
Created by cRAzY_J (http://hatakeforum.proboards30.com)
do no redistribute this code without the creator's permission
this header must not be remove*/
var redbull=document.body.getElementsByTagName("td");
var coffee=document.body.getElementsByTagName("table");
function cocacola(){
for(t=0;t<redbull.length;t++){
if(redbull[t].colSpan=="2" && redbull[t].innerHTML.match(/Member's\sBio/)){
redbull[t].getElementsByTagName("a")[0].href.match(/&user=(.+?)$/)
redbull[t].getElementsByTagName("b")[0].innerHTML+= " - <a href='/index.cgi?action=modifyprofile&user="+RegExp.$1+"&rpgstats'>RPG Stats</a>";
}
}
}
function mtdew(){
for(mock=4;mock<coffee.length;mock++) coffee[mock].style.display="none";
var gatorade=document.modifyForm.posts.value;
var a,b,c,d;
if(!document.modifyForm.personaltext.value.match(/gpr%%(\d+)%%(\d+)%%(\d+)%%(\d+)%%/)){
a = Math.floor(gatorade*2.5);b = Math.floor(gatorade*3.5);c = Math.floor(gatorade*1.75);d = Math.floor(gatorade*1.25);
}else{
a=RegExp.$1;b=RegExp.$2;c=RegExp.$3;d=RegExp.$4;
}
var pepsi= "<table width='92%' class='bordercolor' border='0' cellPadding='0' align='center'>"
pepsi+= "<tr><td><table width='100%' cellPadding='4' cellSpacing='1'><tr><td class='titlebg'>"
pepsi+= "<font size='2' class='cattext'>RPG Profile</font></td></tr></table>"
pepsi+= "<table width='100%' cellPadding='4' cellSpacing='1'><tr>"
pepsi+= "<td class='windowbg' width='50%'>Money:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='money' value='"+a+"'></td></tr>"
pepsi+= "<tr><td class='windowbg' width='50%'>Health Points:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='hp' value='"+b+"'></td></tr>"
pepsi+= "<tr><td class='windowbg' width='50%'>Magic Points:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='mp' value='"+c+"'></td></tr>"
pepsi+= "<tr><td class='windowbg' width='50%'>Stamina Points:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='sp' value='"+d+"'></td></tr></table>"
pepsi+= "<table width='100%' cellPadding='4' cellSpacing='1'><tr><td class='titlebg' align='center'>"
pepsi+= "<input type='button' value='Submit Changes' onClick='sprite();'></td></tr></table></td></tr></table>"
document.write(pepsi);
}
function sprite(){
var one = document.getElementById("money").value;
var two = document.getElementById("hp").value;
var three = document.getElementById("mp").value;
var four = document.getElementById("sp").value;
document.modifyForm.personaltext.value = "gpr%%"+one+"%%"+two+"%%"+three+"%%"+four+"%%";
document.modifyForm.submit(true);
}
function fanta(){
for(can=0;can<redbull.length;can++){
if(redbull[can].innerHTML.match(/Personal\sText:/) && redbull[can].width=="160")
redbull[can].parentNode.style.display = "none";
}
}
function orangejuice(){
for(glass=0;glass<redbull.length;glass++){
if( redbull[glass].width=="20%" && redbull[glass].innerHTML.match(/Posts:\s(\d+)/)){
if(redbull[glass].innerHTML.match(/gpr%%(\d+)%%(\d+)%%(\d+)%%(\d+)%%/)){
redbull[glass].innerHTML+= "<br />Money: "+RegExp.$1+"<br />Health Points: "+RegExp.$2+"<br />Magic Points: "+RegExp.$3+"<br />Stamina: "+RegExp.$4;
redbull[glass].innerHTML = redbull[glass].innerHTML.replace(/gpr%%(\d+)%%(\d+)%%(\d+)%%(\d+)%%/,"");
}else{
var beer=redbull[glass].innerHTML.match(/Posts:\s([0-9,])+</)? RegExp.$1:false;
redbull[glass].innerHTML+= "<br /> Money: "+Math.floor(beer*2.5)+"<br /> Health Points: "+Math.floor(beer*3.5)+"<br /> Magic Points: "+Math.floor(beer*1.75)+"<br /> Stamina: "+Math.floor(beer*1.25);
}
}
}
}
if(location.href.match(/modifyprofile/))
fanta();
if(location.href.match(/(view(profile)?|display)/))
orangejuice();
if(redbull[5].innerHTML.match(/admin/)){
cocacola();
if(location.href.match(/&rpgstats/))
mtdew();
}
</script>
The stats will be editable by the admin in the profile area (see preview)
Code placement: Global Footers
Code creator: CrAzY_J
Software: Proboards Version 4 only
Previews:
Preview1
Preview2
Preview3
NOTE: The personal text will be disabled in the code, sorries
<script type='text/javascript'>
/* RPG Me V1.0
Created by cRAzY_J (http://hatakeforum.proboards30.com)
do no redistribute this code without the creator's permission
this header must not be remove*/
var redbull=document.body.getElementsByTagName("td");
var coffee=document.body.getElementsByTagName("table");
function cocacola(){
for(t=0;t<redbull.length;t++){
if(redbull[t].colSpan=="2" && redbull[t].innerHTML.match(/Member's\sBio/)){
redbull[t].getElementsByTagName("a")[0].href.match(/&user=(.+?)$/)
redbull[t].getElementsByTagName("b")[0].innerHTML+= " - <a href='/index.cgi?action=modifyprofile&user="+RegExp.$1+"&rpgstats'>RPG Stats</a>";
}
}
}
function mtdew(){
for(mock=4;mock<coffee.length;mock++) coffee[mock].style.display="none";
var gatorade=document.modifyForm.posts.value;
var a,b,c,d;
if(!document.modifyForm.personaltext.value.match(/gpr%%(\d+)%%(\d+)%%(\d+)%%(\d+)%%/)){
a = Math.floor(gatorade*2.5);b = Math.floor(gatorade*3.5);c = Math.floor(gatorade*1.75);d = Math.floor(gatorade*1.25);
}else{
a=RegExp.$1;b=RegExp.$2;c=RegExp.$3;d=RegExp.$4;
}
var pepsi= "<table width='92%' class='bordercolor' border='0' cellPadding='0' align='center'>"
pepsi+= "<tr><td><table width='100%' cellPadding='4' cellSpacing='1'><tr><td class='titlebg'>"
pepsi+= "<font size='2' class='cattext'>RPG Profile</font></td></tr></table>"
pepsi+= "<table width='100%' cellPadding='4' cellSpacing='1'><tr>"
pepsi+= "<td class='windowbg' width='50%'>Money:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='money' value='"+a+"'></td></tr>"
pepsi+= "<tr><td class='windowbg' width='50%'>Health Points:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='hp' value='"+b+"'></td></tr>"
pepsi+= "<tr><td class='windowbg' width='50%'>Magic Points:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='mp' value='"+c+"'></td></tr>"
pepsi+= "<tr><td class='windowbg' width='50%'>Stamina Points:</td><td width='50%' class='windowbg'>"
pepsi+= "<input id='sp' value='"+d+"'></td></tr></table>"
pepsi+= "<table width='100%' cellPadding='4' cellSpacing='1'><tr><td class='titlebg' align='center'>"
pepsi+= "<input type='button' value='Submit Changes' onClick='sprite();'></td></tr></table></td></tr></table>"
document.write(pepsi);
}
function sprite(){
var one = document.getElementById("money").value;
var two = document.getElementById("hp").value;
var three = document.getElementById("mp").value;
var four = document.getElementById("sp").value;
document.modifyForm.personaltext.value = "gpr%%"+one+"%%"+two+"%%"+three+"%%"+four+"%%";
document.modifyForm.submit(true);
}
function fanta(){
for(can=0;can<redbull.length;can++){
if(redbull[can].innerHTML.match(/Personal\sText:/) && redbull[can].width=="160")
redbull[can].parentNode.style.display = "none";
}
}
function orangejuice(){
for(glass=0;glass<redbull.length;glass++){
if( redbull[glass].width=="20%" && redbull[glass].innerHTML.match(/Posts:\s(\d+)/)){
if(redbull[glass].innerHTML.match(/gpr%%(\d+)%%(\d+)%%(\d+)%%(\d+)%%/)){
redbull[glass].innerHTML+= "<br />Money: "+RegExp.$1+"<br />Health Points: "+RegExp.$2+"<br />Magic Points: "+RegExp.$3+"<br />Stamina: "+RegExp.$4;
redbull[glass].innerHTML = redbull[glass].innerHTML.replace(/gpr%%(\d+)%%(\d+)%%(\d+)%%(\d+)%%/,"");
}else{
var beer=redbull[glass].innerHTML.match(/Posts:\s([0-9,])+</)? RegExp.$1:false;
redbull[glass].innerHTML+= "<br /> Money: "+Math.floor(beer*2.5)+"<br /> Health Points: "+Math.floor(beer*3.5)+"<br /> Magic Points: "+Math.floor(beer*1.75)+"<br /> Stamina: "+Math.floor(beer*1.25);
}
}
}
}
if(location.href.match(/modifyprofile/))
fanta();
if(location.href.match(/(view(profile)?|display)/))
orangejuice();
if(redbull[5].innerHTML.match(/admin/)){
cocacola();
if(location.href.match(/&rpgstats/))
mtdew();
}
</script>