From b77a9f36b40444325ac91800e19ffa4308b4d167 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Tue, 25 Oct 2016 09:29:18 +0000 Subject: [PATCH] changed the sort order of file list --- codepot/src/codepot/views/file_home.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index edfbccfb..b0bdf932 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -309,17 +309,21 @@ $this->load->view ( if ($q != 0) return $q; } - return ($cx > $cy)? -1: - ($cx < $cy)? 1: 0; + return ($cx > $cy)? 1: + ($cx < $cy)? -1: 0; } function comp_files ($a, $b) { //$cmp = version_compare ($b->tag, $a->tag); - $cmp = comp_tag ($b->tag, $a->tag); + $cmp = comp_tag ($b->tag, $a->tag); // descending if ($cmp == 0) { - $cmp = strcmp ($a->name, $b->name); + $cmp = comp_tag ($a->name, $b->name); // ascending + if ($cmp == 0) + { + $cmp = strcmp ($a->filename, $b->filename); + } } return $cmp; }