readCache('record');
$output = '';
foreach($record_cache as $value){
$output .= '
'.$value['record'].'('.$value['lognum'].')
'.displayRecordItem($value['date']).'';
}
$output = '';
return $output;
}
function displayRecordItem($record){
if (preg_match("/^([\d]{4})([\d]{2})$/", $record, $match)) {
$days = getMonthDayNum($match[2], $match[1]);
$record_stime = emStrtotime($record . '01');
$record_etime = $record_stime + 3600 * 24 * $days;
} else {
$record_stime = emStrtotime($record);
$record_etime = $record_stime + 3600 * 24;
}
$sql = "and date>=$record_stime and date<$record_etime order by top desc ,date desc";
$result = archiver_db($sql);
return $result;
}
function displaySort(){
global $CACHE;
$sort_cache = $CACHE->readCache('sort');
$output = '';
foreach($sort_cache as $value){
$output .= ''.$value['sortname'].'('.$value['lognum'].')
'.displaySortItem($value['sid']).'';
}
$output = '';
return $output;
}
function displaySortItem($sortid){
$sql = "and sortid=$sortid order by date desc";
$result = archiver_db($sql);
return $result;
}
function archiver_db($condition = ''){
$DB = MySql::getInstance();
$sql = "SELECT gid, title, comnum, views FROM " . DB_PREFIX . "blog WHERE type='blog' and hide='n' $condition";
$result = $DB->query($sql);
$output = '';
while ($row = $DB->fetch_array($result)) {
$log_url = Url::log($row['gid']);
$output .= ''.$row['title'].' ('.$row['comnum'].'/'.$row['views'].')';
}
$output = empty($output) ? '暂无日志' : $output;
$output = ''.$output.'
';
return $output;
}
?>