fetch1("select * from {$dbtbpre}enewstags where tagid='".$tagid."' limit 1"); } else { $zr=$empire->fetch1("select * from {$dbtbpre}enewstags where tagname='".urldecode($filename)."' or filename='".urlencode($filename)."' limit 1"); } if(!$zr) { header('HTTP/1.1 404 Not Found'); header("status: 404 Not Found"); require(dirname(__FILE__) . '/404b.html'); exit(); } $thisurl='/key_'.$zr['tagid'].'/~page~/'; $GLOBALS['zr']=$zr; $start=0; $page=$page?$page:1; $GLOBALS['page']=$page; //每页显示记录?$line=20; $page_line=16;//每页显示链接?$offset=($page-1)*$line;//总偏移量 $GLOBALS['line']=$line; $GLOBALS['offset']=$offset; $num=$empire->gettotal("select count(*) as total from {$dbtbpre}ecms_news p left join {$dbtbpre}enewstagsdata z on p.id=z.id where z.tagid='".$zr['tagid']."'"); $GLOBALS['num']=$num; //分页 $listpage=RewritePage($num,$line,$page_line,$start,$page,$thisurl); $tempid=1; $pagetitle=htmlspecialchars($public_r['sitename']); $pagekey=htmlspecialchars($pr['sitekey']); $pagedes=htmlspecialchars($pr['siteintro']); $url="".$fun_r['index']."";//栏目导航 $indextemp=GetClassTemp($tempid);//取得模板 $string=DtNewsBq('tag_'.$tempid,$indextemp,0); $string=str_replace('[!--newsnav--]',$url,$string);//位置导航 $string=ReplaceSvars($string,$url,0,$pagetitle,$pagekey,$pagedes,$addr,0); $string=str_replace('[!--page.stats--]','',$string); $string=str_replace('[!--show.listpage--]',$listpage,$string); $string=stripSlashes($string); echo $string; db_close(); $empire=null; ?>