Post by Shin™ on Apr 14, 2005 18:18:36 GMT
Browswer Compatibility: Cross-browser
Previews: None yet...
Features:
1) Warning levels, and reasons for the warning can be set from member's profiles.
2) Members will also have a money amount, based on their post count, and you are able to set how much money they receive for each post.
3) You can also add/subtract from a member's money amount from their profile.
This code will not work with PBv4. I'll release another version of this code after PBv4.
Like all profile hacks the code is in two parts... One part in your Main footer, the other part in your board footers.
Main Page Footer:
Board Footers:
How to edit:
1) Look for this line first:
Change Money to whatever you want the name of the money to be. Be sure that the quotes around the name stay there...
2) Now look for this line:
Change the 5 to whatever amount of money each member gets for each post they make. Do not put quotes around the number...
3) Make sure you properly edited both parts of the code.
If you have any problems, please post in the code support board, and we'll assist you.
Enjoy
Previews: None yet...
Features:
1) Warning levels, and reasons for the warning can be set from member's profiles.
2) Members will also have a money amount, based on their post count, and you are able to set how much money they receive for each post.
3) You can also add/subtract from a member's money amount from their profile.
This code will not work with PBv4. I'll release another version of this code after PBv4.
Like all profile hacks the code is in two parts... One part in your Main footer, the other part in your board footers.
Main Page Footer:
<script type="text/javascript">
<!--
/*
www.anime-within.tk
Money and Warning Level code by Shin. You may use this code, but do not repost this code without my prior permission. This header must always remain intact.
This part of the code goes in your Main Page Footer only
*/
//Place the name of the money below
var moneyName="Money";
//Place the increment for the money below
var moneyInc=5;
if(location.href.match(/action=profile/i)&&document.creator){
var websiteURL=document.creator.websiteurl;
if(websiteURL.value.match(/\?warnlev=(.+?)&warnreason=(.+?)&madd=(\d+)&msub=(\d+)\?\?\?/i)){
var warnLevel=RegExp.$1;
var warnReason=RegExp.$2;
var addMoney=parseInt(RegExp.$3);
var subMoney=parseInt(RegExp.$4);
websiteURL.value=websiteURL.value.split("?warnlev")[0];
} else {
var warnLevel="None";
var warnReason="None";
var addMoney=0;
var subMoney=0;
}
function WarnMoneySave(){
if(document.creator.settings6){
warnLevel=document.creator.warnLevelInput.value;
warnReason=document.creator.warnReasonInput.value;
var Add=document.creator.ASRadio[0];
var Sub=document.creator.ASRadio[1];
if(Add.checked){
addMoney+=parseInt(document.creator.AddSubInput.value);
} else if(Sub.checked){
subMoney+=parseInt(document.creator.AddSubInput.value);
}}
if(websiteURL.value=="" || !websiteURL.value.match(/^http/i)){
websiteURL.value=location.href.split("?")[0];
document.creator.websitetitle.value=document.title.split("-")[0];
}
websiteURL.value+="?warnlev="+warnLevel+"&warnreason="+warnReason+"&madd="+addMoney+"&msub="+subMoney+"???";
}
if(document.creator.settings6){
var postAmount=parseInt(document.creator.settings6.value);
var currentMoney=(postAmount*moneyInc)+addMoney-subMoney;
var SetP3=document.creator.settings6.parentNode.parentNode.parentNode;
var newRow5=SetP3.parentNode.parentNode.insertRow(SetP3.rowIndex);
var newRow4=SetP3.parentNode.parentNode.insertRow((SetP3.rowIndex)-1);
var newRow3=SetP3.parentNode.parentNode.insertRow((SetP3.rowIndex)-2);
var newRow2=SetP3.parentNode.parentNode.insertRow((SetP3.rowIndex)-3);
var newRow1=SetP3.parentNode.parentNode.insertRow((SetP3.rowIndex)-4);
var WLCell1=newRow1.insertCell(0);
var WLCell2=newRow1.insertCell(1);
var WRCell1=newRow2.insertCell(0);
var WRCell2=newRow2.insertCell(1);
var MSCell1=newRow3.insertCell(0);
var MSCell2=newRow3.insertCell(1);
var ASCell1=newRow4.insertCell(0);
var ASCell2=newRow4.insertCell(1);
var AS2Cell1=newRow5.insertCell(0);
var AS2Cell2=newRow5.insertCell(1);
WLCell1.innerHTML="<font size='2'><b>Warning Level:</b></font>";
WRCell1.innerHTML="<font size='2'><b>Warning Reason:</b></font>";
MSCell1.innerHTML="<font size='2'><b>Current "+moneyName+" Amount:</b></font>";
ASCell1.innerHTML="<font size='2'><b>"+moneyName+" Setup:</b></font>";
AS2Cell1.innerHTML=" ";
WLCell2.innerHTML="<input type=text name='warnLevelInput' value='"+warnLevel+"'>";
WRCell2.innerHTML="<input type=text name='warnReasonInput' value='"+warnReason+"'>";
MSCell2.innerHTML="<font size='2'>"+currentMoney+"</font>";
ASCell2.innerHTML="<input type=text name='AddSubInput' value='0'>";
AS2Cell2.innerHTML="<input type=radio name='ASRadio'><font size='1'>Add the above amount</font><br/><input type=radio name='ASRadio'><font size='1'>Subtract the above amount</font>";
}
document.creator.onsubmit=WarnMoneySave;
}
if(location.href.match(/action=(profile2|viewprofile)/i)){
var Anchors=document.getElementsByTagName("A");
for(a=0;a<Anchors.length;a++){
if(Anchors[a].href.match(/\?warnlev/i)){
Anchors[a].href=Anchors[a].href.split("?warnlev")[0];
}}}
if(location.href.match(/action=ml(all|letter|top|staff)/i)){
var TR=document.getElementsByTagName("tr");
for(var h=0;h<TR.length;h++){
if(TR[h].cells.length>2 && TR[h].cells[2].className=='windowbg' && TR[h].cells[2].firstChild.nodeName=='FONT' && TR[h].cells[2].getElementsByTagName('a').length>0){
var Anchors=TR[h].cells[2].getElementsByTagName('a')[0];
Anchors.href=Anchors.href.split("?warnlev")[0];
}}}
//-->
</script>
Board Footers:
<script type="text/javascript">
<!--
/*
www.anime-within.tk
Money and Warning Level code by Shin. You may use this code, but do not repost this code without my prior permission. This header must always remain intact.
This part of the code goes in your Board Footers only
*/
//Place the name of the money below
var moneyName="Money";
//Place the increment for the money below
var moneyInc=5;
if(location.href.match(/action=display/i)){
var TD=document.getElementsByTagName("TD");
for(var h=0;h<TD.length;h++){
if(TD[h].width=="20%" && TD[h].className.match(/windowbg/i) && TD[h].getElementsByTagName("A").length>0){
var TDLinks=TD[h].getElementsByTagName("A");
for(var e=0;e<TDLinks.length;e++){
if(TDLinks[e].href.match(/\?warnlev=(.+?)&warnreason=(.+?)&madd=(\d+)&msub=(\d+)\?\?\?/i)){
var warnLevel=RegExp.$1;
var warnReason=decodeURI(RegExp.$2);
var addMoney=parseInt(RegExp.$3);
var subMoney=parseInt(RegExp.$4);
TDLinks[e].href=TDLinks[e].href.split('?warnlev')[0];
break;
} else {
var warnLevel="None";
var warnReason="None";
var addMoney=0;
var subMoney=0;
}}
if(TD[h].innerHTML.match(/posts: (\d+)/i)){
var postAmount=parseInt(RegExp.$1);
var currentMoney=(postAmount*moneyInc)+addMoney-subMoney;
TD[h].innerHTML+="<font size='1'><br/>Warning Level: "+warnLevel+"<br/>Reason: "+warnReason+"<br/><br/>"+moneyName+": "+currentMoney+"</font>";
}}}}
//-->
</script>
How to edit:
1) Look for this line first:
var moneyName="Money";
Change Money to whatever you want the name of the money to be. Be sure that the quotes around the name stay there...
2) Now look for this line:
var moneyInc=5;
Change the 5 to whatever amount of money each member gets for each post they make. Do not put quotes around the number...
3) Make sure you properly edited both parts of the code.
If you have any problems, please post in the code support board, and we'll assist you.
Enjoy