当前位置:首页 > 文章 > 帝国CMS > 正文内容

帝国CMS留言板增加字段

3年前 (2022-10-21)帝国CMS15852
帝国CMS留言板增加字段的方法

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

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

比如: qq、theme, 

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

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

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

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

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><!--myadd--> 

<tr class="ly2">

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

<td> 

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

</td>

</tr><!--myadd-->

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

OK!具体的大家自行去测试修改吧!

扫描二维码推送至手机访问。

版权声明:本文由蓝博发布,如需转载请注明出处。

本文链接:https://bblxp.com/p/113.shtml

标签: 留言板字段

“帝国CMS留言板增加字段” 的相关文章

帝国cms灵动标签同时调用头条和推荐

帝国cms灵动标签同时调用头条和推荐

帝国cms灵动标签同时调用头条(1级、2级)、推荐(1级、2级)方法1、同时调用头条(1级、2级)、推荐(1级、2级) [e:loop={0,10,3,0,'isgood=1 or firsttitle=1 orisgood=2 or firsttitle=2'}] <a href="<...

帝国cms灵动标签调用字母所属的信息

帝国cms灵动标签调用字母所属的信息

帝国cms灵动标签调用字母所属的信息 [e:loop={"select * from [!db.pre!]ecms_news where infozm='A'",5,24,0}] <a href="<?=$bqsr['titleurl']?>" target="_blank"&g...

帝国CMS模板调用收藏内容的会员信息带头像和不带头像

帝国CMS模板调用收藏内容的会员信息带头像和不带头像

帝国cms模板里面,怎么调用显示收藏该内容的会员信息呢?其实方法也不难,下面帝国CMS模板网就来告诉大家怎么调用: 方法1、(不带头像调用) [e:loop={"select * from [!db.pre!]enewsfava where classid='$navinfor[classid]'...

帝国cms内容页调用相关阅读文章

帝国cms内容页调用相关阅读文章

帝国CMS调用相关信息文章的方法,帝国cms怎么调用相关阅读文章呢? 调用代码: [e:loop={"select * from phome_ecms_news where classid={$ecms_gr['classid']} order by onclick desc limit 5",0...

帝国CMS列表页调用关键词带链接

帝国CMS列表页调用关键词带链接

帝国CMS列表页新闻关键词带链接的调用方法,一起来看看吧: 勾选【使用程序代码】: $keyboard=$r[keyboard]; $r_tag=explode(",",$keyboard); $tempid=1;//这里是搜索模板ID for($i=0;$i<count($r_tag);$...

帝国CMS在首页列表页模板调用内容页下载地址的方法

帝国CMS在首页列表页模板调用内容页下载地址的方法

帝国CMS在首页列表页模板调用内容页下载地址的方法   [e:loop={'download',10,23,0,'isgood=1'}] <li><a href="<?=$bqsr['titleurl']?>" target="_blank"><?=$b...