From 9fd372c6d06810d1a06ed7b70e2b98faea8c3ac1 Mon Sep 17 00:00:00 2001 From: Junior Date: Mon, 9 Nov 2026 19:11:57 -0500 Subject: [PATCH] A few small efficiency cleanups and removal of dead references --- ajax/getfoldercontents.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ajax/getfoldercontents.php b/ajax/getfoldercontents.php index ba0e2a3..886b00f 100644 --- a/ajax/getfoldercontents.php +++ b/ajax/getfoldercontents.php @@ -20,15 +20,14 @@ if ( !$validated ) { # usort function for sorting by array's "mtime" # Return 1 or -1 in reverse order so newest is first function compareDates($a, $b) { - if ( $a["mtime"] == $b["mtime"] ) return 0; - return ($a["mtime"] < $b["mtime"]) ? 1 : -1; + return $b["mtime"] <=> $a["mtime"]; } # usort function for sorting by array's "name" # Does "natural" sorting so "28 Days Later" comes before "2099 Hulk" function compareNames($a, $b) { if ( $a["name"] == $b["name"] ) return 0; - return strnatcmp($a["name"], $b["name"]); + return strnatcasecmp($a["name"], $b["name"]); } @@ -79,7 +78,7 @@ foreach ( $entries as $entry ) { $info["read"] = false; $readclass = ""; } - $info["div"] = "
"; + $info["div"] = "
"; $info["div"] .= "
{$info["comname"]}
"; $folders[] = $info; } else { @@ -109,7 +108,7 @@ foreach ( $entries as $entry ) { $info["div"] .= ""; $info["div"] .= "
{$info["comname"]}
"; $issues[] = $info; - $thumbfile = "../" . THUMBSDIR . $data['compath'] . "/" . $info['comname'] . ".jpg"; + //$thumbfile = "../" . THUMBSDIR . $data['compath'] . "/" . $info['comname'] . ".jpg"; } } if ( isset($info["thumburl"]) && !file_exists("../" . $info["thumburl"]) ) {