• R/O
  • SSH
  • HTTPS

ogup: 提交


Commit MetaInfo

修訂52 (tree)
時間2022-10-26 06:02:36
作者mateuszviste

Log Message

the list of servers is sorted

Change Summary

差異

--- trunk/frontend/list/gophermap.php (revision 51)
+++ trunk/frontend/list/gophermap.php (revision 52)
@@ -3,7 +3,7 @@
33 //
44 // OGUP servers list gophermap
55 //
6-// Copyright (C) 2019-2021 Mateusz Viste
6+// Copyright (C) 2019-2022 Mateusz Viste
77 //
88
99
@@ -32,6 +32,7 @@
3232 if (! $db) {
3333 echo "3FAILED TO OPEN DB FILE\n";
3434 } else {
35+ $buff = array();
3536 foreach ($db as $item) {
3637 if ($item['port'] != 70) {
3738 $nicename = $item['host'] . ':' . $item['port'];
@@ -38,8 +39,12 @@
3839 } else {
3940 $nicename = $item['host'];
4041 }
41- echo "1{$nicename}\t\t{$item['host']}\t{$item['port']}\n";
42+ //echo "1{$nicename}\t\t{$item['host']}\t{$item['port']}\n";
43+ $buff[] = "1{$nicename}\t\t{$item['host']}\t{$item['port']}";
4244 }
45+ // sort the output buffer and... output it
46+ sort($buff);
47+ foreach ($buff as $line) echo $line . "\n";
4348 fclose($fh);
4449 }
4550
Show on old repository browser