Add a statistics page that displays the number of users, active users, comments and applications.

This commit is contained in:
Chris Morgan
2004-12-01 22:26:50 +00:00
committed by Jeremy Newman
parent 3b09de0902
commit 8ccc06ba4b
4 changed files with 50 additions and 5 deletions

View File

@@ -412,4 +412,20 @@ function getNotifyEmailAddressList($appId, $versionId)
return $retval;
}
/* Get the number of users in the database */
function getNumberOfUsers()
{
$result = mysql_query("SELECT count(*) as num_users FROM user_list;");
$row = mysql_fetch_object($result);
return $row->num_users;
}
/* Get the number of active users within $days of the current day */
function getActiveUsersWithinDays($days)
{
$result = mysql_query("SELECT count(*) as num_users FROM user_list WHERE stamp >= 'NOW() - $days';");
$row = mysql_fetch_object($result);
return $row->num_users;
}
?>