properly sort the data by date/time

This commit is contained in:
Andreas Gohr
2020-11-09 16:29:42 +01:00
parent e012d9791d
commit c6a7e60bc5
3 changed files with 7 additions and 2 deletions

View File

@ -111,7 +111,9 @@ class helper_plugin_statdisplay_graph extends DokuWiki_Plugin {
$media = array();
$visitors = array();
foreach(array_keys((array) $data['hits'][$by]) as $idx) {
$keys = array_keys((array) $data['hits'][$by]);
sort($keys);
foreach($keys as $idx) {
$times[] = $idx;
$pages[] = $data['page'][$by][$idx]['count'];
$media[] = $data['media'][$by][$idx]['count'];

View File

@ -30,6 +30,7 @@ class helper_plugin_statdisplay_log extends DokuWiki_Plugin {
$this->logcache = getCacheName($this->getConf('accesslog'), '.statdisplay');
if(file_exists($this->logcache)) {
$this->logdata = unserialize(io_readFile($this->logcache, false));
ksort($this->logdata);
}
}

View File

@ -153,7 +153,9 @@ class helper_plugin_statdisplay_table extends DokuWiki_Plugin {
$this->head($this->getLang('traffic'), 2);
$this->R->tablerow_close();
foreach(array_keys((array) $data['hits'][$by]) as $idx) {
$keys = array_keys((array) $data['hits'][$by]);
sort($keys);
foreach($keys as $idx) {
$this->R->tablerow_open();
$this->hcell($idx);