Post by Peter on Oct 31, 2004 11:46:11 GMT
The outcome of this is similar to v1, but it has been completely recoded.
This has a few extra optional features, and coded better than v1.
I havn't come across any bugs so far in this one.
Main Footer
Let me know if you have any problems.
Enjoy the code. ^_^
This has a few extra optional features, and coded better than v1.
I havn't come across any bugs so far in this one.
Main Footer
<script language="JavaScript">
<!--
/*
Staff in Info Center v2 - by Nadim
This code must not be edited or reposted anywhere outside SolidSnake Designs without the express permission of its creator.
http://ssdesigns.proboards17.com
*/
// Disable/Enable Features Here (Change from 'YES' to disable):
var DisplayGuests = "YES"
var DisplayMembers = "YES"
var DisplayMods = "YES"
var DisplayGMods = "YES"
var DisplayAdmins = "YES"
var DisplayTotalCount = "YES"
// Change Group Titles Here (Singular & Plural):
var GuestTitle = ["Guest","Guests"];
var MemberTitle = ["Member","Members"];
var ModTitle = ["Moderator","Moderators"];
var GModTitle = ["Global Moderator","Global Moderators"];
var AdminTitle = ["Administrator","Administrators"];
// Change Group Colors Here (Leave as 'HEX' for no color):
var GuestTitleColor = "HEX";
var MemberTitleColor = "HEX";
var ModTitleColor = "HEX";
var GModTitleColor = "HEX";
var AdminTitleColor = "HEX";
//Do Not Edit Below This Point:
var TD = document.getElementsByTagName("TD");
var Tab = document.getElementsByTagName("Table");
var GroupTotal = '0';
for(iCent=0; iCent<Tab.length;iCent++){
if(Tab[iCent].width=="98%" && Tab[iCent].cellPadding=="3" && Tab[iCent].align=="center" && Tab[iCent].getElementsByTagName("TD")[0].width!="60%" && Tab[iCent].getElementsByTagName("TD")[0].vAlign=="top"){
var iCentUO = Tab[iCent].getElementsByTagName("TD")[0];
var UsersOnline = iCentUO.getElementsByTagName("Font")[0];
var OnlineLink = UsersOnline.getElementsByTagName("A");
var BoardCount = -1;
var GuestCount = 0;
var MemberCount = 0;
var ModCount = 0;
var GModCount = 0;
var AdminCount = 0;
GuestCount+= parseInt(UsersOnline.innerHTML.split(" Gues")[0]);
MemberCount+= parseInt(UsersOnline.innerHTML.split(", ")[1].split(" Mem")[0]);
var OnlineData = UsersOnline.innerHTML.split("<B"+"R>")[0];
for(A=0; A<OnlineLink.length; A++){
for(Cell=0; Cell<TD.length; Cell++){
if(TD[Cell].className=="windowbg2" && TD[Cell].width=="66%"){
BoardCount++;
if(BoardCount=='0'){
ModCheck = "unchecked"
}
var BoardLinks = TD[Cell].getElementsByTagName("A");
for(Mod=2; Mod<BoardLinks.length; Mod++){
if(BoardLinks[Mod].href==OnlineLink[A].href && BoardLinks[Mod].className!="gmoduser" && BoardLinks[Mod].className!="adminuser"){
if(ModCheck=="unchecked" && ModCheck!="checked"){
if(DisplayGMods.match(/^YES$/i)){
ModCheck = "checked";
ModCount++;
MemberCount--;
}
}
}
}
}
}
if(OnlineLink[A].className=="gmoduser"){
if(DisplayAdmins.match(/^YES$/i)){
GModCount++;
MemberCount--;
}
}
if(OnlineLink[A].className=="adminuser"){
if(DisplayAdmins.match(/^YES$/i)){
AdminCount++;
MemberCount--;
}
}
}
var GuestTitle = (GuestCount==1)? GuestTitle[0] : GuestTitle[1];
var MemberTitle = (MemberCount==1)? MemberTitle[0] : MemberTitle[1];
var ModTitle = (ModCount==1)? ModTitle[0] : ModTitle[1];
var GModTitle = (GModCount==1)? GModTitle[0] : GModTitle[1];
var AdminTitle = (AdminCount==1)? AdminTitle[0] : AdminTitle[1];
if(DisplayGuests.match(/^YES$/)){
DisplayGuests = GuestCount+' '+GuestTitle;
}
else{DisplayGuests='';}
if(DisplayMembers.match(/^YES$/)){
DisplayMembers = MemberCount+' '+MemberTitle;
}
else{DisplayMembers='';
}
if(DisplayMods.match(/^YES$/)){
DisplayMods = ModCount+' '+ModTitle;
}
else{DisplayMods='';
}
if(DisplayGMods.match(/^YES$/)){
DisplayGMods = GModCount+' '+GModTitle;
}
else{DisplayGMods='';
}
if(DisplayAdmins.match(/^YES$/)){
DisplayAdmins = AdminCount+' '+AdminTitle;
}
else{DisplayAdmins='';
}
DisplayGuests = (GuestTitleColor.match(/^\w{6}$/i))? '<font color="'+GuestTitleColor+'">'+DisplayGuests+'</font>, ' : DisplayGuests+', ';
DisplayMembers = (MemberTitleColor.match(/^\w{6}$/i))? '<font color="'+MemberTitleColor+'">'+DisplayMembers+'</font>, ' : DisplayMembers+', ';
DisplayMods = (ModTitleColor.match(/^\w{6}$/i))? '<font color="'+ModTitleColor+'">'+DisplayMods+'</font>, ' : DisplayMods+', ';
DisplayGMods = (GModTitleColor.match(/^\w{6}$/i))? '<font color="'+GModTitleColor+'">'+DisplayGMods+'</font>, ' : DisplayGMods+', ';
DisplayAdmins = (AdminTitleColor.match(/^\w{6}$/i))? '<font color="'+AdminTitleColor+'">'+DisplayAdmins+'</font>, ' : DisplayAdmins+', ';
var GuestTitle = (GuestCount==1)? GuestTitle[0] : GuestTitle[1];
var DisplayGroups = DisplayGuests+DisplayMembers+DisplayMods+DisplayGMods+DisplayAdmins;
DisplayGroups = DisplayGroups.replace(DisplayGroups.substring(DisplayGroups.length-10,DisplayGroups.length),DisplayGroups.substring(DisplayGroups.length-10,DisplayGroups.length-2));
UsersOnline.innerHTML=UsersOnline.innerHTML.replace(OnlineData,DisplayGroups);
GroupTotal = GuestCount+MemberCount+ModCount+GModCount+AdminCount;
if(DisplayTotalCount.match(/^YES$/i)){
for(Cell=0; Cell<TD.length; Cell++){
if(TD[Cell].className=="catbg" && TD[Cell].colSpan=="2" && TD[Cell].innerHTML.match(/Users Online/)){
var UsersOnlineText = TD[Cell].getElementsByTagName("Font")[0];
UsersOnlineText.innerHTML = UsersOnlineText.innerHTML.replace("Online","Online: "+GroupTotal);
}
}
}
}
}
//-->
</script>
Let me know if you have any problems.
Enjoy the code. ^_^