tazwok rev 393
web/index.php: sort broken list
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Thu Mar 03 23:33:44 2011 +0100 (2011-03-03) |
parents | eee0b326a1de |
children | 13e14fe449a3 |
files | web/index.php |
line diff
1.1 --- a/web/index.php Thu Mar 03 21:29:18 2011 +0100 1.2 +++ b/web/index.php Thu Mar 03 23:33:44 2011 +0100 1.3 @@ -12,15 +12,15 @@ 1.4 function include_and_link($file) 1.5 { 1.6 global $log_dir, $version; 1.7 - if (($fp = fopen($file,"r")) === false) return; 1.8 - while (($pkg = fgets($fp)) !== false) { 1.9 - $pkg = chop($pkg); 1.10 + if (($str = file_get_contents($file)) === FALSE) return; 1.11 + $lines = explode("\n",$str); 1.12 + sort($lines); 1.13 + foreach ($lines as $pkg) { 1.14 if (file_exists("$log_dir/$pkg.html")) 1.15 echo "<a href=\"log.php?version=$version&package=". 1.16 urlencode($pkg)."\" target=\"_blank\">$pkg</a>\n"; 1.17 else echo "$pkg\n"; 1.18 } 1.19 - fclose($fp); 1.20 } 1.21 1.22 function list_last_cooked($dir, $suffix)