require("inc/php_inc.php");
require("inc/Smarty-2.6.26/libs/Smarty.class.php");
require("uio_pubdata.php");
$template_file = "lay_news_view.html";
//--读取产品列表
$pid=getQueryInt("id",0);
$sql="select * from @@@news where id=$pid";
$rs=query($sql);
if( BOF($rs) )
redirect(FOLDER."error.php?id=1");
$rows=fetch($rs);
$var["title"] = $rows["name"] . " - " . $var["title"];
//--生成HTML模块
//--------------
$nclassid=$rows["classid"];
$str_disp = (string)decbin($rows["disp"]) ;
$rows["showComment"] = substr( $str_disp , 1 ,1) ;
$rows["addComment"] = substr( $str_disp , 0 ,1) ;
free($rs);
$arr_url=split( ',' , $nclass[$nclassid]["url"] );
$var["str_url"]="{$cfg['lg']['home']}";
for($index=0;$index" . $nclass[$arr_url[$index]]["name"] . "" ;
}
$var["str_url"] .= " " . $cfg["split_uri"] . " " . $rows["name"] ;
$var["str_url_2"]=$rows["name"];
$arrcontent = explode("
",$rows["content"]);
$var["rewriteurl"]= getRewritePre() . makeRewrite($rows["name"]) . "-n$pid" ;
$var["pageurl"] = "news-view.php?id=$pid";
$pagenow = getQueryInt("page",1);
$recordcount = count( $arrcontent );
$pagetotal = count( $arrcontent );
$pagenow = $pagenow >$pagetotal? $pagetotal : $pagenow;
$pagenow = $pagenow <1? 1 : $pagenow;
if($pagenow>=2)
$rows["name"] .= " ($pagenow) " ;
loadPage($pagenow,$pagetotal,1,$recordcount,$var) ;
$rows["pagecontent"] = $arrcontent[$pagenow-1] ;
$var["n"]=$rows;
$var["pid"]=$pid;
$condition="where id=$pid";
$param=array();
$param["hits"]="@hits+1";
$sql=updateSQL($param,"@@@news",$condition);
query($sql);
//--- 读取分类的SEO模板
$sql = "select * from `@@@seo` where id=5";
$rs = query($sql);
while($seorows=fetch($rs))
{
$tpl_seo_title = $seorows["title"];
$tpl_seo_keywords = $seorows["keywords"];
$tpl_seo_descript = $seorows["descript"];
}
$arr_seo_key[0] = "{VAR_shopname}"; $arr_seo_value[0] = $config[63] ;
$arr_seo_key[1] = "{VAR_ncatename}"; $arr_seo_value[1] = $nclass[$nclassid]["name"] ;
$arr_seo_key[3] = "{VAR_nname}"; $arr_seo_value[3] = $rows["name"] ;
$arr_seo_key[2] = "{VAR_ncatepath}";
for($index=0;$index