dev7
Guest
|
Here are the variables commonly used in PM Bars, free for you to use for open source (credit would be nice, but not necessary).
//PM Base Open Source by Devin //Approved for editing & redistribution
/* Variables pb_username = user name of the user viewing, guest is guest =p pb_displayname = display name of the user viewing, guest is guest =p td = grabbing table cells pmTot = total number of PMs in your inbox pmNum = total number of unread PMs pmLoc = location of pm row, above or below the menubar pmIns = number of row to insert pm bar in {1(Above), 2(Below)} pmRow = the new row for the pm bar */ pmLoc = "above"; //above or below menubar
td = document.getElementsByTagName("td")
if(pmLoc == "above"){
pmIns = "1"
} else if(pmLoc == "below"){
pmIns = "2"
}
pmRow = document.getElementsByTagName("table")[0].insertRow(pmIns).insertCell(0);
if(td[2].innerHTML.match(/pm"\>(.+?) messages<\/a/)){
pmTot = RegExp.$1
} else if(td[2].innerHTML.match(/come Guest/)){
pmTot = "N/A";
}
if(td[2].innerHTML.match(/, 0 are new/)){
pmNum = "0";
} else if(td[2].innerHTML.match(/, 1 is new/)){
pmNum = "1";
} else if(td[2].innerHTML.match(/a\>, (.+?) are new/) && !td[2].innerHTML.match(/, 0 are/)){
pmNum = RegExp.$1;
} else if(td[2].innerHTML.match(/come Guest/)){
pmNum = "N/A";
}
pmRow.className = "catbg"; pmRow.align = "right";
if(pb_username != "Guest"){
pmRow.innerHTML = "User Message"
} else {
pmRow.innerHTML = "Guest Message";
}
Covers the basics to a PM Bar. Creates two different bars, one that a member views and one that guest views. Feel free to edit and redistribute or whatever you want to do with it. Try to study and learn how to use Regular Expressions and if/else Statements for making other codes and such.
|
|
|