找回密码
 立即注册

[资料] Discuzx3.4 添加回帖邮件通知功能

[复制链接]
69伙伴 发表于 2022-11-19 20:47:50 | 显示全部楼层 |阅读模式
Discuzx3.4 添加回帖邮件通知功能
https://blog.csdn.net/xingyuhailing/article/details/108094757


添加回帖邮件通知功能
在文件 source/include/post/ post_newreply.php在
  1. if(!isset($inspacecpshare)) {
  2.                 showmessage($return , $url, $modpost->param('showmsgparam'));
  3.         }
复制代码


之前加入下面的代码

  1. if($pid != $_GET['reppid']){
  2.                
  3.                 $query = reset(C::t('common_member')->fetch_all_by_username($_G[forum_thread]['author']));
  4.                
  5.                 if(!function_exists('sendmail')) {
  6.                 include libfile('function/mail');
  7.                 }
  8.                
  9.                 if ($_GET['reppid'] != '')
  10.                 {
  11.                         $thaquote2 = C::t('forum_post')->fetch('tid:'.$_G['tid'], $pid);
  12.                         $thaquote_last = C::t('forum_post')->fetch('tid:'.$_G['tid'], $_GET['reppid']);


  13.                         $query_u = reset(C::t('common_member')->fetch_all_by_username(thaquote2['author']));
  14.                         $query_u2 = reset(C::t('common_member')->fetch_all_by_username($thaquote_last['author']));
  15.                         if ($query_u['email'] != $query_u2['email'])
  16.                         {
  17.                                 require_once libfile('function/discuzcode');

  18.                                 $zhuti = 'RE:'.$thread['subject'];
  19.                                 $neirong = '<br><br>'.discuzcode($thaquote2['message']);

  20.                                 sendmail($query_u2['email'],
  21.                                 $zhuti,
  22.                                 $neirong);
  23.                         }
  24.                 }
  25.                 else{
  26.                         $thaquote2 = C::t('forum_post')->fetch('tid:'.$_G['tid'], $pid);
  27.                         $query_u = reset(C::t('common_member')->fetch_all_by_username($thread['author']));
  28.                         if ($thaquote2['email'] != $query_u['email'])
  29.                         {
  30.                        
  31.                         sendmail($query_u['email'],
  32.                         'RE:'.$thread['subject'],
  33.                         '<br><br><br>最新回复:'.$message);
  34.                         }
  35.                 }
  36.         }

复制代码




临时交流 ⇨点我留言
【附件·直下】非必要·勿注册

网格·联系我们 ( 京ICP备16001788号|京公网安备 11010502049360号 ) | 网站地图 | 2012- WGPro.CoM |

GMT+8, 2024-4-21 00:26

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表