帝国ecms文章图片自动添加下一页链接

帝国ecms文章图片自动添加下一页链接

来源:帝国CMS模板网 作者:帝国CMS教程 时间:2009-11-25
浏览:7.7千+ 收藏 点赞(19)
简介: 在e/clas/function.php相应位置添加ClickPicNext函数替换禁用字符function ReplaceWord($newstext){global $empire,$dbtbpre;if(empty($newstext)){return $newstext;}$sql

在e/class/function.php相应位置添加ClickPicNext函数//替换禁用字符

function ReplaceWord($newstext){
global $empire,$dbtbpre;
if(empty($newstext))
{return $newstext;}
$sql=$empire->query("select newword,oldword from {$dbtbpre}enewswords");
while($r=$empire->fetch($sql))
{
$newstext=str_replace($r[oldword],$r[newword],$newstext);
}
return $newstext;
}

后边添加

//把图片替换成链接
//----------------------------
function ClickPicNext($newstext){
// global $empire,$dbtbpre;
if(empty($newstext))
{return $newstext;}
$newstext=preg_replace('//i', "$0",$newstext);
return $newstext;
}

然后,在大约1962行,即在以下代码后:

if($public_r['opencopytext'])
{
$add[newstext]=AddNotCopyRndStr($add[newstext]);//随机复制字符
}

添加一行

$add[newstext]=ClickPicNext($add[newstext]);

这样,点击文章中的图片,就可以链接至下一页了。

帝国CMS模板网 帝国CMS模板网(www.daixiao360.cn)长期承接帝国CMS模板定制,帝国CMS仿站,帝国CMS采集规则,帝国CMS插件,帝国CMS二次开发。