SQL
Above that add:
$forum_t = sqlesc(get_date_time($forum_t));
$res = mysql_query("SELECT id, username, class FROM users WHERE forum_access >= $forum_t ORDER BY forum_access DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($forumusers) $forumusers .= ",\n";
switch ($arr["class"])
{
case 15:
$arr["username"] = "<font color=#011FFD>" . $arr["username"] . "</font>";
break;
case 14:
$arr["username"] = "<font color=#FD0113>" . $arr["username"] . "</font>";
break;
case 9:
$arr["username"] = "<font color=red>" . $arr["username"] . "</font>";
break;
case 8:
$arr["username"] = "<font color=red>" . $arr["username"] . "</font>";
break;
case 7:
$arr["username"] = "<font color=#03FCF3>" . $arr["username"] . "</font>";
break;
case 6:
$arr["username"] = "<font color=orange>" . $arr["username"] . "</font>";
break;
case 5:
$arr["username"] = "<font color=#FAFD01>" . $arr["username"] . "</font>";
break;
case 4:
$arr["username"] = "<font color=#FF00FF>" . $arr["username"] . "</font>";
break;
case 3:
$arr["username"] = "<font color=#03FC0F>" . $arr["username"] . "</font>";
break;
case 2:
$arr["username"] = "<font color=black>" . $arr["username"] . "</font>";
break;
case 1:
$arr["username"] = "<font color=#FA8072>" . $arr["username"] . "</font>";
break;
}
if ($CURUSER)
$forumusers .= "<a href=account-details.php?id=" . $arr["id"] . ">" . $arr["username"] . "</a></a>";
}
if (!$forumusers)
$forumusers = "There have been no active users in the last 15 minutes.";
?>
<br>
<table width=100% cellspacing=0 cellpadding=5><tr>
<td class="table_col1" align="left">Active Forum Simpsons</td></tr>
</tr><td class=table_col2>
<?=$forumusers?>
</td></tr>
</tr><td class=table_col1>
L
ALTER TABLE `users` ADD `forum_access` DATETIME NOT NULL AFTER `last_access`;In forums.php find$forums_res = mysql_query("SELECT forumcats.id AS fcid, forumcats.name AS fcname, forum_forums.* FROM forum_forums LEFT JOIN forumcats ON forumcats.id = forum_forums.category ORDER BY forumcats.sort, forum_forums.sort, forum_forums.name") or die(mysql_error());
Above that add:
mysql_query("UPDATE users SET forum_access='" . get_date_time() . "' WHERE id={$CURUSER["id"]}");// or die(mysql_error());
Find
//Top postersAbove that add:
//Users active$forum_t = gmtime() - 600; //you can change this value to whatever span you want$forum_t = sqlesc(get_date_time($forum_t));
$res = mysql_query("SELECT id, username, class FROM users WHERE forum_access >= $forum_t ORDER BY forum_access DESC") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($forumusers) $forumusers .= ",\n";
switch ($arr["class"])
{
case 15:
$arr["username"] = "<font color=#011FFD>" . $arr["username"] . "</font>";
break;
case 14:
$arr["username"] = "<font color=#FD0113>" . $arr["username"] . "</font>";
break;
case 9:
$arr["username"] = "<font color=red>" . $arr["username"] . "</font>";
break;
case 8:
$arr["username"] = "<font color=red>" . $arr["username"] . "</font>";
break;
case 7:
$arr["username"] = "<font color=#03FCF3>" . $arr["username"] . "</font>";
break;
case 6:
$arr["username"] = "<font color=orange>" . $arr["username"] . "</font>";
break;
case 5:
$arr["username"] = "<font color=#FAFD01>" . $arr["username"] . "</font>";
break;
case 4:
$arr["username"] = "<font color=#FF00FF>" . $arr["username"] . "</font>";
break;
case 3:
$arr["username"] = "<font color=#03FC0F>" . $arr["username"] . "</font>";
break;
case 2:
$arr["username"] = "<font color=black>" . $arr["username"] . "</font>";
break;
case 1:
$arr["username"] = "<font color=#FA8072>" . $arr["username"] . "</font>";
break;
}
if ($CURUSER)
$forumusers .= "<a href=account-details.php?id=" . $arr["id"] . ">" . $arr["username"] . "</a></a>";
}
if (!$forumusers)
$forumusers = "There have been no active users in the last 15 minutes.";
?>
<br>
<table width=100% cellspacing=0 cellpadding=5><tr>
<td class="table_col1" align="left">Active Forum Simpsons</td></tr>
</tr><td class=table_col2>
<?=$forumusers?>
</td></tr>
</tr><td class=table_col1>
L