示例#1
0
 function get_rc_blogs($date, $pages = array())
 {
     global $DBInfo;
     $blogs = array();
     $changecache = new Cache_text('blogchanges', array('hash' => ''));
     $files = array();
     $changecache->_caches($files);
     if (!$date) {
         $date = Blog_cache::get_daterule();
     }
     if (!$pages) {
         $pagerule = '.*';
     } else {
         $pages = array_map('_preg_search_escape', $pages);
         $pagerule = implode('|', $pages);
     }
     $rule = "@^({$date}\\d*)\\.({$pagerule})\$@";
     foreach ($files as $file) {
         $pagename = $DBInfo->keyToPagename($file);
         if (preg_match($rule, $pagename, $match)) {
             $blogs[] = $match[2];
         }
     }
     return array_unique($blogs);
 }