Post by [K]hAoS on Jun 23, 2005 3:09:38 GMT -8
I can't seem to get this code to work properly, its all there but theres no option in peoples profiles to edit anything. I am an administrator on the forum and have the power to edit profiles Heres the money Hack code thread and heres the codes i entered on the forum:
Main Footer Code
Global Footer
Thankyou to anyone who helps
Main Footer Code
<script type="text/javascript">
<!--
/*
Money Hack v2 - Main footer script
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times.
*/
// Money per post
var iMonPP = 0;
// What kind is it? ie. Points, Sweets..ect
var mText = "Points";
// Want a symbol..? $, £, etc
var mSym = "";
// Who can edit money? Put the username in...ie..["admin", "khaos"];
var iAllowed = ["admin"];
var curMon = {
money: 0,
total: 0,
rownum: 1
};
var usingMoneyCode = true;
var iDesTxt = "Give this user more " + mText.toLowerCase() + ". You may take away money by using the minus sign (-300 for example).";
var iDes;
var iFont = document.createElement("font");
var mTxt = document.createTextNode(mText + ":");
var nInput = document.createElement("input");
var mInput = document.createElement("input");
var iTable = document.getElementsByTagName("table");
var iCell = document.getElementsByTagName("td");
iFont.size = "-2";
iDes = iFont.cloneNode(true).appendChild(document.createTextNode(iDesTxt));
iFont.size = "-1";
iFont.appendChild(mTxt);
nInput.type = "hidden";
nInput.id = "total";
nInput.value = 0;
nInput.maxLength = 8;
mInput.id = "money";
mInput.value = 0;
mInput.maxLength = 8;
String.prototype.sortMoney = function(){
var iTotal = parseInt(document.getElementById("total").value);
if(this){
switch(arguments[0]){
case 1 :
if(/^(-)?\d+$/.exec(this)){
document.modifyForm.personaltext.value += "[M:" + (iTotal + parseInt(this)) + "]";
}
break;
case 0 :
if(this.match(/\[M:((-)?\d+)\]/)){
document.getElementById("total").value = RegExp.$1;
document.modifyForm.personaltext.value = this.replace(/\[M:(-)?\d+\]/, "");
}
break;
}
}
}
function setPersonalTxt(len){
var perTxt = document.modifyForm.personaltext;
if(perTxt.value.length >= len && !/\[M:(-)?\d+\]/.exec(perTxt.value)){
perTxt.value = perTxt.value.substr(0, len);
}
}
function createInput(){
var iDisplay = "none";
for(t = 0; t < iTable.length; t ++){
if(iTable.item(t).width == "650" && iTable.item(t).innerHTML.match(/Disable Account:/)){
var nRow = iTable.item(t).insertRow(iTable.item(t).rows.length);
for(a = 0; a < iAllowed.length; a ++){
if(document.cookie.match(new RegExp("user=" + iAllowed[a] + ";"))){
iDisplay = "";
break;
}
}
nRow.style.display = iDisplay
var nCell = nRow.insertCell(0);
nCell.appendChild(iFont);
nCell = nRow.insertCell(1);
nCell.appendChild(nInput);
nCell.appendChild(mInput);
nCell = nRow.insertCell(2).appendChild(iDes);
}
}
}
function fNum(num){
if(!isNaN(num)){
num = num.toLocaleString().replace(/\.\d+/, "");
} else {
num = 0;
}
return num;
}
function doMiniProfile(){
var mFx = iFont.cloneNode(true);
mFx.style.fontSize = "11px";
for(c = 0; c < iCell.length; c ++){
if(iCell.item(c).width == "20%" && iCell.item(c).className == "windowbg" && iCell.item(c).innerHTML.match(/member is/)){
if(iCell.item(c).innerHTML.match(/\[M:((-)?\d+)\]/)){
curMon.money = parseInt(RegExp.$1);
iCell.item(c).innerHTML = iCell.item(c).innerHTML.replace(/\[M:(-)?\d+\]/, "");
}
if(iCell.item(c).innerHTML.match(/Posts: ((\d+,\d+)|(\d+))/)){
var cPosts = RegExp.$1.replace(/,/g, "");
cPosts = ((cPosts * iMonPP) + parseInt(curMon.money));
curMon.total = cPosts;
mFx.replaceChild(document.createTextNode(mText + ": " + mSym + fNum(cPosts)), mFx.firstChild);
if(iCell.item(c).lastChild.nodeName.toLowerCase() != "br"){
iCell.item(c).appendChild(document.createElement("br"));
}
iCell.item(c).appendChild(mFx);
} else {
mFx.replaceChild(document.createTextNode(mText + ": " + mSym + "0"), mFx.firstChild);
if(iCell.item(c).lastChild.nodeName.toLowerCase() != "br"){
iCell.item(c).appendChild(document.createElement("br"));
}
iCell.item(c).appendChild(mFx);
}
}
}
}
function doMemberBio(){
var bFont = document.createElement("font");
var re = />Member's Bio -/;
bFont.size = "2";
for(t = 0; t < iTable.length; t ++){
if(iTable.item(t).cellPadding == "4" && iTable.item(t).rows.item(0).innerHTML.match(re)){
var iRow = iTable.item(t).getElementsByTagName("tr");
for(r = 0; r < iRow.length; r ++){
if(iRow.item(r).innerHTML.match(/>Posts:</)){
curMon.rownum = (iRow.item(r).rowIndex + 1);
}
}
var nRow = iTable.item(t).insertRow(curMon.rownum);
var nCell = nRow.insertCell(0);
var cBFont = bFont.cloneNode(true);
bFont.appendChild(document.createTextNode(mText + ":"));
nCell.appendChild(bFont);
nCell = nRow.insertCell(1);
cBFont.appendChild(document.createTextNode(mSym + fNum(curMon.total)));
nCell.appendChild(cBFont);
}
}
}
if(location.href.match(/=modifyprofile&user=/) && document.modifyForm){
createInput();
document.modifyForm.onsubmit = function(){
setPersonalTxt(88);
document.getElementById("money").value.sortMoney(1);
}
document.modifyForm.personaltext.value.sortMoney(0);
window.onload = function(){
document.modifyForm.personaltext.value.sortMoney(0);
}
}
if(!location.href.match(/\/index.cgi$/)){
doMiniProfile();
}
if(location.href.match(/=viewprofile/)){
doMemberBio();
}
//-->
</script>
Global Footer
<script type="text/javascript">
<!--
/*
Money Hack v2 - Global Footers
Created by Peter
This code cannot be reposted at anywhere other than SSDesigns or ProBoards, without permission.
This header must stay intact at all times.
*/
// Money per post
var iMonPP = 0;
// What kind is it? ie. Points, Sweets..ect
var mText = "Points";
// Want a symbol..? $, £, etc
var mSym = "";
var curMon = {
money: 0
};
function fNum(num){
if(!isNaN(num)){
num = num.toLocaleString().replace(/\.\d+/, "");
} else {
num = 0;
}
return num;
}
var iCell = document.getElementsByTagName("td");
function doMiniProfile(){
for(c = 0; c < iCell.length; c ++){
var mFx = document.createElement("font");
mFx.style.fontSize = "11px";
if(iCell.item(c).width == "20%" && iCell.item(c).className.match(/^windowbg/) && iCell.item(c).innerHTML.match(/member is/)){
if(iCell.item(c).innerHTML.match(/\[M:((-)?\d+)\]/)){
curMon.money = parseInt(RegExp.$1);
iCell.item(c).innerHTML = iCell.item(c).innerHTML.replace(/\[M:(-)?\d+\]/, "");
} else {
curMon.money = 0;
}
if(iCell.item(c).innerHTML.match(/Posts: ((\d+,\d+)|(\d+))/)){
var cPosts = RegExp.$1.replace(/,/g, "");
cPosts = ((cPosts * iMonPP) + parseInt(curMon.money));
mFx.appendChild(document.createTextNode(mText + ": " + mSym + fNum(cPosts)));
if(iCell.item(c).lastChild.nodeName.toLowerCase() != "br"){
iCell.item(c).appendChild(document.createElement("br"));
}
iCell.item(c).appendChild(mFx);
} else {
mFx.appendChild(document.createTextNode(mText + ": " + mSym + "0"));
if(iCell.item(c).lastChild.nodeName.toLowerCase() != "br"){
iCell.item(c).appendChild(document.createElement("br"));
}
iCell.item(c).appendChild(mFx);
}
}
}
}
if(location.href.match(/(=display|\/index.cgi$)/)){
doMiniProfile();
}
//-->
</script>
Thankyou to anyone who helps