<div class="navh3">
	<div align="center">Member Stats</div>
</div>
<?php  
$active_length = 600;  // How many seconds to count a user as active until they access another page... 600 = 10 minutes
$query = yasDB_select("SELECT COUNT(user.id) AS count FROM user ");
$row = $query->fetch_array(MYSQLI_ASSOC);
echo ' <b>Members - </b>'.$row['count'].'<br>';  
$time = time()-$active_length;
$query2 = yasDB_select("SELECT membersonline.memberid, user.username FROM membersonline, user WHERE membersonline.memberid = user.id AND membersonline.timeactive >= $time");
echo '<b>Members Online- </b>'.$query2->num_rows.'<br/>';
if ($query2->num_rows > 0) {
	While ($row = $query2->fetch_array(MYSQLI_ASSOC)) {
		echo '<a  href="'.$setting['siteurl'].'showmember/ '.$row['memberid'].'.html" style="color:'.get_random_color().'"> '.$row['username'].'&nbsp;</a>';
	}
}
echo '<b><br/>New Members: <b><br/>';
$query = yasDB_select("SELECT id, username FROM user ORDER BY id DESC LIMIT 5");
while($row = $query->fetch_array(MYSQLI_ASSOC)) {
	echo '<a  href="'.$setting['siteurl'].'showmember/ '.$row['id'].'.html" style="color:'.get_random_color().'"> '.$row['username'].'&nbsp;</a>';
}
?>