From b368b1e520ec845dbca1dd942cb3c58be0da516a Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Mon, 24 May 2010 13:16:01 +0000 Subject: [PATCH] * changed the string comparison callback for usort * changed the date and time display in log pages --- codepot/src/codepot/views/file_home.php | 9 ++++----- codepot/src/codepot/views/log.php | 6 ++++-- codepot/src/codepot/views/project_home.php | 3 ++- codepot/src/codepot/views/site_home.php | 3 ++- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/codepot/src/codepot/views/file_home.php b/codepot/src/codepot/views/file_home.php index 29fbaf5d..729514a1 100644 --- a/codepot/src/codepot/views/file_home.php +++ b/codepot/src/codepot/views/file_home.php @@ -51,13 +51,12 @@ else { function comp_files ($a, $b) { - if ($a->tag == $b->tag) + $cmp = strcmp ($b->tag, $a->tag); + if ($cmp == 0) { - return ($a->name > $b->name)? -1: - ($a->name < $b->name)? 1: 0; + return strcmp ($a->name, $b->name); } - - return ($a->tag < $b->tag)? 1: -1; + return $cmp; } usort ($files, 'comp_files'); diff --git a/codepot/src/codepot/views/log.php b/codepot/src/codepot/views/log.php index a28f43bf..edcee635 100644 --- a/codepot/src/codepot/views/log.php +++ b/codepot/src/codepot/views/log.php @@ -162,8 +162,10 @@ $this->load->view ( { $code = $log['message']; - $date = substr($code['time'], 0, 10); - $time = substr($code['time'], 11, 5); + //$date = substr($code['time'], 0, 10); + //$time = substr($code['time'], 11, 5); + $date = date ('Y-m-d', strtotime($log['createdon'])); + $time = date ('h:i', strtotime($log['createdon'])); } else { diff --git a/codepot/src/codepot/views/project_home.php b/codepot/src/codepot/views/project_home.php index becb7ef6..68f4015c 100644 --- a/codepot/src/codepot/views/project_home.php +++ b/codepot/src/codepot/views/project_home.php @@ -105,7 +105,8 @@ $this->load->view ( print ''; print ''; - print substr($x['time'], 5, 5); + //print substr($x['time'], 5, 5); + print date ('m-d', strtotime($log['createdon'])); print ''; print ''; print anchor ( diff --git a/codepot/src/codepot/views/site_home.php b/codepot/src/codepot/views/site_home.php index 11b39540..029e7c79 100644 --- a/codepot/src/codepot/views/site_home.php +++ b/codepot/src/codepot/views/site_home.php @@ -101,7 +101,8 @@ foreach ($latest_projects as $project) print ''; print ''; - print substr($x['time'], 5, 5); + //print substr($x['time'], 5, 5); + print date ('m-d', strtotime($log['createdon'])); print ''; print ''; /*