注:我在数据库中增加的字段一共有下面几个:ZD_web,ZD_fax,ZD_add,ZD_company,ZD_fangsi,ZD_zhengzhuang,ZD_fuwu
一、在数据库中增加字段。
ZD_web,ZD_fax,ZD_add,ZD_company,ZD_fangsi,ZD_zhengzhuang,ZD_fuwu
二、打开e/tool/gbook/下面的index.php文件,在大约50左右的位置找下面这段代码:
$query="select lyid,name,email,`call`,lytime,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
替换成
$query="select lyid,name,email,`call`,lytime,lytext,retext,ZD_web,ZD_fax,ZD_add,ZD_company,ZD_fangsi,ZD_zhengzhuang,ZD_fuwu from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
下面这段是加在form内的,把原form内的替换掉:
三、打开e/gbook/enews/下面的gbookfun.php文件,在大约12行左右的地方找到以下代码
$name=RepPostStr(trim($add[name]));
$email=RepPostStr($add[email]);
$call=RepPostStr($add[call]);
插入下面的代码:
$ZD_web=RepPostStr($add[ZD_web]);
$ZD_fax=RepPostStr($add[ZD_fax]);
$ZD_add=RepPostStr($add[ZD_add]);
$ZD_company=RepPostStr($add[ZD_company]);
$ZD_fangsi=RepPostStr($add[ZD_fangsi]);
$ZD_zhengzhuang=RepPostStr($add[ZD_zhengzhuang]);
$ZD_fuwu=RepPostStr($add[ZD_fuwu]);
该文件的大约63行找到下面的代码:
$sql=$empire->query("insert into {$dbtbpre}enewsgbook(name,email,`call`,lytime,lytext,retext,bid,ip,checked,userid,username,) values('$name','$email','$call','$lytime','$lytext','','$bid','$ip','$br[checked]','$userid','$username');");
替换为:
$sql=$empire->query("insert into {$dbtbpre}enewsgbook(name,email,`call`,lytime,lytext,retext,bid,ip,checked,userid,username,ZD_web,ZD_fax,ZD_add,ZD_company,ZD_fangsi,ZD_zhengzhuang,ZD_fuwu) values('$name','$email','$call','$lytime','$lytext','','$bid','$ip','$br[checked]','$userid','$username','$ZD_web','$ZD_fax','$ZD_add','$ZD_company','$ZD_fangsi','$ZD_zhengzhuang','$ZD_fuwu');");
四、打开e/data/template下面的gbooktemp.txt文件,约51号找下面的代码:
$query="select lyid,name,email,`call`,lytime,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
替换成:
$query="select lyid,name,email,`call`,lytime,ZD_web,ZD_fax,ZD_add,ZD_company,ZD_fangsi,ZD_zhengzhuang,ZD_fuwu,lytext,retext from {$dbtbpre}enewsgbook where bid='$bid' and checked=0";
五、打开e/class下面的functions.php文件,约2934号的位置找下面代码:
$listtemp_center=str_replace("[!--lyid--]","=$r[lyid]?>",$listtemp_center);
插入下面的代码:
$listtemp_center=str_replace("[!--ZD_web--]","=$r[ZD_web]?>",$listtemp_center);
$listtemp_center=str_replace("[!--ZD_fax--]","=$r[ZD_fax]?>",$listtemp_center);
$listtemp_center=str_replace("[!--ZD_add--]","=$r[ZD_add]?>",$listtemp_center);
$listtemp_center=str_replace("[!--ZD_company--]","=$r[ZD_company]?>",$listtemp_center);
$listtemp_center=str_replace("[!--ZD_fangsi--]","=$r[ZD_fangsi]?>",$listtemp_center);
$listtemp_center=str_replace("[!--ZD_zhengzhuang--]","=$r[ZD_zhengzhuang]?>",$listtemp_center);
$listtemp_center=str_replace("[!--ZD_fuwu--]","=$r[ZD_fuwu]?>",$listtemp_center);
六、打开e/class下面的functions.php文件,约2108号的位置找下面代码:
$listtemp=str_replace("[!--retext--]",nl2br($r['retext']),$listtemp);//回复
插入下面的代码:
$listtemp=str_replace("[!--ZD_web--]",format_datetime($r['ZD_web'],$formatdate),$listtemp);
$listtemp=str_replace("[!--ZD_fax--]",format_datetime($r['ZD_fax'],$formatdate),$listtemp);
$listtemp=str_replace("[!--ZD_add--]",format_datetime($r['ZD_add'],$formatdate),$listtemp);
$listtemp=str_replace("[!--ZD_company--]",format_datetime($r['ZD_company'],$formatdate),$listtemp);
$listtemp=str_replace("[!--ZD_fangsi--]",format_datetime($r['ZD_fangsi'],$formatdate),$listtemp);
$listtemp=str_replace("[!--ZD_zhengzhuang--]",format_datetime($r['ZD_zhengzhuang'],$formatdate),$listtemp);
$listtemp=str_replace("[!--ZD_fuwu--]",format_datetime($r['ZD_fuwu'],$formatdate),$listtemp);
好了,到这里前台的工作就完成了,把这些文件保存后上传到原路径去,在/e/tool/gbook/?bid=1这个页面提交就可以把数据写入数据库了,最后一步就是后台查看留言的页面,如果后面不改的话,提交的东西在后台看不全的哟,呵呵
七、打开e/admin/tool/下面的gbook.php文件
把form内的代码替换成下面的代码:
while($r=$empire->fetch($sql))
{
$br=$empire->fetch1("select bname from {$dbtbpre}enewsgbookclass where bid='$r[bid]'");
//审核
$checked="";
if($r[checked])
{
$checked=" title='未审核' style='background:#99C4E3'";
}
$username="游客";
if($r['userid'])
{
$username="".$r['username']."";
}
?>
网站域名:
=$r[ZD_web]?>
通讯地址:
=$r[ZD_add]?>
报告接收方式:
=$r[ZD_fangsi]?>
网站的症状:
=$r[ZD_zhengzhuang]?>
后续服务:
=$r[ZD_fuwu]?>
其他问题或意见(*):=$r[lytext]?> |
回复:
=nl2br($r[retext])?>
|
|
邮箱:
=$r[email]?>
,电话:
=$r[call]?>
传 真:
=$r[ZD_fax]?>
|
|
|
}
?>
好了,把这个文件保存,上传就OK了,