Post by Peter on Oct 29, 2004 12:29:52 GMT
Created by Nadim
If you are going to use this code, remove any other code that displays the staff in the users online box.
And if you are using a code that removes the 'Moderators: ' from the board cells, make sure you place this code above it.
Main Footer
You don't need to edit the code, it picks up Admins, Global Moderators, and Moderators without you having to add the usernames.
You may edit the parts of the code where the comments are if you wish.
Please let me know if you find any bugs.
Enjoy the code! ^_^
#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys
If you are going to use this code, remove any other code that displays the staff in the users online box.
And if you are using a code that removes the 'Moderators: ' from the board cells, make sure you place this code above it.
Main Footer
<script language="javascript">
<!--
/*
Display Admins, Gmods, & Mods online in Info Center - by Nadim
This code must not be reposted anywhere outside SolidSnake Designs without the permission of its creator.
This header must remain intact at all times.
http://ssdesigns.proboards17.com
*/
var DisplayModsOnline = "YES" //Change from 'YES' to disable
var DisplayGModsOnline = "YES" //Change from 'YES' to disable
var DisplayAdminsOnline = "YES" //Change from 'YES' to disable
//Change the group titles here if you wish
var GuestTitle = "Guest"
var MemberTitle = "Member"
var ModTitle = "Moderator"
var GModTitle = "Global Moderator"
var AdminTitle = "Administrator"
//Do not edit anything beyond this point
var TD = document.getElementsByTagName("TD");
var Tab = document.getElementsByTagName("Table");
for(i=0;i<Tab.length;i++){
if(Tab[i].width=="98%" && Tab[i].cellPadding=="3" && Tab[i].align=="center" && Tab[i].getElementsByTagName("TD")[0].width!="60%"){
var UsersOnline=Tab[i].getElementsByTagName("TD")[0];
var GroupFont=UsersOnline.getElementsByTagName("Font")[0];
var MembersOnline=GroupFont.innerHTML.split(/Guests, /)[1].split(/ Mem/)[0];
var GuestsOnline=GroupFont.innerHTML.split(/ Gue/)[0];
var ModCount='0';
var GModCount='0';
var AdminCount='0';
var OnlineMember=Tab[i].getElementsByTagName("A");
var ModList='';
for(a=0;a<OnlineMember.length;a++){
for(x=0;x<TD.length;x++){
if(TD[x].className=="windowbg2" && TD[x].width=="66%"){
var ModLink=TD[x].getElementsByTagName("I")[0].getElementsByTagName("A");
for(z=0;z<ModLink.length;z++){
ModList+=':'+ModLink[z].innerHTML+':'
}}}
if(OnlineMember[a].className!="gmoduser" && OnlineMember[a].className!="adminuser" && ModList.match(':'+OnlineMember[a].innerHTML+':'))
{ModCount++;}
if(OnlineMember[a].className=='gmoduser' && DisplayGModsOnline.match(/^yes$/i))
{GModCount++;}
if(OnlineMember[a].className=='adminuser' && DisplayAdminsOnline.match(/^yes$/i))
{AdminCount++;}}
if(ModCount=='1')
{var ModOnlineText=ModTitle;}
else{var ModOnlineText=ModTitle+'s';}
if(GModCount=='1')
{var GModOnlineText=GModTitle;}
else{var GModOnlineText=GModTitle+'s';}
if(AdminCount=='1')
{var AdminOnlineText=AdminTitle;}
else{var AdminOnlineText=AdminTitle+'s';}
var MemberCount=parseInt(MembersOnline-ModCount-GModCount-AdminCount);
if(DisplayModsOnline.match(/^yes$/i)){
var AddModOnline=', '+ModCount+' '+ModOnlineText}
else{AddModOnline=''}
if(DisplayGModsOnline.match(/^yes$/i)){
var AddGModOnline=', '+GModCount+' '+GModOnlineText}
else{AddGModOnline=''}
if(DisplayAdminsOnline.match(/^yes$/i)){
var AddAdminOnline=', '+AdminCount+' '+AdminOnlineText}
else{AddAdminOnline=''}
if(GuestsOnline=="1"){
GroupFont.innerHTML=GroupFont.innerHTML.replace('1 Guests,','1 '+GuestTitle+',');}else{
GroupFont.innerHTML=GroupFont.innerHTML.replace(GuestsOnline+' Guests,',GuestsOnline+' '+GuestTitle+'s,');}
if(MembersOnline=='1')
{var ReplaceMember='Member'}
else{var ReplaceMember='Members'}
if(MemberCount=='1')
{var MemberReplace=MemberTitle}
else{var MemberReplace=MemberTitle+'s'}
GroupFont.innerHTML=GroupFont.innerHTML.replace(ReplaceMember,MemberReplace+AddModOnline+AddGModOnline+AddAdminOnline);
GroupFont.innerHTML=GroupFont.innerHTML.replace(MembersOnline,MemberCount);
}}
//-->
</script>
You don't need to edit the code, it picks up Admins, Global Moderators, and Moderators without you having to add the usernames.
You may edit the parts of the code where the comments are if you wish.
Please let me know if you find any bugs.
Enjoy the code! ^_^
#nosmileys#nosmileys#nosmileys#nosmileys#nosmileys