include("./include/config.php");
	include("./include/smarty.php");
	
	
	$tpl="news.html";
	$cacheId="";
	smarty_start($smarty,$tpl,$cacheId);
	
	
	$header_title = array();
	$header_title[] = $cfg_web_title;
	
	
	if(!empty($_GET["id"])){
		$id=intval($_GET["id"]);
		$strSQL="select a.*,b.sortName from [#TAB]news as a 
					left join [#TAB]sort as b on(a.sortid=b.id)
				where a.id='$id' limit 1";
		$mysql->do_query($strSQL);
		if($mysql->rownum==0){
			page_redirect("未找到该信息!请正确输入!",__dir_rel_web);
			exit;
		}
		
		$mod=$mysql->do_fetch_row(1);
		$mysql->do_query("update [#TAB]news set viewtimes=viewtimes+1 where id='$id' limit 1");
		
		$smarty->assign("mod",$mod);
		
		$header_title[] = $mod['sortName'];
		$header_title[] = $mod['news_title'];
		
	}
	else{
		page_redirect($cfg_msg["err_request"],__dir_rel_web);
		exit;
	}
	
	
	define("MY_PRO_SORT",true);
	include("./inc.php");
	
	//导航栏
	$loc=array();
	$loc[]="首页";
	$loc[]="".$mod["sort_name"]."";
	$loc[]=$mod["news_title"];
	
	$smarty->assign("location",implode(" > ",$loc));
	
	$sortid = array_search('帮助中心',$my_newsSortAry);
	if($sortid>0){
		
		$strSQL="select id,sortName from [#TAB]sort where pid = '$sortid' order by pos asc,id asc";
		$mysql->do_query($strSQL);
		$help_category=array();
		while($row=$mysql->do_fetch_row(1)){
			$help_category[$row["id"]]=$row["sortName"];
		}
		
		
		if($mysql->rownum){
			$smarty->assign("help_category",$help_category);
			
			$help_category_id = array_keys($help_category);
			$sql = "select id,news_title,sortid from [#tab]news where sortid in (" . implode(",", $help_category_id) . ") order by id asc";
			$mysql->do_query($sql);
			$helps=array();
			while($row=$mysql->do_fetch_row(1)){
				$helps[$row["sortid"]][]=$row;
			}
			$smarty->assign("helps",$helps);
		}
		
		
	}
	
	$smarty->assign("cfg_web_title",implode("_",array_reverse($header_title)));
	
	smarty_end($smarty,$tpl,$cacheId);
	include("./include/footer.php");
?>