Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Mar 22nd, 2018, 06:56am

Board Hacks
Important News
Please read the notes posted with any codes carefully, as they will usually tell you where they need to go.
Welcome to the Conforums Hacks Board!

All codes here have been tested but we accept no responsibility if these codes do not work on your board, or have an adverse effect when used in combination with other codes.

This board is read only. Any queries or requests for codes should be made on the Coding Forum

Helpful sites
Dynamic Drive

The Staff

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Number of Admins/Gmod/Mods in users online box  (Read 3264 times)
I've always wanted one of these wink
Conforums Administrator

member is offline


Mr Fixit...

Homepage PM

Gender: Male
Posts: 17664
xx Number of Admins/Gmod/Mods in users online box
« Thread started on: Dec 16th, 2003, 4:11pm »

This code requires 2 seperate pieces of code...

I've seperated them out, so the first one (with a little tweak, gives coloured usernames etc...) assigns users a class... such as
  • adminuser for admins..
  • gmoduser for gmods..
  • moduser for moderators..
( This is the actual script that we use here to give coloured usernames ).

So this goes into all footers..:- Code:
<script language="javascript" type="text/javascript">
// add classnames to staff

function doitnow(user,classuser) {
for(var a=0;a<document.links.length;a++)
if(document.links[a].href.indexOf('viewprofile&username='+user) != -1 )

// -->

I've left in the usernames, so you can see who to add/remove more...

Then in just the main footer, after the code above:- Code:
<script language="javascript" type="text/Javascript">
Show staff online
Dave -

var usercell = document.getElementById('info_center').getElementsByTagName('FONT')[7];
var adon="", gmon="", mon="", uon="", swuser="", uclass="", utype="";
var onuser = usercell.getElementsByTagName('A')

function adduser(type,userlink,userclass,profuser){
utype= (type!="") ? ", " : "";
uclass = (userclass != "") ? ' class="'+userclass+'"' : '';
return utype+'<a href="index.cgi?action=viewprofile&username='+profuser+'"'+uclass+'>'+userlink.innerHTML+'</a>';

var usertype = document.getElementById('info_center').getElementsByTagName('FONT')[7].innerHTML.split(/<br>/i)[0].split(/,/)[0]
if(usertype.match(/^1 guest/i))
usertype = "1 Guest";

for(on=0; on<onuser.length; on++){
swuser = RegExp.$1;
switch (onuser[on].className){
case "adminuser":
adon += adduser(adon,onuser[on],"adminuser",swuser); break;
case "gmoduser":
gmon += adduser(gmon,onuser[on],"gmoduser",swuser); break;
case "moduser":
mon += adduser(mon,onuser[on],"moduser",swuser); break;
uon += adduser(uon,onuser[on],"",swuser); break;

if(adon!="")adon="Administrators: "+adon
if(gmon!="")gmon="<br />Global Moderators: "+gmon
if(mon!="")mon="<br />Moderators: "+mon
if(uon!="")uon="<br />Members: "+uon
usercell.innerHTML=adon+gmon+mon+uon+"<br />"+usertype;

// -->

You don't need to modify this second code in any way... it uses information from the first code...

Let me know how you get on....

As of the recent update, there is no need to specify classnames for admin and global moderators..
« Last Edit: Jun 4th, 2010, 02:03am by Dave » User IP Logged

Have you read the FAQ or checked the Hacks board before posting?
Then please do so...
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls