首页 > CMS教程 > 帝国CMS    日期:2020-02-13 / 来自互联网 / 浏览

首页我们在后台 管理评论 添加一个自定义字段,比如 [!--kwpf--]字段,那么怎么在前台页面调用到帝国评论的自定义字段了。下面就是调用方法:

修改/e/class/t_functions.php

1、搜索:function sys_ShowPlInfo($line,$tempid,$classid=0,$id=0,$isgood=0,$enews=0)。 源文件未修改的话大概在2016行

找到:

$sql=$empire->query("select plid,userid,username,saytime,id,classid,zcnum,fdnum,saytext from {$dbtbpre}enewspl_".$public_r['pldeftb']." where checked=0".$a." order by ".$order." limit ".$line);

改成

$sql=$empire->query("select * from {$dbtbpre}enewspl_".$public_r['pldeftb']." where checked=0".$a." order by ".$order." limit ".$line);

或者改成

$sql=$empire->query("select plid,userid,username,saytime,id,classid,zcnum,fdnum,saytext,kwpf from {$dbtbpre}enewspl_".$public_r['pldeftb']." where checked=0".$a." order by ".$order." limit ".$line);

2、搜索:function ReplaceShowPlVars($no,$listtemp,$r,$formatdate,$subnews=0)

找到:$listtemp=str_replace("[!--fdnum--]",$r['fdnum'],$listtemp);

在其下面增加一行:

$listtemp=str_replace("[!--kwpf--]",$r['kwpf'],$listtemp)

觉得上面的内容有用吗?快来点个赞吧!

点赞() 我要打赏

温馨提示 : 本站内容来自会员投稿以及互联网,所有源码及教程均为作者总结编辑,请大家在使用过程中提前做好备份,以免发生无法预知的错误,源码类教程请勿直接用于生产环境!

 可能感兴趣的文章

1 2 3 4 5