diff options
Diffstat (limited to '_site/includes/articles/getlist.php')
-rw-r--r-- | _site/includes/articles/getlist.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/_site/includes/articles/getlist.php b/_site/includes/articles/getlist.php index e3947f2..e82a192 100644 --- a/_site/includes/articles/getlist.php +++ b/_site/includes/articles/getlist.php @@ -2,7 +2,7 @@ $listGetTimeout = 0; -function getArticlesList() { +function getArticlesList($ordered = true) { $listGetStart = new DateTime("now"); global $Parsedown; global $listGetTimeout; @@ -24,6 +24,7 @@ function getArticlesList() { "cover" => null, "extract" => "" ]; + $list[$id]["id"] = $id; $propertiesMode = false; $propertiesDone = false; @@ -91,5 +92,12 @@ function getArticlesList() { $listGetTimeoutA = $listGetStart->diff($listGetEnd); $listGetTimeout = $listGetTimeoutA->f; + if ($ordered) { + usort($list, function($a, $b) { + return strtoupper($a['date']) <=> strtoupper($b['date']); + }); + $list = array_reverse($list); + } + return $list; }
\ No newline at end of file |