Jeśli ktoś ma anonimowość, może chcieć aby anonimowi użytkownicy nie byli wyświetlani na liście, ale po prostu jako "oraz X anonimowych użytkowników"
$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
$result = mysql_query("SELECT SUM(last_access >= $dt) AS totalol FROM users") or sqlerr(__FILE__, __LINE__);
while ($row = mysql_fetch_array ($result))
{
$totalonline = $row["totalol"];
}
$anon = 0;
$dt = gmtime() - 180;
$dt = sqlesc(get_date_time($dt));
$res = mysql_query("SELECT id, username, class, donor, warned, anonymous FROM users WHERE last_access >= $dt ORDER BY username") or print(mysql_error());
while ($arr = mysql_fetch_assoc($res))
{
if ($arr['anonumous'] == 'yes')
{
$anons++;
Continue;
}
if ($activeusers) $activeusers .= ",\n";
switch ($arr["class"])
{
case UC_SYSOP:
$arr["username"] = "<font color=#9900cc>" . $arr["username"] . "</font>";
break;
case UC_ADMINISTRATOR:
$arr["username"] = "<font color=#FF0000>" . $arr["username"] . "</font>";
break;
case UC_MODERATOR:
$arr["username"] = "<font color=#009900>" . $arr["username"] . "</font>";
break;
case UC_UPLOADER:
$arr["username"] = "<font color=#0000FF>" . $arr["username"] . "</font>";
break;
case UC_VIP:
$arr["username"] = "<font color=#FF8C00>" . $arr["username"] . "</font>";
break;
case UC_POWER_USER:
$arr["username"] = "<font color=#FFD700>" . $arr["username"] . "</font>";
break;
}
$donator = $arr["donor"] === "yes";
if ($donator)
$activeusers .= "<nobr>";
$warned = $arr["warned"] === "yes";
if ($warned)
$activeusers .= "<nobr>";
if ($CURUSER)
$activeusers .= "<a href=userdetails.php?id={$arr["id"]}><b>{$arr["username"]}</b></a>";
else
$activeusers .= "<b>{$arr["username"]}</b>";
if ($donator)
$activeusers .= "<img src={$pic_base_url}star.gif alt='Donated {$$arr["donor"]}'></nobr>";
if ($warned)
$activeusers .= "<img src={$pic_base_url}warned.gif alt='Warned {$$arr["warned"]}'></nobr>";
}
if ($anons>0)
{
if ($activeusers) $activeusers .= ",\n oraz ";
$activeusers += . $anons . ' anonimowych uzytkownikow';
}
if (!$activeusers)
$activeusers = "There have been no active users in the last 5 minutes.";