帝国CMS留言板加字段和验证码得教程方法

来源:互联网   编辑:思良  发表时间:2016-05-19  关注度:1149  

1、在数据库的前缀名_enewsgbook表中添加您要显示的字段,比如我要加标题"gtitle"字段,可以用工具添加,也可以执行sql添加:ALTER TABLE 前缀名_enewsgbook ADD gtitle VARCHAR(100);

2、修改e/enews/gbookfun.php
  第11行左右:

        $name=RepPostStr(trim($add[name]));
        $email=RepPostStr($add[email]);
        $call=RepPostStr($add[call]);
        $lytext=RepPostStr($add[lytext]);
        $gtitle=RepPostStr(trim($add[gtitle]));  //增加的gtitle
        if(empty($bid)||empty($gtitle)||empty($name)||empty($email)||!trim
($lytext))  //gtitle字段检测不允许为空



第56行左右
     

$sql=$empire->query("insert into {$dbtbpre}enewsgbook(name,gtitle,email,`call`,lytime,lytext,retext,bid,ip,checked,userid,username) values('$name','$gtitle','$email','$call','$lytime','$lytext','','$bid','$ip','$br[checked]','$userid','$username');"); //插入字段记录



3、修改e/data/template/gbooktemp.txt
  第50行左右
   

$query="select lyid,name,gtitle,email,`call`,lytime,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";   //查询字段中添加gtitle



4、修改e/class/t_functions.php
  第2106行左右
   

$listtemp=str_replace("[!--lyid--]",$r['lyid'],$listtemp);//id
    $listtemp=str_replace("[!--lytext--]",nl2br($r['lytext']),$listtemp);//留言内容
    $listtemp=str_replace("[!--retext--]",nl2br($r['retext']),$listtemp);//回复
    $listtemp=str_replace("[!--lytime--]",format_datetime($r['lytime'],$formatdate),$listtemp);
    $listtemp=str_replace("[!--name--]",$r['name'],$listtemp);
    $listtemp=str_replace("[!--gtitle--]",$r['gtitle'],$listtemp);



5、修改e/class/functions.php
  第2934行左右添加
 

$listtemp_center=str_replace("[!--lyid--]","<?=$r[lyid]?>",$listtemp_center);
   $listtemp_center=str_replace("[!--name--]","<?=$r[name]?>",$listtemp_center);
   $listtemp_center=str_replace("[!--gtitle--]","<?=$r[gtitle]?>",$listtemp_center);



6、然后修改留言模板
(1)加入必填项: <input name="gtitle" type="text" id="gtitle" />
(2)加入验证码: <input type=text name=key><img src="/e/ShowKey/?v=gbook" onClick="this.src= this.src +'&xx='+Math.random()" alt="看不清楚,点击刷新">
(3)后台开启留言验证:  系统参数修改------信息设置   ---留言验证码

至此,留言字段添加成功。


原文:http://www.daixiao360.cn/jc/630.html

    支付宝扫码领红包,不用多说,用过的人都知道,双赢的,你得红包,我得到同等推广红包,比如你扫到1元,我也得1元,大家得到的红包可以去实体店消费!新用户至少10元以上哦,每天都有!希望大家每天来本站扫码!感谢感谢!

    把打赏改成扫码红包了!支持本站就扫码下!


下一篇:【原创】任何位置用灵动标签调用留言板内容


上一篇:帝国CMS留言提示“请输入留言姓名,邮箱与留言内容”的解决方法


小提示:按 回车[Enter]键 返回,按 ←键 返回上一页, 按 →键 进入下一页。

网友评论(0条评论)

选择头像
     

新闻评论(共有 0 条评论)

手机访问

本站APP

联系我

加我微信