<?php
$menumark = 'notice_list';
switch ($act) {
	//#####################@ 公告列表 @#####################//
	case 'list':
		$cache_noticeclass = cache::get('noticeclass');
		$ad_list = $db->pe_selectall('ad', array('order by'=>'ad_order asc'), '*', array(5));

		//默认显示的第一个分类
		if (!$_g_noticeclass_id) {
			$cache_noticeclass_0 = current($cache_noticeclass);
			$_g_noticeclass_id = $cache_noticeclass_0['noticeclass_id'];		
		}

		$sqlwhere .= " and `noticeclass_id` = '{$_g_noticeclass_id}'";
		$sqlwhere .= " and (`user_level` = 0 or `user_level` = '{$_s_user_level}') order by `notice_state` desc, `notice_id` desc";
		$info_list = $db->pe_selectall('notice', $sqlwhere, '*', array(15, $_g_page));
		$seo = pe_seo('公告列表');
		include(pe_tpl('notice_list.html'));
	break;
	//#####################@ 公告内容 @#####################//
	default:
		$notice_id = intval($_g_id);
		$info = $db->pe_select('notice', array('notice_id'=>$notice_id));
		
		$db->pe_update('notice', array('notice_id'=>$notice_id), array('notice_clicknum'=>$info['notice_clicknum']+1));

		$seo = pe_seo($info['notice_name']);
		include(pe_tpl('notice_view.html'));
	break;
}
pe_result();
?>