整理了下我的修改步骤(实现留言板增加QQ、留言主题字段):

1、进入phpmyadmin后台,在数据库enewsgbook表(留言板数据表)中增加字段,

比如: qq、theme, 

2、打开eenewsgbookfun.php,

1、在13行左右的地方插入下面代码:

$theme=RepPostStr($add[theme]);//myadd

$qq=RepPostStr($add[qq]);//myadd

2、在60行左右找到 $empire->query("insert into 的语句中的相应的位置加入相应的代码。

3、打开etoolgbookindex.php,

1、在51行左右找到“$query="select …”查询语句中适当位置加入字段,如:,theme,qq

2、在135行左右找到“发布者: <?=$r[name]?>……”, 在要显示字段的地方加入<?=$r[theme]?> ,<?=$r[qq]?> 调用显示就行了。

3、在170行左右找到“<form action="../../enews/index.php"” 在表单中加入相应的Input语句就行了。例如在联系电话这行下面插入:

<tr bgcolor="#FFFFFF">

<td>公司名称:</td>

<td height="23"><input name="theme" type="text" id="theme" size="80"/></td>

</tr><!–myadd–> 

<tr class="ly2">

<td class="lytxt">性&nbsp;&nbsp;&nbsp;别:</td>

<td> 

<INPUT name="qq" value="先生"> 先生&nbsp; 

</td>

</tr><!–myadd–>

4、后台:打开eadmintoolgbook.php,

在50行左右找到“$query="select”查询语句,在末尾加入字段:,theme,qq

在119行左右的找到“<table width="700" …<td width="32%" height="23">发布者:……”, 在要显示字段的地方加入“<?=$r[theme]?> ,<?=$r[qq]?> 

调用显示就行了。

5、后台回复页面:打开eadmintoolReGbook.php

直接在页面加入<?=$r[theme]?> ,<?=$r[qq]?>就行了。如在51行左右的“留言发表者”该行下面插入两行代码:

<tr bgcolor="#FFFFFF"> 

<td height="25">QQ:</td>

<td height="25"> 

<?=$r[qq]?>

</td>

</tr>

<tr bgcolor="#FFFFFF"> 

<td height="25">留言主题:</td>

<td height="25"> 

<?=$r[theme]?>

</td>

</tr>

6、到此前、后台都已经可以了,下面进一步修改:

1、打开e/data/template/gbooktemp.txt文件,约51行找到“$query="select…”查询语句,在适当位置加入字段,如:,theme,qq

2、打开e/class/functions.php文件,约2940行找到:“$listtemp_center=str_replace("[!–retext–]","<?=$r[retext]?>",$listtemp_center);”,在改

行下面插入相应写法的代码,如:

$listtemp_center=str_replace("[!–theme–]","<?=$r[theme]?>",$listtemp_center);

$listtemp_center=str_replace("[!–qq–]","<?=$r[qq]?>",$listtemp_center);

3、修改下留言板模板就oK了。

总结:

要改的文件有:

eenewsgbookfun.php

etoolgbookindex.php

eadmintoolgbook.php

eadmintoolReGbook.php

edatatemplategbooktemp.txt

eclassfunctions.php

特别声明此贴参照http://bbs.phome.net/showthread-13-149682-0.html 教程改编而成 

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。