方法步骤:
1、给留言表添加字段gtitle,gSex分别代表留言标题,留言者的性别(用以显示不同头像);
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 $gSex=RepPostStr(trim($add[gSex])); //增加的gSex if(empty($bid)||empty($gtitle)||empty($name)||empty($email)||!trim($lytext)) //gtitle字段检测不允许为空
第50行左右:
$sql=$empire->query("insert into {$dbtbpre}enewsgbook(gtitle,name,gSex,email,`call`,lytime,lytext,retext,bid,ip,checked,userid,username) values('$gtitle','$name','$gSex','$email','$call','$lytime','$lytext','','$bid','$ip','$br[checked]','$userid','$username');"); //插入两字段记录
3、查找e/data/template/gbooktemp.php中
第52行左右:
$query="select lyid,gtitle,name,gSex,email,`call`,lytime,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0"; //查询字段中添加gtitle,gSex
4、查找e/class/t_functions.php中 第2178行左右:
$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("[!--gSex--]",$r['gSex'],$listtemp); $listtemp=str_replace("[!--gtitle--]",$r['gtitle'],$listtemp);
5、查找e/class/functions.php中
第4051行左右:
$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); $listtemp_center=str_replace("[!--gSex--]","<?=\$r[gSex]?>",$listtemp_center); 6、将下面附件中gbook文件夹上传至帝国系统/Skin目录下
7、登陆后台--》模板管理--》公共模板--》修改留言板模板--》复制一下附件中gbook_temp.html模板代码进去即可。
|
[该贴被修改 2 次,最后修改时间 2009-04-27 19:55:14 ]
<a href=http://www.lookyz.cn><font color=Red size=5>帝国演示站</font></a>
|