Amanda360
06-26-2003, 04:30 PM
hi, i posted before about wanting my name to remain in the "who's online box" even when i'm offline
heres the java script written by the staff and they say this will work, i was just curious as to how i make it work
HEAD (box #1):
<script type="text/javascript">
/* BEGIN EZURL */
ezURL = document.location.href.match("http:\/\/pub([0-9]*)\.ezboard\.com\/(b|f)([a-zA-Z0-9]*)((|)||(frm[0-9]+|$))($|(\.)([a-zA-Z0-9]*))($|([\?])((.)*))");
if (ezURL.length > 0) {
ezPub = ezURL[1];
ezIsBoard = ezURL[2] == "b" ? true : false;
ezBoardID = ezURL.length > 3 ? ezURL[3]: "";
if ( ezBoardID.indexOf("frm") != -1 ) {
ezForum = ezBoardID.substr(ezBoardID.indexOf("frm"));
ezBoardID = ezBoardID.replace(ezForum,"");
} else {
ezForum = ezURL.length > 4 ? ezURL[4] : "";
}
ezPage = ezURL.length > 7 ? ezURL[7] : "";
ezQuery = ezURL.length > 10 ? ezURL[10] : "";
}
ezURL = null;
/* END EZURL */
</script>
This script is used in many of the other scripts offered here. Only one copy should be installed.
HEAD (box #1):
<script type="text/javascript">
/* ALPHABETIZE WHO'S ONLINE LISTING */
function alphawho() {
if ( (!ezPage && !ezQuery ) || ezIsBoard) {
// optional username to add to who's online
var addUser = "Some Admin User";
// optional change who's online labels
var replaceText = true;
allTables = document.getElementsByTagName("table");
for (at = 0; at < allTables.length; at++ ) {
if (allTables.item(at).className == "whosonline") {
allTables.item(at).id = "whosonline";
wotd = allTables.item(at).getElementsByTagName("td").item(1);
if ( addUser != "" ) {
if ( !wotd.innerHTML.match("/" + addUser + "\.showPublicProfile>") ) {
wotd.innerHTML += "\· <A HREF=http://beta.ezboard.com/u" + addUser.toLowerCase().replace(/(\s*)/ig, "") + ".showPublicProfile><FONT FACE=\"Verdana,Arial\" SIZE=1>" + addUser + "</FONT></A> ";
wotd = allTables.item(at).getElementsByTagName("td").item(0);
wotd.innerHTML = eval("\"" + wotd.innerHTML.replace(/([0-9]+)(\s*)visitor/, "\" + ($1+1).toString() + \" visitor") + "\"");
wotd = allTables.item(at).getElementsByTagName("td").item(1);
}
}
allProfiles = wotd.getElementsByTagName("a");
xprofx = new Array();
for (xp = 0; xp < allProfiles.length; xp++) {
xprofx[xp] = new wolink(allProfiles.item(xp).href, allProfiles.item(xp).innerHTML);
}
xprof = xprofx.sort(sortLinksByAddress);
xprofx = null;
for (xp = 0; xp < allProfiles.length; xp++) {
allProfiles.item(xp).href = xprof[xp].href;
allProfiles.item(xp).innerHTML = xprof[xp].innerHTML;
}
xprof = null;
if (replaceText) {
replaceWhat = Array("visitor", "in the last 15 minutes", "Member", "Guest", "Anonymous");
replaceWith = Array("unvisitor", "in the next 15 minutes", "unMember", "unGuest", "Identifiable");
wotd = allTables.item(at).getElementsByTagName("td").item(0);
for ( rw = 0; rw < replaceWhat.length; rw++ ) {
wotd.innerHTML = wotd.innerHTML.replace(replaceWhat[rw], replaceWith[rw]);
}
}
}
}
}
}
function sortLinksByName (a, b) {
a = a.innerHTML.toLowerCase();
b = b.innerHTML.toLowerCase();
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
}
function sortLinksByAddress (a, b) {
a = a.href.toLowerCase();
b = b.href.toLowerCase();
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
}
function wolink(href, innerHTML) {
this.href = href;
this.innerHTML = innerHTML;
}
/* END ALPHABETIZE WHO'S ONLINE LISTING */
</script>
Edit the replaceWith array to reflect what you want to have in the labels.
Edit the addUser variable to reflect the user name that you would like added to Who's Online (empty string for no user added).
Make replaceText = false if you don't want to use the change label functionality.
FOOTER (box #4):
<script type="text/javascript">
/* ALPHABETIZE WHO'S ONLINE */
alphawho();
/* END ALPHABETIZE WHO'S ONLINE */
</script>
Starts the script.
heres the java script written by the staff and they say this will work, i was just curious as to how i make it work
HEAD (box #1):
<script type="text/javascript">
/* BEGIN EZURL */
ezURL = document.location.href.match("http:\/\/pub([0-9]*)\.ezboard\.com\/(b|f)([a-zA-Z0-9]*)((|)||(frm[0-9]+|$))($|(\.)([a-zA-Z0-9]*))($|([\?])((.)*))");
if (ezURL.length > 0) {
ezPub = ezURL[1];
ezIsBoard = ezURL[2] == "b" ? true : false;
ezBoardID = ezURL.length > 3 ? ezURL[3]: "";
if ( ezBoardID.indexOf("frm") != -1 ) {
ezForum = ezBoardID.substr(ezBoardID.indexOf("frm"));
ezBoardID = ezBoardID.replace(ezForum,"");
} else {
ezForum = ezURL.length > 4 ? ezURL[4] : "";
}
ezPage = ezURL.length > 7 ? ezURL[7] : "";
ezQuery = ezURL.length > 10 ? ezURL[10] : "";
}
ezURL = null;
/* END EZURL */
</script>
This script is used in many of the other scripts offered here. Only one copy should be installed.
HEAD (box #1):
<script type="text/javascript">
/* ALPHABETIZE WHO'S ONLINE LISTING */
function alphawho() {
if ( (!ezPage && !ezQuery ) || ezIsBoard) {
// optional username to add to who's online
var addUser = "Some Admin User";
// optional change who's online labels
var replaceText = true;
allTables = document.getElementsByTagName("table");
for (at = 0; at < allTables.length; at++ ) {
if (allTables.item(at).className == "whosonline") {
allTables.item(at).id = "whosonline";
wotd = allTables.item(at).getElementsByTagName("td").item(1);
if ( addUser != "" ) {
if ( !wotd.innerHTML.match("/" + addUser + "\.showPublicProfile>") ) {
wotd.innerHTML += "\· <A HREF=http://beta.ezboard.com/u" + addUser.toLowerCase().replace(/(\s*)/ig, "") + ".showPublicProfile><FONT FACE=\"Verdana,Arial\" SIZE=1>" + addUser + "</FONT></A> ";
wotd = allTables.item(at).getElementsByTagName("td").item(0);
wotd.innerHTML = eval("\"" + wotd.innerHTML.replace(/([0-9]+)(\s*)visitor/, "\" + ($1+1).toString() + \" visitor") + "\"");
wotd = allTables.item(at).getElementsByTagName("td").item(1);
}
}
allProfiles = wotd.getElementsByTagName("a");
xprofx = new Array();
for (xp = 0; xp < allProfiles.length; xp++) {
xprofx[xp] = new wolink(allProfiles.item(xp).href, allProfiles.item(xp).innerHTML);
}
xprof = xprofx.sort(sortLinksByAddress);
xprofx = null;
for (xp = 0; xp < allProfiles.length; xp++) {
allProfiles.item(xp).href = xprof[xp].href;
allProfiles.item(xp).innerHTML = xprof[xp].innerHTML;
}
xprof = null;
if (replaceText) {
replaceWhat = Array("visitor", "in the last 15 minutes", "Member", "Guest", "Anonymous");
replaceWith = Array("unvisitor", "in the next 15 minutes", "unMember", "unGuest", "Identifiable");
wotd = allTables.item(at).getElementsByTagName("td").item(0);
for ( rw = 0; rw < replaceWhat.length; rw++ ) {
wotd.innerHTML = wotd.innerHTML.replace(replaceWhat[rw], replaceWith[rw]);
}
}
}
}
}
}
function sortLinksByName (a, b) {
a = a.innerHTML.toLowerCase();
b = b.innerHTML.toLowerCase();
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
}
function sortLinksByAddress (a, b) {
a = a.href.toLowerCase();
b = b.href.toLowerCase();
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
}
function wolink(href, innerHTML) {
this.href = href;
this.innerHTML = innerHTML;
}
/* END ALPHABETIZE WHO'S ONLINE LISTING */
</script>
Edit the replaceWith array to reflect what you want to have in the labels.
Edit the addUser variable to reflect the user name that you would like added to Who's Online (empty string for no user added).
Make replaceText = false if you don't want to use the change label functionality.
FOOTER (box #4):
<script type="text/javascript">
/* ALPHABETIZE WHO'S ONLINE */
alphawho();
/* END ALPHABETIZE WHO'S ONLINE */
</script>
Starts the script.