1
0

/admin/ alephnote

This commit is contained in:
2018-01-27 00:28:32 +01:00
parent e1fec28368
commit acc6443b55
15 changed files with 263 additions and 76 deletions

View File

@@ -0,0 +1,26 @@
<?php if(count(get_included_files()) ==1) exit("Direct access not permitted.");
require_once (__DIR__ . '/../internals/database.php');
class AlephNoteStatistics
{
public static function getTotalUserCount()
{
return Database::sql_query_num('SELECT COUNT(*) FROM ms4_an_statslog WHERE NoteCount>0');
}
public static function getUserCountFromLastVersion()
{
return Database::sql_query_num('SELECT COUNT(*) FROM ms4_an_statslog WHERE NoteCount>0 AND Version = (SELECT Version FROM ms4_an_statslog ORDER BY Version DESC LIMIT 1)');
}
public static function getActiveUserCount($days)
{
return Database::sql_query_num('SELECT COUNT(*) FROM ms4_an_statslog WHERE NoteCount>0 AND LastChanged > NOW() - INTERVAL '.$days.' DAY');
}
public static function getAllActiveEntriesOrdered()
{
return Database::sql_query_assoc('SELECT * FROM ms4_an_statslog WHERE NoteCount>0 ORDER BY LastChanged DESC');
}
}

View File

@@ -0,0 +1,29 @@
<?php if(count(get_included_files()) ==1) exit("Direct access not permitted.");
require_once (__DIR__ . '/../internals/base.php');
require_once (__DIR__ . '/../extern/egh/ExtendedGitGraph.php');
class MikescherGitGraph
{
public static function create()
{
global $CONFIG;
$v = new ExtendedGitGraph(__DIR__ . '/../temp/egh_cache.bin', ExtendedGitGraph::OUT_SESSION, __DIR__ . '/../temp/egh_log{num}.log');
$v->addRemote('github-user', null, 'Mikescher', 'Mikescher');
//$v->addRemote('github-user', null, 'Mikescher', 'Sam-Development');
//$v->addRemote('github-repository', null, 'Mikescher', 'Anastron/ColorRunner');
$v->addRemote('gitea-repository', null, 'Mikescher', 'Mikescher/server-scripts');
$v->addRemote('gitea-repository', null, 'Mikescher', 'Mikescher/apache-sites');
$v->addRemote('gitea-repository', null, 'Mikescher', 'Mikescher/MVU_API');
$v->setColorScheme($CONFIG['egh_theme']);
$v->ConnectionGithub->setAPIToken($CONFIG['egh_token']);
$v->ConnectionGitea->setURL('https://gogs.mikescher.com');
return $v;
}
}