aboutsummaryrefslogtreecommitdiff
path: root/_site/includes/articles
diff options
context:
space:
mode:
authorMinteck <46352972+Minteck@users.noreply.github.com>2021-06-30 00:07:21 +0200
committerMinteck <46352972+Minteck@users.noreply.github.com>2021-06-30 00:07:21 +0200
commit1f23d65f32e37d0c6d703951d6735c9926f8521c (patch)
tree57cd1399dd05a088b2a2fb3d6bdc5d0dc3a2961b /_site/includes/articles
parent5c5014a95ae79af4b052b5011e7d0c11d6eae6a6 (diff)
downloadunchainedtech-1f23d65f32e37d0c6d703951d6735c9926f8521c.tar.gz
unchainedtech-1f23d65f32e37d0c6d703951d6735c9926f8521c.tar.bz2
unchainedtech-1f23d65f32e37d0c6d703951d6735c9926f8521c.zip
Really done this time
Diffstat (limited to '_site/includes/articles')
-rw-r--r--_site/includes/articles/getlist.php10
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