Add a statistics page that displays the number of users, active users, comments and applications.
This commit is contained in:
committed by
Jeremy Newman
parent
3b09de0902
commit
8ccc06ba4b
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user