欢迎光临 - 我的站长站,本站所有资源仅供学习与参考,禁止用于商业用途或从事违法行为!

帝国cms插件

帝国CMS7.5自定义栏目/信息伪静态插件
2018-08-27 我的站长站

帝国CMS7.5自定义栏目/信息伪静态插件

  • 插件编号:85
  • 插件分类:帝国cms插件
  • 点击次数:2129
  • 插件编码:UTF
  • 插件版本:ecms7.5
  • 插件大小:9.92 KB
  • 下载权限:普通 / VIP
  • 插件售价:免费下载
  • 下载次数:196
立即下载

纯绿色不影响帝国原有伪静态、静态和动态等功能设置。栏目目录伪静态实现,而不是生成静态的。

帝国CMS7.5自定义栏目/信息伪静态插件说明

1:栏目要选静态-不生成
2:内容页存放目录--栏目目录,内容页目录存放形式--不设置目录,(有利SEO,方便匹配栏目ID)
3:内容页文件命名形式 不能是目录,但是支持信息文件名的修改,URL也能很好看
4:栏目目录和信息文件名是英文或数字(栏目目录建议英文或英文开头,“-_”上下划线留着给别的东西用吧避免冲突如其它伪静态,避免冲突)
********为了通用只能遵守上述要求,有这些特殊需求自己改去*********
栏目设置截图演示:

帝国CMS7.5自定义栏目/信息伪静态插件

伪静态规则

#栏目
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(d/|e/|html/|images/|s/|search/|skin/|t/)
RewriteRule ^([0-9a-zA-Z/]+)/(|index.html|index_[0-9]+.html)$ /e/action/list.php?classid=$1&page=$2
#内容
RewriteCond %{QUERY_STRING} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(d/|e/|html/|images/|s/|search/|skin/|t/)
RewriteRule ^([0-9a-zA-Z/]+)/([0-9a-zA-Z]+)([_0-9]*).html$ /e/action/show.php?classid=$1&id=$2&page=$3

在/e/action/下增加如下php文件:
列表list.php代码

<?php
require('../class/connect.php');
require('../class/db_sql.php');
require('../class/functions.php');
require('../class/t_functions.php');
require('../data/dbcache/class.php');
require LoadLang('pub/fun.php');
$link=db_connect();
$empire=new mysqlquery();
$editor=1;
$classid=RepPostStr($_GET['classid']);//修改过滤方式--yognlan
//获取真实classid--yognlan
if(!is_numeric($classid)){
foreach ($class_r as $val){
foreach ($val as $val2){
if($classid==$val['classpath']){
$classid=$val['classid'];
break;
}
}
}
}
if(empty($classid))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$search='&classid='.$classid;
$tbname=$class_r[$classid][tbname];
$mid=$class_r[$classid][modid];
if(empty($tbname)||empty($mid)||InfoIsInTable($tbname))
{
printerror("ErrorUrl","history.go(-1)",1);
}
$cr=$empire->fetch1("select classid,classpagekey,intro,classimg,cgroupid,islist,classtempid,listdt,bdinfoid,repagenum,islast,infos from {$dbtbpre}enewsclass where classid='$classid'");
if(empty($cr['classid']))
{
printerror("ErrorUrl","history.go(-1)",1);
}
if($class_r[$classid][islast]&&$cr['bdinfoid'])
{
printerror("ErrorUrl","history.go(-1)",1);
}
//是否支持动态页
/*伪静态不需要
if(empty($class_r[$classid]['listdt'])&&!$cr['repagenum'])
{
$classurl=sys_ReturnBqClassname($cr,9);
Header("Location:$classurl");
exit();
}
*/
//权限
if($cr['cgroupid'])
{
$mgroupid=(int)getcvar('mlgroupid');
if(!strstr($cr[cgroupid],','.$mgroupid.','))
{
printerror('NotLevelToClass','history.go(-1)',1);
}
}
$GLOBALS['navclassid']=$classid;
$url=ReturnClassLink($classid);
$pagetitle=$class_r[$classid]['classname'];
$pagekey=$cr['classpagekey'];
$pagedes=$cr['intro'];
$classimg=$cr['classimg']?$cr['classimg']:$public_r[newsurl].'e/data/images/notimg.gif';
//---封面式---
if(!$class_r[$classid][islast]&&$cr['islist']!=1)
{
/*伪静态不需要 ---yonglan
if(empty($cr['listdt'])||$cr['islist']==3)
{
printerror("ErrorUrl","history.go(-1)",1);
}
*/
if($cr[islist]==2)
{
$classtemp=GetClassText($classid);
$dttempname='classpage'.$classid;
}
else
{
if(empty($cr['classtempid']))
{
printerror('ErrorUrl','',1);
}
$classtemp=GetClassTemp($cr['classtempid']);
$dttempname='classtemp'.$cr['classtempid'];
}
$string=DtNewsBq($dttempname,$classtemp,0);
$string=str_replace('[!--newsnav--]',$url,$string);//位置导航
$string=Class_ReplaceSvars($string,$url,$classid,$pagetitle,$pagekey,$pagedes,$classimg,$addr,0);
$string=str_replace('[!--page.stats--]','',$string);
echo stripSlashes($string);
exit();
}
//---列表式---
$add='';
//栏目
if($class_r[$classid][islast])//终极栏目
{
$add.="classid='$classid'";
$have_class=0;
}
else
{
$add.=ReturnClass($class_r[$classid][sonclass]);
$have_class=1;
}
//排序
if(empty($class_r[$classid][reorder]))
{
$addorder="newstime desc";
}
else
{
$addorder=$class_r[$classid][reorder];
}
//列表模板
$tempid=$class_r[$classid]['dtlisttempid']?$class_r[$classid]['dtlisttempid']:$class_r[$classid]['listtempid'];
if(empty($tempid))
{
printerror('ErrorUrl','',1);
}
$tempr=$empire->fetch1("select tempid,temptext,subnews,listvar,rownum,showdate,modid,subtitle,docode from ".GetTemptb("enewslisttemp")." where tempid='$tempid'");
if(empty($tempr[tempid]))
{
printerror('ErrorUrl','',1);
}
$page=(int)substr($_GET['page'],6);//page是带index-所以去掉----yonglan
$page=RepPIntvar($page)?RepPIntvar($page):1;
$start=0;
$line=$class_r[$classid]['lencord'];//每页显示记录数
$page_line=10;//每页显示链接数
$offset=$page*$line-$line;//总偏移量
//系统模型
$ret_r=ReturnReplaceListF($mid);
//优化
$yhadd='';
$yhid=$class_r[$classid][yhid];
$yhvar='qlist';
if($yhid)
{
$yhadd=ReturnYhSql($yhid,$yhvar,1);
}
//总数
$totalnum=(int)$_GET['totalnum'];
if($totalnum<1)
{
if($yhadd)
{
$totalquery="select count(*) as total from {$dbtbpre}ecms_".$tbname." where ".$yhadd.$add;
$num=$empire->gettotal($totalquery);
}
else
{
$num=ReturnClassInfoNum($cr,0);
}
}
else
{
$num=$totalnum;
}
$search.='&totalnum='.$num;
$query="select ".ReturnSqlListF($mid)." from {$dbtbpre}ecms_".$tbname." where ".$yhadd.$add;
$query.=" order by ".ReturnSetTopSql('list').$addorder." limit $offset,$line";
$sql=$empire->query($query);
//伪静态
$pagefunr=eReturnRewriteClassUrl($classid,0);
$pagefunr['repagenum']=$cr['repagenum'];
$pagefunr['dolink']=empty($class_r[$classid]['classurl'])?$public_r['newsurl'].$class_r[$classid]['classpath'].'/':$class_r[$classid]['classurl'].'/';
$pagefunr['dofile']='index';
$pagefunr['dotype']=$class_r[$classid]['classtype'];
//分页
/*不用默认分页了---yonglan
if($pagefunr['rewrite']==1||$pagefunr['repagenum'])
{
$listpage=InfoUsePage($num,$line,$page_line,$start,$page,$search,$pagefunr);
}
else
{
$listpage=page1($num,$line,$page_line,$start,$page,$search);
}
*/
$listpage=yl_pagelist($num,$line,$page_line,$start,$page);//自己加的分页---yonglan
function yl_pagelist($num,$line,$page_line,$start,$page){//自己加的分页函数---yonglan
global $fun_r;
if($num<=$line)
{
return '';
}
$f='_';//伪静态分页分割符号
$url=preg_replace('/_[0-9]+/', '', $_SERVER['HTTP_X_REWRITE_URL']?$_SERVER['HTTP_X_REWRITE_URL']:$_SERVER['REQUEST_URI']);
if(!strripos($url,'.')){
$url=$url.'index.html';
}
$urlarr=explode('.', $url);
$snum=3;//最小页数
$totalpage=ceil($num/$line);//取得总页数
$firststr='<a title="'.$fun_r['trecord'].'">&nbsp;<b>'.$num.'</b> </a>&nbsp;&nbsp;';
//上一页
if($page<>0)
{
$toppage='<a href="'.substr($urlarr[0],0,-5).'">'.$fun_r['startpage'].'</a>&nbsp;';
$pagepr=$page-1;
if($pagepr==1){
$prepage='<a href="'.substr($urlarr[0],0,-5).'">'.$fun_r['pripage'].'</a>&nbsp;';
}else{
$prepage='<a href="'.$urlarr[0].$f.$pagepr.'.'.$urlarr[1].'">'.$fun_r['pripage'].'</a>';
}
}
//下一页
if($page!=$totalpage)
{
$pagenex=$page+1;
$nextpage='&nbsp;<a href="'.$urlarr[0].$f.$pagenex.'.'.$urlarr[1].'">'.$fun_r['nextpage'].'</a>';
$lastpage='&nbsp;<a href="'.$urlarr[0].$f.$totalpage.'.'.$urlarr[1].'">'.$fun_r['lastpage'].'</a>';
}
$starti=$page-$snum<0?0:$page-$snum;
$no=0;
for($i=$starti+1;$i<$totalpage+1&&$no<$page_line;$i++)
{
$no++;
if($page==$i)
{
$is_1="<b>";
$is_2="</b>";
}
else
{
if($i==1){//第一页不加page0
$is_1='<a href="'.substr($urlarr[0],0,-5).'">';
$is_2="</a>";
}else{
$is_1='<a href="'.$urlarr[0].$f.$i.'.'.$urlarr[1].'">';
$is_2="</a>";
}
}
$pagenum=$i;
$returnstr.="&nbsp;".$is_1.$pagenum.$is_2;
}
$returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
return $returnstr;
}//自己写的分页函数结束-----yonglannet
//页面支持标签
if($public_r['dtcanbq'])
{
$tempr[temptext]=DtNewsBq('list'.$tempid,$tempr[temptext],0);
}
else
{
if($public_r['searchtempvar'])
{
$tempr[temptext]=ReplaceTempvar($tempr[temptext]);
}
}
$listtemp=$tempr[temptext];
$rownum=$tempr[rownum];
if(empty($rownum))
{$rownum=1;}
$formatdate=$tempr[showdate];
$subnews=$tempr[subnews];
$subtitle=$tempr[subtitle];
$docode=$tempr[docode];
$modid=$tempr[modid];
$listvar=str_replace('[!--news.url--]',$public_r[newsurl],$tempr[listvar]);
//公共
$listtemp=str_replace('[!--newsnav--]',$url,$listtemp);//位置导航
$listtemp=Class_ReplaceSvars($listtemp,$url,$classid,$pagetitle,$pagekey,$pagedes,$classimg,$addr,0);
$listtemp=str_replace('[!--page.stats--]','',$listtemp);
$listtemp=str_replace('[!--show.page--]',$listpage,$listtemp);
$listtemp=str_replace('[!--show.listpage--]',$listpage,$listtemp);
$listtemp=str_replace('[!--list.pageno--]',$page+1,$listtemp);
//取得列表模板
$list_exp="[!--empirenews.listtemp--]";
$list_r=explode($list_exp,$listtemp);
$listtext=$list_r[1];
$no=$offset+1;
$changerow=1;
while($r=$empire->fetch($sql))
{
//替换列表变量
$repvar=ReplaceListVars($no,$listvar,$subnews,$subtitle,$formatdate,$url,$have_class,$r,$ret_r,$docode);
$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];
echo stripSlashes($string);
db_close();
$empire=null;
?>
复制代码
内容show.php代码:
<?php
require('../class/connect.php');
require('../class/db_sql.php');
require('../class/functions.php');
require('../class/t_functions.php');
require LoadLang('pub/fun.php');
require('../data/dbcache/class.php');
require('../data/dbcache/MemberLevel.php');
$link=db_connect();
$empire=new mysqlquery();
$classid=RepPostStr($_GET['classid']);//修改过滤方式--yognlan
$id=RepPostStr($_GET['id']);//修改过滤方式--yognlan
//获取真实classid--yognlan
if(!is_numeric($classid)){
foreach ($class_r as $val){
foreach ($val as $val2){
if($classid==$val['classpath']){
$classid=$val['classid'];
break;
}
}
}
}
//获取真实信息id--yognlan
if(is_numeric($id) && !$class_r[$classid]['filename']){
$where="classid='$classid' and id='$id'";
}else{
$where="classid='$classid' and filename='$id'";
}
$page=(int)substr($_GET['page'],1);//page是带横线所以去掉----yonglan
$page=RepPIntvar($page)?RepPIntvar($page):1;
$mid=$class_r[$classid]['modid'];
$tbname=$class_r[$classid]['tbname'];
//验证IP
eCheckAccessDoIp('showinfo');
if(!$classid||!$id||!$mid||!$tbname||InfoIsInTable($tbname))
{
printerror('此信息不存在','',1,0,1);
}
$r=$empire->fetch1("select * from {$dbtbpre}ecms_".$tbname." where $where limit 1");
if(!$r['id']||$classid!=$r['classid'])
{
printerror('此信息不存在','',1,0,1);
}
$id=$r['id'];//ID重新赋值--yognlan
//外部链接
if($r['isurl'])
{
$titleurl=$r['titleurl'];
Header("Location:$titleurl");
exit();
}
//是否支持动态内容页
/*伪静态不需要--yonglannet
if($class_r[$classid]['showdt']!=2)
{
$titleurl=sys_ReturnBqTitleLink($r);
Header("Location:$titleurl");
exit();
}
*/
//副表
$finfor=$empire->fetch1("select ".ReturnSqlFtextF($mid)." from {$dbtbpre}ecms_".$tbname."_data_".$r['stb']." where id='$r[id]' limit 1");
$r=array_merge($r,$finfor);
//权限
if($r['groupid']||$class_r[$classid]['cgtoinfo'])
{
define('empirecms','wm_chief');
define('PageCheckLevel','wm_chief');
$check_tbname=$tbname;
$check_infoid=$id;
$check_classid=$classid;
$check_path="../../";
$checkinfor=$r;
@include("../class/CheckLevel.php");
}
//存文本
if($emod_r[$mid]['savetxtf'])
{
$stf=$emod_r[$mid]['savetxtf'];
if($r[$stf])
{
$r[$stf]=GetTxtFieldText($r[$stf]);
}
}
//初始值
$search="&classid=$classid&id=$id";
$line=1;
$start=0;
$page_line=6;//每页显示链接数
$offset=$page*$line-$line;//总偏移量
$GLOBALS['navclassid']=$r[classid];
$GLOBALS['navinfor']=$r;
//取得内容模板
$r[newstempid]=$r[newstempid]?$r[newstempid]:$class_r[$r[classid]][newstempid];
$newstemp_r=$empire->fetch1("select tempid,temptext,showdate from ".GetTemptb("enewsnewstemp")." where tempid='$r[newstempid]'");
//替换模板变量
function DtGetHtml($add,$newstemp_r,$mid,$tbname,$line,$page_line,$start,$page,$search){
global $public_r,$class_r,$class_zr,$class_tr,$fun_r,$empire,$dbtbpre,$emod_r,$level_r;
//更新点击
$empire->query("update {$dbtbpre}ecms_".$tbname." set onclick=onclick+1 where id='$add[id]' limit 1");
$add['onclick']=$add['onclick']+1;
//模板参数
$newstemptext=$newstemp_r[temptext];
$formatdate=$newstemp_r[showdate];
//页面
$pagetitle=ehtmlspecialchars($add[title]);
$url=ReturnClassLink($add[classid]);//导航
$newstemptext=DtInfo_ReplaceSvars($newstemptext,$url,$add[classid],$pagetitle,$add[keyboard],$pagetitle);
//相关信息
if(strstr($newstemptext,'[!--other.link--]'))
{
$keyboardtext=GetKeyboard($add[keyboard],$add[keyid],$add[classid],$add[id],$class_r[$add[classid]][link_num]);
}
//分页字段
$ptitle=$add['title'];
$truepage='';
$titleselect='';
$expage='[!--empirenews.page--]';//分页符
$pf=$emod_r[$mid]['pagef'];
if($pf&&strstr($add[$pf],$expage))//有分页
{
$n_r=explode($expage,$add[$pf]);
$thispagenum=count($n_r);
if($page<0||$page>$thispagenum)
{
$page=1;
}
$add[$pf]=$n_r[$page-1];
if($page)
{
$ti_r=explode('[/!--empirenews.page--]',$n_r[$page]);
if(count($ti_r)>=2)
{
$ptitle=$ti_r[0];
$add[$pf]=$ti_r[1];
}
else
{
$ptitle=$add['title'].'('.($page-1).')';
}
}
//伪静态
$pagefunr=eReturnRewriteInfoUrl($add['classid'],$add['id'],0);
$pagefunr['repagenum']=0;
//取得分页
//屏蔽---yonglan $truepage=InfoUsePage($thispagenum,$line,$page_line,$start,$page,$search,$pagefunr);
//自己写的伪静态分页---yonglan
//前台分页
function yl_showpage($num,$line,$page_line,$start,$page){
global $fun_r;
if($num<=$line)
{
return '';
}
$f='_';//伪静态分页分割符号
$url=preg_replace('/_[0-9]+/', '', $_SERVER['HTTP_X_REWRITE_URL']?$_SERVER['HTTP_X_REWRITE_URL']:$_SERVER['REQUEST_URI']);
$urlarr=explode('.', $url);
$snum=3;//最小页数
$totalpage=ceil($num/$line);//取得总页数
$firststr='<a title="'.$fun_r['trecord'].'">&nbsp;<b>'.$num.'</b> </a>&nbsp;&nbsp;';
//上一页
if($page>1)
{
$toppage='<a href="'.$url.'">'.$fun_r['startpage'].'</a>&nbsp;';
$pagepr=$page-1;
if($pagepr==1){
$prepage='<a href="'.$url.'">'.$fun_r['pripage'].'</a>&nbsp;';
}else{
$prepage='<a href="'.$urlarr[0].$f.$pagepr.'.'.$urlarr[1].'">'.$fun_r['pripage'].'</a>';
}
}
//下一页
if($page!=$totalpage)
{
$pagenex=$page+1;
$nextpage='&nbsp;<a href="'.$urlarr[0].$f.$pagenex.'.'.$urlarr[1].'">'.$fun_r['nextpage'].'</a>';
$lastpage='&nbsp;<a href="'.$urlarr[0].$f.($totalpage).'.'.$urlarr[1].'">'.$fun_r['lastpage'].'</a>';
}
$starti=$page-$snum<0?0:$page-$snum;
$no=0;
for($i=$starti+1;$i<$totalpage+1&&$no<$page_line;$i++)
{
$no++;
if($page==$i)
{
$is_1="<b>";
$is_2="</b>";
}
else
{
if($i==1){//第一页不加page0
$is_1='<a href="'.$url.'">';
$is_2="</a>";
}else{
$is_1='<a href="'.$urlarr[0].$f.$i.'.'.$urlarr[1].'">';
$is_2="</a>";
}
}
$pagenum=$i;
$returnstr.="&nbsp;".$is_1.$pagenum.$is_2;
}
$returnstr=$firststr.$toppage.$prepage.$returnstr.$nextpage.$lastpage;
return $returnstr;
}
$truepage=yl_showpage($thispagenum,$line,$page_line,$start,$page);//伪静态分页            
//自己写的伪静态分页结束----yonglan
//下拉式分页
if(strstr($newstemptext,'[!--title.select--]'))
{
for($j=0;$j<$thispagenum;$j++)
{
$spurl=eReturnRewritePageLink($pagefunr,$j);
if($j==0)
{
$sptitle=$add[title];
}
else
{
$ti_r=explode('[/!--empirenews.page--]',$n_r[$j]);
$sptitle=count($ti_r)>=2?$ti_r[0]:$add[title].'('.($j+1).')';
}
$select='';
if($page==$j)
{
$ptitle=$sptitle;
$select=' selected';
}
$titleselect.='<option value="'.$spurl.'"'.$select.'>'.$sptitle.'</option>';
}
$titleselect='<select name="titleselect" onchange="self.location.href=this.options[this.selectedIndex].value">'.$titleselect.'</select>';
}
//下一页链接
if($page==$thispagenum-1)
{
$thisnextlink=eReturnRewritePageLink($pagefunr,0);
}
else
{
$thisnextlink=eReturnRewritePageLink($pagefunr,$page+1);
}
}
//返回替换验证字符
$docheckrep=ReturnCheckDoRepStr();
if($add[newstext])
{
if(empty($public_r['dorepword'])&&$docheckrep[3])
{
$add[newstext]=ReplaceWord($add[newstext]);//过滤字符
}
if(empty($public_r['dorepkey'])&&$docheckrep[4]&&!empty($add[dokey]))//替换关键字
{
$add[newstext]=ReplaceKey($add['newstext'],$add['classid']);
}
if($public_r['opencopytext'])
{
$add[newstext]=AddNotCopyRndStr($add[newstext]);//随机复制字符
}
}
//变量
$tempf=$emod_r[$mid]['tempf'];
$fr=explode(',',$tempf);
$fcount=count($fr)-1;
//变量替换
$newstempstr=$newstemptext;//模板
for($i=1;$i<$fcount;$i++)
{
$f=$fr[$i];
$value=$add[$f];
if($f=='downpath')//下载地址
{
if(strstr($newstemptext,'[!--downpath--]'))
{
$value=ReturnDownSoftHtml($add);
}
}
elseif($f=='onlinepath')//观看地址
{
if(strstr($newstemptext,'[!--onlinepath--]'))
{
$value=ReturnOnlinepathHtml($add);
}
}
elseif($f=='morepic')//图片集
{
if(strstr($newstemptext,'[!--morepic--]'))
{
$value=ReturnMorepicpathHtml($add);
}
}
elseif($f=='newstime')//时间
{
if(strstr($newstemptext,'[!--newstime--]'))
{
$value=date($formatdate,$value);
}
}
elseif($f=='befrom')//信息来源
{
if($docheckrep[1]&&strstr($newstemptext,'[!--befrom--]'))
{
$value=ReplaceBefrom($value);
}
}
elseif($f=='writer')//作者
{
if($docheckrep[2]&&strstr($newstemptext,'[!--writer--]'))
{
$value=ReplaceWriter($value);
}
}
elseif($f=='titlepic')//标题图片
{
if(empty($value))
{$value=$public_r[newsurl].'e/data/images/notimg.gif';}
}
elseif($f=='title')//标题
{
}
else//正常字段
{
if(!strstr($emod_r[$mid]['editorf'],','.$f.','))
{
if(strstr($emod_r[$mid]['tobrf'],','.$f.','))//加br
{
$value=nl2br($value);
}
if(!strstr($emod_r[$mid]['dohtmlf'],','.$f.','))//去除html
{
$value=RepFieldtextNbsp(ehtmlspecialchars($value));
}
}
}
$newstempstr=str_replace('[!--'.$f.'--]',$value,$newstempstr);
}
//固定变量
$newstempstr=str_replace('[!--id--]',$add[id],$newstempstr);
$newstempstr=str_replace('[!--classid--]',$add[classid],$newstempstr);
$newstempstr=str_replace('[!--class.name--]',$class_r[$add[classid]][classname],$newstempstr);
$newstempstr=str_replace('[!--ttid--]',$add[ttid],$newstempstr);
$newstempstr=str_replace('[!--tt.name--]',$class_tr[$add[ttid]][tname],$newstempstr);
$newstempstr=str_replace('[!--onclick--]',$add[onclick],$newstempstr);
$newstempstr=str_replace('[!--userfen--]',$add[userfen],$newstempstr);
$newstempstr=str_replace('[!--username--]',$add[username],$newstempstr);
//带链接的用户名
if($add[ismember]==1&&$add[userid])
{
$newstempstr=str_replace('[!--linkusername--]',"<a href='".$public_r[newsurl]."e/space/?userid=".$add[userid]."' target=_blank>".$add[username]."</a>",$newstempstr);
}
else
{
$newstempstr=str_replace('[!--linkusername--]',$add[username],$newstempstr);
}
$newstempstr=str_replace('[!--userid--]',$add[userid],$newstempstr);
$newstempstr=str_replace('[!--other.link--]',$keyboardtext,$newstempstr);
$newstempstr=str_replace('[!--news.url--]',$public_r[newsurl],$newstempstr);
$newstempstr=str_replace('[!--plnum--]',$add[plnum],$newstempstr);
$newstempstr=str_replace('[!--totaldown--]',$add[totaldown],$newstempstr);
$newstempstr=str_replace('[!--keyboard--]',$add[keyboard],$newstempstr);
//链接
$titleurl=sys_ReturnBqTitleLink($add);
$newstempstr=str_replace('[!--titleurl--]',$titleurl,$newstempstr);
$newstempstr=str_replace('[!--page.stats--]','',$newstempstr);
$classurl=sys_ReturnBqClassname($add,9);
$newstempstr=str_replace('[!--class.url--]',$classurl,$newstempstr);
//下一篇
if(strstr($newstemptext,'[!--info.next--]'))
{
$next_r=$empire->fetch1("select isurl,titleurl,classid,id,title from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." where id>$add[id] and classid='$add[classid]' order by id limit 1");
if(empty($next_r[id]))
{
$infonext="<a href='".$classurl."'>".$fun_r['HaveNoNextLink']."</a>";
}
else
{
//链接
$nexttitleurl=sys_ReturnBqTitleLink($next_r);
$infonext="<a href='".$nexttitleurl."'>".$next_r[title]."</a>";
}
$newstempstr=str_replace('[!--info.next--]',$infonext,$newstempstr);
}
//上一篇
if(strstr($newstemptext,'[!--info.pre--]'))
{
$next_r=$empire->fetch1("select isurl,titleurl,classid,id,title from {$dbtbpre}ecms_".$class_r[$add[classid]][tbname]." where id<$add[id] and classid='$add[classid]' order by id desc limit 1");
if(empty($next_r[id]))
{
$infonext="<a href='".$classurl."'>".$fun_r['HaveNoNextLink']."</a>";
}
else
{
//链接
$nexttitleurl=sys_ReturnBqTitleLink($next_r);
$infonext="<a href='".$nexttitleurl."'>".$next_r[title]."</a>";
}
$newstempstr=str_replace('[!--info.pre--]',$infonext,$newstempstr);
}
//投票
if(strstr($newstemptext,'[!--info.vote--]'))
{
$myvotetext=sys_GetInfoVote($add[classid],$add[id]);
$newstempstr=str_replace('[!--info.vote--]',$myvotetext,$newstempstr);
}
//评分
if(strstr($newstemptext,'[!--pinfopfen--]'))
{
$pinfopfen=$add[infopfennum]?round($add[infopfen]/$add[infopfennum]):0;
$newstempstr=str_replace('[!--pinfopfen--]',$pinfopfen,$newstempstr);
$newstempstr=str_replace('[!--infopfennum--]',$add[infopfennum],$newstempstr);
}
$string=$newstempstr;
//替换变量
$string=str_replace('[!--p.title--]',strip_tags($ptitle),$string);
$string=str_replace('[!--next.page--]',$thisnextlink,$string);
$string=str_replace('[!--page.url--]',$truepage,$string);
$string=str_replace('[!--title.select--]',$titleselect,$string);
return $string;
}
if(empty($newstemp_r['tempid']))
{
printerror('ErrorUrl','',1);
}
//页面支持标签
if($public_r['dtncanbq'])
{
$newstemp_r[temptext]=DtNewsBq('text'.$newstemp_r[tempid],$newstemp_r[temptext],1);
}
else
{
if($public_r['searchtempvar'])
{
$newstemp_r[temptext]=ReplaceTempvar($newstemp_r[temptext]);
}
}
$string=DtGetHtml($r,$newstemp_r,$mid,$tbname,$line,$page_line,$start,$page,$search);
echo stripSlashes($string);
db_close();
$empire=null;
?>
下载地址

· 积分下载:下载扣除对应积分,不扣除下载次数
· VIP免费:VIP会员免费下载,扣除下载次数
· 下载即代表您已阅读并同意 [服务条款]

相关推荐
  • 伪静态
  • 帝国CMS7.5插件
  • 帝国cms栏目
  • dedecms伪静态生成插件
    dedecms伪静态生成插件

    织梦后台系统参数有个伪静态设置,相信大家都没弄过,今天就搞一个dedecms伪静态插件,供大家研究学习交流。dedecmss伪静态插件使用方法一、首先就是需要开启伪静态。.后台系统→系统基本参数→核心设...

    织梦cms插件 1518 4年前
  • 帝国CMS二次开发搜索伪静态教程

    帝国CMS搜索伪静态教程步骤:1、打开\e\search\index.php 411行左右,找到:Header("Location:result/?searchid=$searchid".$dogetvar);修改为:Header("Location:$public_r[newsurl]search-0-$searchid.html".$dogetvar);二、打开\e\search\result...

    帝国cms教程 329 9年前
  • 帝国CMS7.0IIS伪静态教程

    帝国CMS7.0IIS伪静态教程步骤:1、进后后台 - 系统 - 系统设置 - 伪静态参数设置 - 都点击默认2、在网站根目录(web文件夹)下建一个文件,文件名及后缀格式为:httpd.ini3、用txt/记事本模式打开httpd.ini文件,将下面的内容复制到该文件内:[ISAPI_Rewrite]# ...

    帝国cms教程 319 9年前
  • 帝国cms7.2默认伪静态规则

    暂时只有APACHE IIS6 IIS7的规则,其他规则自行对照修改即可。不是很严谨,自己可以往严谨中修改:仅供参考!apache下的.htaccess:RewriteEngine OnErrorDocument 404 /404.htmlRewritebase /#信息列表RewriteCond %{QUERY_STRING} ^(.*)$RewriteRule ^l...

    帝国cms教程 689 8年前
  • 帝国TAGS标签伪静态调用+伪静态规则教程

    帝国CMS灵动标签SQL调用TAGS标签代码<?php$tsql=$empire->query("select * from {$dbtbpre}enewstags order by num desc");while($tr=$empire->fetch($tsql)){?><a href="/tag/<?=$tr[&#39;path&#39;]?>.html" target="_blank&qu...

    帝国cms教程 340 6年前
  • 批量检测网盘分享地址是否失效插件帝国CMS版
    批量检测网盘分享地址是否失效插件帝国CMS版

    插件说明因为我的站长站资源大部分都是传网盘的,网盘分享链接时不时失效非常影响用户体验,所以下载网盘地址需要经常维护补链。网上有一些批量查询网盘分享链接失效的工具,但是基本都收费,而且有的检...

    帝国cms插件 254 2年前
  • 帝国CMS7.5微信扫码登录插件
    帝国CMS7.5微信扫码登录插件

    帝国CMS7.5微信扫码登录插件,7.5版本测试可以用,附件只有UTF版,其他编码自行转码。为了避免我们新手第一次做微信扫码登录没有头绪,我们从头说起。步骤一、申请微信登录接口1,获取:AppID,AppSecret 。记...

    帝国cms插件 730 3年前
  • 帝国ECMS7.5身份证实名认证插件
    帝国ECMS7.5身份证实名认证插件

    帝国CMS实名认证插件使用教程一、将插件上传到extend/shiming二、登录后台三、访问/e/extend/shiming/install.php如空白删除install.off四、安装成功五、如要卸载,访问/e/extend/shiming/install...

    帝国cms插件 1158 4年前
  • 帝国CMS7.5点击加载更多插件
    帝国CMS7.5点击加载更多插件

    帝国CMS7.5点击加载更多插件,按步骤操作即可实现点击加载更多。1、将以下代码上传至服务器(e/action/)下,命名为getmore.php2、在帝国CMS模板后台,在对应的列表页面添加以下代码页面模板内容(*)列表内...

    帝国cms插件 1268 4年前
  • 帝国cms7.5运算式验证码插件
    帝国cms7.5运算式验证码插件

    用腻了原版的字母+数字组合的验证码,那就试试帝国cms加减法运算验证码,支持所有页面的验证,至少支持7.0以上帝国cms utf8版本(6.6没安装所以就没试过),GBk版请自行转编码即可。安装方法方法一:(不修改...

    帝国cms插件 538 4年前
  • 帝国CMS利用栏目绑定域名做分站问题

    帝国CMS的栏目设置是可以绑定独立域名的,也有很多人想用这个功能来搭建站群,一个栏目一个站的想法,其实是可行的。其实很简单只需要设置绑定二级域名时,勾选应用于子栏目,最后更新信息页地址,方法如下图:方法设置截图...

    帝国cms教程 65 2年前
  • 帝国CMS无限极栏目导航函数

    以下帝国CMS函数可以在任意位置调用N级导航菜单,自己只需要更改css即可。复制以下函数放到 e/class/userfun.php 文件中function dp_classmenu($bclassid,$i=0,$m=0){global $empire,$dbtbpre,$public_r;$bclassid=(int)$bclassid;$i=(int)$i;if(!$i)...

    帝国cms教程 145 2年前
  • 帝国CMS一键清空栏目数据+模型数据表SQL语法

    帝国CMS清空数据有两种方法,第一种方法是帝国CMS后台自带的清空数据功能,第二种是SQL方法帝国CMS后台清空数据功能点击后台的“栏目”-左侧菜单“其他相关”-打开“批量删除信息”帝国CMS一键清空栏目数据+模型数据表SQL语法截图后台自带的批量删除功...

    帝国cms教程 234 2年前
  • 帝国CMS动态版循环栏目伪静态地址

    帝国CMS动态版循环栏目伪静态地址$orderby=(int)$_GET[orderby];$tag=(int)$_GET[tag];$tese=(int)$_GET[tese];$classid=$GLOBALS[navclassid];<a class="elm<?if (!$tag){?> select<?}?>" href="/game/search-<?=$classid?>-<?=$orderby?>-0-&l...

    帝国cms教程 143 3年前
  • 帝国cms调用当前同级栏目方法

    帝国cms调用当前同级栏目代码<ul class="slide-nav"><?$bclassid = $class_r[$GLOBALS[navclassid]][bclassid]; //获取当前父栏目ID?>[e:loop={"select classid,classname,classpath from [!db.pre!]enewsclass where bclassid = &#39;$bclassid&#3...

    帝国cms教程 84 3年前