帝国CMS留言板怎么增加字段(帝国CMS留言板增加字段的方法)

MoBan5源码 | 2023-12-11 10:00:31 |
帝国CMS留言板怎么增加字段?(帝国CMS留言板增加字段的方法)

在制作帝国cms模板留言板功能的时候很多的朋友经常问到这样的问题,就是帝国CMS留言板怎么增加字段呢?下面本站小编就来为大家分享帝国CMS留言板增加字段的方法。

内容如下:

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

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

比如: qq、theme, 

2、打开/e/enews/gbookfun.php,

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

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

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

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

3、打开/e/tool/gbook/index.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>

<tr class="ly2">

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

<td> 

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

</td>

</tr>

4、后台:打开/e/admin/tool/gbook.php,

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

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

调用显示就行了。

5、后台回复页面:打开/e/admin/tool/ReGbook.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了。

总结:

要改的文件有:

/e/enews/gbookfun.php

/e/tool/gbook/index.php

/e/admin/tool/gbook.php

/e/admin/tool/ReGbook.php

/e/data/template/gbooktemp.txt

/e/class/functions.php

以上就是帝国CMS留言板怎么增加字段的方法,希望对大家有所帮助。


标签: