<?php

//侧边 最新文章;
$a=intval($a);
$key='sidebar_new_ijfo_'.MID;

if(cache_exists($key)){
    $arr=$cache[$key];

}else{

$arr=array();
$rs = $db->query('select article. post_id,article.menu_id,article.post_time,title,hits,doc from ('.PF.'article as article left join '.PF.
    'posts as post on article.post_id=post.id) left join '.PF.'user as user on post.authorid=user.id order by post_time desc LIMIT 0,'.$a);
while($row = $db->fetch_array($rs)) {    
    $arr[$row['post_id']]=array(
    'title'=>unserialize($row['title']),
    'hits'=>$row['hits'],
	'menu_id'=>$row['menu_id'],
	'doc'=>unserialize($row['doc']),
	'post_time'=>$row['post_time'],
    );
    
}

set_cache($key,$arr,20);
}


//if(empty($arr)) return;

foreach($arr as $k=>$v){
	echo '<dt><a href="'.url(RPG.'article/show/'.$v['menu_id'].'/'.$k.'/').'">',html(xstr(xlang($v['title']),12)),'</a></dt><dd><span class="date">',date('m. d',$v['post_time']),'</span> ',html(xstr(xlang($v['doc']),40)),'</dd>';
}

return;
?>