Im using radipanel to create a staff panel for my website, but my mind has gone blank i have coded this to display the users currently online, but i completely forgot how to display the numbers of users online.
Heres the code i have to display the names of users online;
<?php
$query = $db->query( "SELECT DISTINCT user_id FROM sessions WHERE user_id != '0'" );
$i = 1;
while( $array = $db->assoc( $query ) ) {
$queryU = $db->query( "SELECT * FROM users WHERE id = '{$array['user_id']}'" );
$arrayU = $db->assoc( $queryU );
$queryUG = $db->query( "SELECT * FROM usergroups WHERE id = '{$arrayU['displaygroup']}'" );
$arrayUG = $db->assoc( $queryUG );
echo "<a href=\"core.profile?u={$arrayU['username']}\" style=\"color: #{$arrayUG['colour']}; font-weight: bold;\">";
echo $arrayU['username'];
$coverstatus2 = $arrayU['cover'];
if($coverstatus2 == 1) {
echo " <b style=\"color:#89c35c;\">+</b>";
}elseif($coverstatus2 == 2) {
echo " <b style=\"color:#c24641;\">-</b>";
}elseif($coverstatus2 == 0) {
echo "";
}
echo "</a>";
echo ( $i == $db->num( $query ) ) ? '' : ' ';
$i++;
}
?>
But how do i display the number?
For example what i want is
Users Online(Number here) Josh, Tom, Mark
So it would say Users Online (3)
So whats the code to display the number?
Thanks, Josh