帝国cms教程

帝国cms二开对反馈增加回复功能!

帝国cms教程 51源码 2021-12-16 人阅读
帝国CMS的反馈功能不能回复。个人感觉对反馈的用户不是很友好,也增加了站长的工作量!所以就在网上看了下教程,进行了二开!!
下面我们就讲下教程!
第一步,增加我们需要的字段
在数据库找到 phome_enewsfeedback 表。在里面增加 retext varchar(120) 客服回复

 第二步,修改文件。
修改/e/admin/tool/showfeedback.php 增加回馈回复,处理订单功能大概在90行左右
这个页面主要就是增加一个FORM,几个文本框,大家可以对照自己的代码添加上去,form input这些都是我加上去的 
例:
<form name="form1" method="post" action="feedback.php">
<input name="enews" type="hidden" id="enews" value="ReOrder">
<input name="bid" type="hidden" id="id" value="<?=$bid?>">
<input name="id" type="hidden" id="id" value="<?=$id?>">
<table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" class=tableborder style="WORD-BREAK: break-all; WORD-WRAP: break-word">
  <?=$ecms_hashur['form']?>
  <tr class=header>
    <td height="25" colspan="2">所属分类:<?=$br[bname]?></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="19%" height="25">提交者:</td>
    <td width="81%" height="25">
      <?=$username?>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="25">发布时间:</td>
    <td height="25">
      <?=$r[saytime]?>
    </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td height="25">IP地址:</td>
    <td height="25">
      <?=$r[ip]?>:<?=$r[eipport]?>
    </td>
  </tr>
  <?=$feedbackinfo?>
  <!--增加反馈回复功能开始-->
  <tr class=header>
<td height="25" colspan="2">反馈处理</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">客服回复:</td>
<td height="25">
<textarea name="fktext" cols="60" rows="9" id="fktext"><?=$r[fktext]?></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="25">&nbsp;</td>
<td height="25">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</td>
</tr>
  <!--增加反馈回复功能结束-->
  <tr bgcolor="#FFFFFF">
    <td height="25" colspan="2"><div align="center">[ <a href="javascript:window.close();">关
        闭</a> ]</div></td>
  </tr>
</table>
</form>
</body>
</html>

第三步。获取表单值
修改/e/admin/tool/feedback 获取表单的值
找到

include "../".LoadLang("pub/fun.php");
这个代码,在这个代码上面增加下面的代码
elseif($enews=="ReOrder")
{
$id=$_POST['id'];
$bid=$_POST['bid'];
$retext=$_POST['retext'];
ReOrder($id,$bid,$retext,$logininid,$loginin);
}

第四步,
增加ReOrder函数
修改/e/class/com_functions.php 增加ReOrder函数


//回复反馈 2021-10-16 by 51源码
function ReOrder($id,$bid,$retext,$userid,$username){
global $empire,$dbtbpre;
$id=(int)$id;
$bid=(int)$bid;
if(!$id||!$retext)
{
printerror("EmptyReGbooktext","history.go(-1)");
}
$sql=$empire->query("update {$dbtbpre}enewsfeedback set retext='$retext' where id='$id';");
if($sql)
{
//操作日志
insert_dolog("id=".$id);
echo"<script>opener.parent.main.location.href='feedback.php?bid=$bid';window.close();</script>";
exit();
}
else
{printerror("DbError","history.go(-1)");}
}

这样就可以进行回复了,看我二开后的效果!


这样就OK了。
迟一点,分享下回复用户的反馈后,自动发送站内短信息反馈内容给反馈的用户!
版权声明:文章搜集于网络,如有侵权请联系本站,转载请说明出处:https://www.51yma.cn/jiaocheng/ECMS/247.html
文章来源: