Mercurial > hg > batmud > maputils
changeset 2278:3293678b598b
Use a custom comparision function for location sorting.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 02 Apr 2020 21:57:55 +0300 |
parents | 6c52e4acac3f |
children | b7af4d7298bd |
files | www/loc.php |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/www/loc.php Sat Mar 28 23:25:40 2020 +0200 +++ b/www/loc.php Thu Apr 02 21:57:55 2020 +0300 @@ -59,6 +59,11 @@ } +function locCompare($va, $vb) +{ + return strcmp($va["name"], $vb["name"]); +} + // // Initialization @@ -311,7 +316,7 @@ if (count($alphaLocs) <= 0) continue; $letter = strtoupper($alpha); - asort($alphaLocs, SORT_STRING); + uasort($alphaLocs, "locCompare"); echo "<h3 class=\"alpha\"><a id=\"ch".$letter."\"></a>".$letter."</h3>\n".