Location: PHPKode > projects > MegaBB > include/view_active.php
<?
if(!defined('TBL_ACTIVE_USERS')) {
  die("Error processing page");
}

$q = "SELECT username FROM ".TBL_ACTIVE_USERS
    ." ORDER BY timestamp DESC,username";
$result = $database->query($q);
/* Error occurred, return given name by default */
$num_rows = mysql_numrows($result);
if(!$result || ($num_rows < 0)){
   echo "Error displaying info";
}
else if($num_rows > 0){
   /* Display active users, with link to their info */
   echo "<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">\n";
   echo "<tr><td><font size=\"2\">\n";
   for($i=0; $i<$num_rows; $i++){
      $uname = mysql_result($result,$i,"username");

      echo "<a href=\"userinfo.php?user=$uname\"><input style=\"color:white; background-color:#777; border:1px solid; border-color: #888 #888 #555 #555;\" type=\"button\" value=\"$uname\"/></a>";
   }
   echo "</font></td></tr></table><br>\n";
}
?>
Return current item: MegaBB