2018-01-27 00:28:32 +01:00
|
|
|
<?php if(count(get_included_files()) ==1) exit("Direct access not permitted.");
|
|
|
|
|
|
|
|
require_once (__DIR__ . '/../internals/database.php');
|
|
|
|
|
|
|
|
class AlephNoteStatistics
|
|
|
|
{
|
|
|
|
public static function getTotalUserCount()
|
|
|
|
{
|
2018-02-03 14:53:30 +01:00
|
|
|
return Database::sql_query_num('SELECT COUNT(*) FROM an_statslog WHERE NoteCount>0');
|
2018-01-27 00:28:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function getUserCountFromLastVersion()
|
|
|
|
{
|
2018-02-12 21:36:54 +01:00
|
|
|
return Database::sql_query_num('SELECT COUNT(*) FROM an_statslog WHERE NoteCount>0 GROUP BY Version ORDER BY INET_ATON(Version) DESC LIMIT 1');
|
2018-01-27 00:28:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function getActiveUserCount($days)
|
|
|
|
{
|
2018-02-03 14:53:30 +01:00
|
|
|
return Database::sql_query_num('SELECT COUNT(*) FROM an_statslog WHERE NoteCount>0 AND LastChanged > NOW() - INTERVAL '.$days.' DAY');
|
2018-01-27 00:28:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static function getAllActiveEntriesOrdered()
|
|
|
|
{
|
2018-02-03 14:53:30 +01:00
|
|
|
return Database::sql_query_assoc('SELECT * FROM an_statslog WHERE NoteCount>0 ORDER BY LastChanged DESC');
|
2018-01-27 00:28:32 +01:00
|
|
|
}
|
|
|
|
}
|