<?php require("../../class/connect.php"); include("../../class/db_sql.php"); include("../../class/config.php"); include("../../class/class.php"); include("../../class/q_functions.php"); include "../".LoadLang("pub/fun.php"); //-----------------------------------------------自己添加的,用于动态页使用标签 include("../../class/t_functions.php"); function RepBB($listtext){ global $empire,$dbtbpre; $sql=$empire->query("select bq,funname from {$dbtbpre}enewsbq where isclose=0 order by bqid"); while($r=$empire->fetch($sql)) { $preg_str="/\[".$r[bq]."\](.+?)\[\/".$r[bq]."\]/is"; $ccout=preg_match_all($preg_str,$listtext,$listcard); if ($ccout){ for ($i=0;$i<$ccout;$i++){ //$listtext=preg_replace($preg_str,funzh($r[funname],$listcard[1][$i]),$listtext); $listtext=str_replace("[".$r[bq]."]".$listcard[1][$i]."[/".$r[bq]."]",funzh($r[funname],$listcard[1][$i]),$listtext); } } } return $listtext; } function funzh($funname,$setfun){ global $url,$pagetitle,$classid,$listpage; $setfun=split(",",$setfun); ob_start(); switch ($funname){ case "sys_GetClassNews": sys_GetClassNews($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6]); break; case "sys_GetClassNewsPic": sys_GetClassNewsPic($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6],$setfun[7]); break; case "sys_GetPicNews": sys_GetPicNews($setfun[0],$setfun[1],$setfun[2]); break; case "sys_GetMorePicNews": sys_GetMorePicNews($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6],$setfun[7]); break; case "sys_GetAd": sys_GetAd($setfun[0]); break; case "sys_GetVote": sys_GetVote($setfun[0]); break; case "sys_GetClassNewsText": sys_GetClassNewsText($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4]); break; case "sys_GetAutoPic": sys_GetAutoPic($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6],$setfun[7]); break; case "sys_GetEcmsInfo": sys_GetEcmsInfo($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6]); break; case "sys_GetSitelink": sys_GetSitelink($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4]); break; case "sys_ShowClass": sys_ShowClass($setfun[0]); break; case "sys_ShowMap": sys_ShowMap($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4]); break; case "sys_IncludeFile": sys_IncludeFile($setfun[0]); break; case "sys_ReadFile": sys_ReadFile($setfun[0]); break; case "sys_TotalData": sys_TotalData($setfun[0],$setfun[1],$setfun[2]); break; case "sys_FlashPixpic": sys_FlashPixpic($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6],$setfun[7]); break; case "sys_ShowSearchKey": sys_ShowSearchKey($setfun[0],$setfun[1],$setfun[2]); break; case "sys_ForSonclassData": sys_ForSonclassData($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6],$setfun[7],$setfun[8],$setfun[9],$setfun[10],$setfun[11]); break; case "sys_ShowClassByTemp": sys_ShowClassByTemp($setfun[0],$setfun[1],$setfun[2],$setfun[3]); break; case "sys_ShowLyInfo": sys_ShowLyInfo($setfun[0],$setfun[1],$setfun[2]); break; case "sys_ShowZtData": sys_ShowZtData($setfun[0],$setfun[1],$setfun[2]); break; case "sys_PhotoMorepage": sys_PhotoMorepage($setfun[0],$setfun[1],$setfun[2]); break; case "sys_EchoCheckboxFValue": sys_EchoCheckboxFValue($setfun[0],$setfun[1]); break; case "sys_GetOtherLinkInfo": sys_GetOtherLinkInfo($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5],$setfun[6]); break; case "sys_ShowPlInfo": sys_ShowPlInfo($setfun[0],$setfun[1],$setfun[2],$setfun[3],$setfun[4],$setfun[5]); break; case "user_belonging": user_belonging($setfun[0]); break; case "sys_ForShowSonClass": sys_ForShowSonClass($setfun[0],$setfun[1],$setfun[2],$setfun[3]); break; case "user_liandong": user_liandong($setfun[0],$setfun[1],$setfun[2]); break; case "user_changeurl": user_changeurl($setfun[0]); break; case "user_urlhtml": user_urlhtml($setfun[0],$setfun[1],$setfun[2]); break; default: break; } $string=@ob_get_contents(); ob_end_clean(); $string=RepListInfoVars($string,$url,$pagetitle,$classid,$listpage); return $string; } //-----------------------------------------------自己添加的,用于动态页使用标签 结束 //替换相关变量 function RepListInfoVars($listtemp,$url,$pagetitle,$classid,$listpage){ global $public_r,$class_r,$class_zr; $listtemp=str_replace("[!--news.url--]",$public_r[newsurl],$listtemp); $listtemp=str_replace("[!--newsnav--]",$url,$listtemp); $listtemp=str_replace("[!--pagetitle--]",$pagetitle,$listtemp); $listtemp=str_replace("[!--self.classid--]",$classid,$listtemp); $listtemp=str_replace("[!--show.listpage--]",$listpage,$listtemp); //$listtemp=str_replace("[!--list.pageno--]",$listpage,$listtemp); $listtemp=str_replace("[!--show.page--]",$listpage,$listtemp); //js $path=$public_r['newsurl'].'d/js/class/class'.$classid.'_'; $listtemp=str_replace("[!--hotnews--]","<script src=".$public_r[newsurl]."d/js/js/hotnews.js></script>",$listtemp); $listtemp=str_replace("[!--self.hotnews--]","<script src=".$path."hotnews.js></script>",$listtemp);
$listtemp=str_replace("[!--newnews--]","<script src=".$public_r[newsurl]."d/js/js/newnews.js></script>",$listtemp); $listtemp=str_replace("[!--self.newnews--]","<script src=".$path."newnews.js></script>",$listtemp);
$listtemp=str_replace("[!--goodnews--]","<script src=".$public_r[newsurl]."d/js/js/goodnews.js></script>",$listtemp); $listtemp=str_replace("[!--self.goodnews--]","<script src=".$path."goodnews.js></script>",$listtemp);
$listtemp=str_replace("[!--hotplnews--]","<script src=".$public_r[newsurl]."d/js/js/hotplnews.js></script>",$listtemp); $listtemp=str_replace("[!--self.hotplnews--]","<script src=".$path."hotplnews.js></script>",$listtemp);
$listtemp=str_replace("[!--firstnews--]","<script src=".$public_r[newsurl]."d/js/js/firstnews.js></script>",$listtemp); $listtemp=str_replace("[!--self.firstnews--]","<script src=".$path."firstnews.js></script>",$listtemp); return $listtemp; } $link=db_connect(); $empire=new mysqlquery(); $editor=1; //变量处理 $page=(int)$_GET['page']; $start=(int)$_GET['start']; $classid=(int)$_GET['classid']; if(empty($classid)) { printerror("ErrorUrl","history.go(-1)",1); } $search="&classid=".$classid; $page_line=16;//每页显示链接数 $line=$class_r[$classid]['lencord'];//每页显示记录数 $offset=$start+$page*$line;//总偏移量 $add=""; $tbname=$class_r[$classid][tbname]; $modid=$class_r[$classid][modid]; if(empty($tbname)||empty($modid)) { printerror("ErrorUrl","history.go(-1)",1); } //是否列表式 /* if(!($class_r[$classid][islist]||$class_r[$classid][islast])) { printerror("ErrorUrl","history.go(-1)",1); } */ if(!($class_r[$classid]['listtempid']||$class_r[$classid]['dtlisttempid'])) { printerror("ErrorUrl","history.go(-1)",1); } //系统模型 $ret_r=ReturnAddF($modid,2); //终极栏目 if($class_r[$classid][islast]) { $add.=" and classid='$classid'"; $have_class=0; } else { $where=ReturnClass($class_r[$classid][sonclass]); $add.=" and (".$where.")"; $have_class=1; } $pagetitle=$class_r[$classid]['classname']; //排序 if(empty($class_r[$classid][reorderf])) { $addorder=",newstime desc"; } else { $addorder=",".$class_r[$classid][reorderf]." ".$class_r[$classid][reorder]; } //附加项 if(!empty($ret_r['listandf'])&&$_GET['ph']==1) { $andor=$_GET['andor']=='or'?'or':'and'; $search.="&ph=1&andor=".$andor; $listandf=""; $andr=explode(",",$ret_r['listandf']); $count=count($andr); for($i=1;$i<$count-1;$i++) { $andval=$_GET[$andr[$i]]; if(!empty($andval)) { $doandor=empty($listandf)?'':' '.$andor.' '; if(empty($ret_r['setandf'])) { $listandf.=$doandor.$andr[$i]."='".RepPostVar2($andval)."'"; } else { $listandf.=$doandor.$andr[$i]." like '%".RepPostVar2($andval)."%'"; } $search.="&".$andr[$i]."=$andval"; } } if($listandf) { $add.=' and ('.$listandf.')'; } } //栏目导航 $url="<!--empire.url-->".ReturnClassLink($classid)."<!--empire.url-->"; //总数 $totalnum=(int)$_GET['totalnum']; if(empty($totalnum)) { $totalquery="select count(*) as total from {$dbtbpre}ecms_".$tbname." where checked=1".$add; $num=$empire->gettotal($totalquery); } else { $num=$totalnum; } $search.="&totalnum=".$num; $query="select * from {$dbtbpre}ecms_".$tbname." where checked=1".$add; $query.=" order by istop desc".$addorder.",id desc limit $offset,$line"; $sql=$empire->query($query); $listpage=page1($num,$line,$page_line,$start,$page,$search); //取得模板 $listtempid=$class_r[$classid]['dtlisttempid']?$class_r[$classid]['dtlisttempid']:$class_r[$classid]['listtempid']; $tempr=$empire->fetch1("select temptext,subnews,listvar,rownum,showdate,modid,subtitle from ".GetTemptb("enewslisttemp")." where tempid='".$listtempid."'"); //公共变量 if($public_r['searchtempvar']) { $tempr[temptext]=ReplaceTempvar($tempr[temptext]); } $listtemp=RepListInfoVars($tempr[temptext],$url,$pagetitle,$classid,$listpage); $rownum=$tempr[rownum]; if(empty($rownum)) {$rownum=1;} $formatdate=$tempr[showdate]; $subnews=$tempr[subnews]; $subtitle=$tempr[subtitle]; $modid=$tempr[modid]; $listvar=$tempr[listvar]; //取得列表模板 $list_exp="[!--empirenews.listtemp--]"; $list_r=explode($list_exp,$listtemp); $listtext=$list_r[1]; $no=$offset; $changerow=1; while($r=$empire->fetch($sql)) { //替换列表变量 $repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$ret_r); $listtext=str_replace("<!--list.var".$changerow."-->",$repvar,$listtext); $changerow+=1; //超过行数 if($changerow>$rownum) { $changerow=1; $string.=$listtext; $listtext=$list_r[1]; } $no++; } //多余数据 if($changerow<=$rownum&&$listtext<>$list_r[1]) { $string.=$listtext; } $string=$list_r[0].$string.$list_r[2]; //-------------------------------------修改支持标签 $string=RepBB($string); //$string=RepListInfoVars($string,$url,$pagetitle,$classid,$listpage); //-------------------------------------修改结束 db_close(); $empire=null; echo stripSlashes($string); ?>
|
www.z0791.com 南昌都市网
|
|