*** BlogChanges.php.org 2004-01-23 14:24:17.000000000 +0900 --- BlogChanges.php 2004-01-23 14:32:10.000000000 +0900 *************** *** 26,40 **** $rule="/^($date\d*)".'_2e('.join('|',$blogs).')$/'; $logs=array(); if (!$date) $limit=10; else $limit=30; - #print $limit; $handle = @opendir($DBInfo->cache_dir."/blogchanges"); if (!$handle) return array(); ! while (($file = readdir($handle)) && $limit > 0) { $fname=$DBInfo->cache_dir."/blogchanges/".$file; if (is_dir($fname)) continue; if (preg_match($rule,$file,$match)) { $datestamp=$match[1]; $blog=$match[2]; --- 26,51 ---- $rule="/^($date\d*)".'_2e('.join('|',$blogs).')$/'; $logs=array(); + if (!$date) $limit=10; else $limit=30; #print $limit; + $handle = @opendir($DBInfo->cache_dir."/blogchanges"); if (!$handle) return array(); ! while (($file = readdir($handle)) !== false) { $fname=$DBInfo->cache_dir."/blogchanges/".$file; if (is_dir($fname)) continue; + $filelist[] = $file; + } + closedir($handle); + + rsort($filelist); + + while ((list($key, $file) = each ($filelist)) && $limit > 0) + { + #echo "$file
"; if (preg_match($rule,$file,$match)) { + $fname=$DBInfo->cache_dir."/blogchanges/".$file; $datestamp=$match[1]; $blog=$match[2];