帝国cms如实现tags页面伪静态?

帝国cms实现tags页面伪静态的步骤如下:

1.修改e/class/t_functions.php中的sys_eShowTags函数

复制代码代码如下:

//显示TAGS

function sys_eShowTags($cid,$num=0,$line=0,$order='',$isgood='',$isgoodshow='',$showjg='',$shownum=0,$cs=''){

global $empire,$dbtbpre,$public_r,$navinfor;

$str='';

if(empty($showjg))

{

$showjg='   ';

}

$ln=0;

if($cid=='selfinfo')

{

if(empty($navinfor['infotags']))

{

return '';

}

$jg='';

$r=explode(',',$navinfor['infotags']);

$count=count($r);

for($i=0;$i<$count;$i++)

{

$ln++;

$br='';

if($line)

{

if($ln%$line==0)

{

$br='

';

}

}

$str.=$jg.'<a href="'.$public_r[newsurl].'e/tags/?tagname='.urlencode($r[$i]).$cs.'" target="_blank">'.$r[$i].'</a>'.$br;

$jg=$br?'':$showjg;

}

}

else

{

$and='';

$where='';

if($cid)

{

$where=strstr($cid,',')?"cid in ($cid)":"cid='$cid'";

$and=' and ';

}

if($isgood)

{

$where.=$and.'isgood=1';

}

if($where)

{

$where=' where '.$where;

}

$order=$order?' '.$order:' tagid desc';

$limit='';

if($num)

{

$limit=' limit '.$num;

}

//推荐标红

$gfont1='';

$gfont2='';

if($isgoodshow)

{

if(strstr($isgoodshow,'r'))

{

$gfont1='<font color="red">';

$gfont2='</font>';

}

if(strstr($isgoodshow,'s'))

{

$gfont1=$gfont1.'<b>';

$gfont2='</b>'.$gfont2;

}

}

$jg='';

$snum='';

$sql=$empire->query("select tagid,tagname,num,isgood from {$dbtbpre}enewstags".$where." order by".$order.$limit);

while($r=$empire->fetch($sql))

{

if($shownum)

{

$snum='('.$r[num].')';

}

$font1='';

$font2='';

if($isgoodshow&&$r[isgood])

{

$font1=$gfont1;

$font2=$gfont2;

}

$ln++;

$br='';

if($line)

{

if($ln%$line==0)

{

$br='

';

}

}

//$str.=$jg.'<a href="'.$public_r[newsurl].'e/tags/?tagid='.$r[tagid].$cs.'" target="_blank">'.$font1.$r[tagname].$snum.$font2.'</a>'.$br;

$str.=$jg.'<a href="'.$public_r[newsurl].'e/tags/'.$r[tagid].'.html" target="_blank">'.$font1.$r[tagname].$snum.$font2.'</a>'.$br;

$jg=$br?'':$showjg;

}

}

echo $str;

}

2.网站根目录 增加.htaccess文件,内容如下

复制代码代码如下:

RewriteEngine On

RewriteBase /

RewriteRule tag/(.*).html$ e/tags/?tagname=$1

RewriteRule e/tags/(.*).html$ e/tags/?tagid=$1

还要空间支持伪静态

1.检测Apache是否支持mod_rewrite   通过php提供的phpinfo()函数查看环境配置,通过Ctrl+F查找到“Loaded Modules”,其中列出了所有apache2handler已经开启的模块,如果里面包括“mod_rewrite”,则已经支持,不再需要继续设置。

如果没有开启“mod_rewrite”,则打开目录 您的apache安装目录“/apache/conf/” 下的 httpd.conf 文件,通过Ctrl+F查找到“LoadModule rewrite_module”,将前面的”#”号删除即可。

如果没有查找到,则到“LoadModule” 区域,在最后一行加入“LoadModule rewrite_module modules/mod_rewrite.so”(必选独占一行),然后重启apache服务器即可。

2.让apache服务器支持.htaccess

修改httpd.conf文件

复制代码代码如下:

Options FollowSymLinks

AllowOverride None

改为

复制代码代码如下:

Options FollowSymLinks

AllowOverride All

时间: 2024-07-30 19:03:05

帝国cms如实现tags页面伪静态?的相关文章

帝国CMS在反馈信息页面调用万能标签的方法

这篇文章主要为大家介绍了帝国CMS在反馈信息页面调用万能标签的方法,需要的朋友可以参考下 对于帝国CMS来说,其万能标签功能都十分强大!是众多使用帝国CMS的站长建站时使用率较多的一个标签! 今天遇到一个项目需要在反馈信息页面引用某个栏目的最新信息,使用万能标签显然实现是最简单的,而反馈信息页面不支持万能标签的调用! 经过一番测试,得出了如下的解决方法: 万能标签的调用函数为eclass下的t_functions.php中的函数sys_GetEcmsInfo,动态页面不支持标签调用却支持php代

帝国cms实现用户访问页面自动生成html

原因: 帝国cms在批量生成文件的时候非常慢.更改了一次模板,往往要更新半天. 思路: 删除所有html->利用nginx匹配未生成的html->php生成html 如果nginx 检测html已经生成,则直接展示,不跳转到php 实现:  代码如下 复制代码 location /{ alias /home/web/xxx.com/; if (!-e $request_filename) { rewrite /(.*)/(.*).html$ /chtml.php?classid=1&i

帝国CMS不同会员组查看文章权限判断在静态页面的实现方法

帝国CMS不同会员组查看文章权限判断在静态页面的实现方法 <?php require("class/connect.php"); include("class/db_sql.php"); include("class/config/config.php"); include("data/dbcache/class.php"); $link=db_connect(); $empire=new mysqlquery(); $

帝国CMS系统tags标签出现空tags标签解决办法

具体解决办法 /* e/class/t_functions.php 搜索 */  代码如下 复制代码 $str.=$jg.'<a href="'.$tagsurl.'" target="_blank">'.$r[$i].'</a>'.$br; $jg=$br?'':$showjg; /* 改成 */  代码如下 复制代码 if(!empty($r[$i])){   $str.=$jg.'<a href="'.$tagsurl.

帝国cms内容页面获取当前栏目链接地址方法

帝国cms内容页面获取当前栏目链接地址方法: <? $r['classid']=$GLOBALS[navclassid]; $classurl=sys_ReturnBqClassname($r,9); echo $classurl; ?>

帝国cms内容信息页面无法刷新成功

帝国cms内容信息页面无法刷新成功有以下两种原因: 1.模板的标签语法有问题,仔细检查下你模板的标签. 2.刷新超时,到系统设置->参数设置那把每组刷新数改小.

帝国cms信息提示 页面样式修改

帝国cms修改提示框样式以及跳转时间的方法.分享给大家供大家参考.具体实现方法如下: 帝国cms的提示框及修改跳转时间的显示模板是:e/message/index.php   提示框代码如下:       复制代码代码如下: <table width="500" border="0" align="center" cellpadding="3" cellspacing="1" class="

帝国cms和discuz论坛系统跨数据库查询调用

现在大多数资讯类系统,一般站长都比较青睐php.mysql组合,这类cms系统中以dede和帝国更为普及,在帝国系统中调用论坛数据,这个应用需求比较常见,cms和论坛系统使用同一数据库时,这样调用时,使用帝国论坛上提供的方法,如果是dede网站系统,使用dede的后台向导就可以直接实现,但如果cms和论坛使用不同的数据库,前提是在同一服务器.同一mysql服务环境下,就不能直接调用了,这涉及到mysql用户的多数据库权限,以及mysql的跨数据库查询问题. 这个问题很久以前就曾经多次在帝国论坛咨

帝国CMS的搜索表单语法规则

帝国CMS提供了比较强大的搜索结果调用,你可以按照帝国cms搜索表单制作语法,制作出满足你需求的大部分搜索功能.如果你在你的数据库中有自定义字段,那么可能需要改一下e/search/index.php对form表单提交的数据处理,可以参考文章最后提供的例子.先来看看搜索表单变量说明: 变量名说明例子搜索表单提交地址POST方式:/e/search/index.php<form name="searchform" method="post" action=&qu