Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Alert when few global mods online

Started by Mike Bobbitt, September 11, 2005, 09:48:30 AM

Previous topic - Next topic

Mike Bobbitt

Want to have a visual alert to your administrators when there are less than 4 global moderators online? Just add this code near the top of your index.template.php:

// Staff count
if ($isadmin) {
// Get a count of all global mods currently online
$result = db_query("SELECT COUNT(*) FROM smf_members, smf_log_online WHERE smf_members.ID_GROUP = 2 and smf_members.ID_MEMBER=smf_log_online.ID_MEMBER");
$res = mysql_fetch_array($result);
$staffCount = $res[0];

if ($staffCount < 4) {
<h5 style="background: #600; font-weight: bold; color: #fff; text-align: center; margin: 0; padding: 0;">+ There are currently $staffCount Staff online +</h5><table width="100%" cellpadding="0" cellspacing="0" border="0">

You can change the "if" statement to show this for global mods as well... that way they know when they're "it" so to speak. This may help keep an "even coverage" of your Staff.



Have you created a mod for this?

If not, I`m gonna do it... :P

Mike Bobbitt

No, I didn't create a mod... I'm a neophyte to that process unfortunately. If you're willing and able, please go ahead.



I`m gonna start with it a bit later today...



How far has this gotten... if anywhere...


"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.



Based on the fact that the last post here was over ten years ago, I think that you can draw your own conclusions.

Please do not revive such old topics in the future.  If you want to start a new topic on this issue, please do so in the SMF Coding Discussion board.  Topic locked.
Soñando con una playa donde brilla el sol, un arco iris ilumina el cielo, y el mar espejea iridescentemente