From 380e95b06e58bddd5fd35b4f9fb1f005c06c6114 Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Thu, 10 May 2007 14:45:44 +0000 Subject: [PATCH] ~ Modified track_sort function so that it sorts directories properly. + Added , which should fix most international character problems. --- lib/global.php | 21 ++++++++++++++++++++- templates/default/index.html | 7 +++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/global.php b/lib/global.php index 9830c94..a7704aa 100644 --- a/lib/global.php +++ b/lib/global.php @@ -22,7 +22,26 @@ /* track number sorting function */ function track_sort($a, $b) { - return $a['Track'] - $b['Track']; + if ($a['directory'] && $b['directory']) { + if ($a['directory'] < $b['directory']) { + return -1; + } + elseif ($a['directory'] > $b['directory']) { + return 1; + } + else { + return 0; + } + } + elseif ($a['directory'] && !$b['directory']) { + return 1; + } + elseif (!$a['directory'] && $b['directory']) { + return -1; + } + else { + return $a['Track'] - $b['Track']; + } } /* setup some global vars */ diff --git a/templates/default/index.html b/templates/default/index.html index 766da34..72b8e78 100644 --- a/templates/default/index.html +++ b/templates/default/index.html @@ -1,7 +1,10 @@ + + - Neo MPC 0.2 + Neo MPC 0.2 +