This commit has been accessed 572 times via Git panel.
commit 8016bfb4c5f688649b03e9b7891af2b83c7d7427
tree 1b9af2540c4c990409f769ce053afa87cc97e07e
parent 6e9beff804ab94a9b50e801ce9893c93d487bcad
author Magie Antonio <magie@majcms.org> 1307995870 +0800
committer Magie Antonio <magie@majcms.org> 1307995870 +0800
Enable bi-directional reverse sort for categories
diff --git a/cat.php b/cat.php
index 1449e12..979ea7d 100644
--- a/cat.php
+++ b/cat.php
@@ -284,7 +284,17 @@ a:active {
echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, accessible to you only. Override per entry if needed.";
- echo "<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
+ echo "<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from ";
+
+ if (!file_exists("data/old.txt")) {
+
+ echo "oldest to newest";
+ }
+ else {
+ echo "newest to oldest";
+ }
+
+ echo " (reverse of default sort)<br>Deleting a category will unfile all its associated entries.</p>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td>";
diff --git a/index.php b/index.php
index c6ca03b..43a89ce 100644
--- a/index.php
+++ b/index.php
@@ -1898,7 +1898,14 @@ if ($maj_count_center_panels > 0) {
if (isset($maj_req_category) and !empty($maj_req_category)) {
if (file_exists("data/categories/$maj_req_category/book.txt")) {
- sort($maj_items);
+
+ if (!file_exists("data/old.txt")) {
+ sort($maj_items);
+ }
+ else {
+ rsort($maj_items);
+ }
+
reset($maj_items);
}
}
tree 1b9af2540c4c990409f769ce053afa87cc97e07e
parent 6e9beff804ab94a9b50e801ce9893c93d487bcad
author Magie Antonio <magie@majcms.org> 1307995870 +0800
committer Magie Antonio <magie@majcms.org> 1307995870 +0800
Enable bi-directional reverse sort for categories
diff --git a/cat.php b/cat.php
index 1449e12..979ea7d 100644
--- a/cat.php
+++ b/cat.php
@@ -284,7 +284,17 @@ a:active {
echo "<p><b>Category Management</b><br>Hiding a category will make it, and all associated entries, accessible to you only. Override per entry if needed.";
- echo "<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from oldest to newest.<br>Deleting a category will unfile all its associated entries.</p>";
+ echo "<br>Booking a category, for lack of a better term, will unconditionally display all associated entries from ";
+
+ if (!file_exists("data/old.txt")) {
+
+ echo "oldest to newest";
+ }
+ else {
+ echo "newest to oldest";
+ }
+
+ echo " (reverse of default sort)<br>Deleting a category will unfile all its associated entries.</p>";
echo "<table border=\"0\" cellspacing=\"1\" cellpadding=\"2\">";
echo "<tr><td>category id</td><td align=\"center\">title or description</td><td align=\"center\">hide</td>";
diff --git a/index.php b/index.php
index c6ca03b..43a89ce 100644
--- a/index.php
+++ b/index.php
@@ -1898,7 +1898,14 @@ if ($maj_count_center_panels > 0) {
if (isset($maj_req_category) and !empty($maj_req_category)) {
if (file_exists("data/categories/$maj_req_category/book.txt")) {
- sort($maj_items);
+
+ if (!file_exists("data/old.txt")) {
+ sort($maj_items);
+ }
+ else {
+ rsort($maj_items);
+ }
+
reset($maj_items);
}
}