discuz增加邮件通知功能
2016-03-13 22:44
405 查看
helper_notification.php
notification_add函数靠后部分修改:
require_once libfile('function/mail');
$mail_subject = lang('notification', 'mail_to_user');
if(empty($oldnote['new'])) {
C::t('common_member')->increase($touid, array('newprompt' => 1));
$newprompt = C::t('common_member_newprompt')->fetch($touid);
if($newprompt) {
$newprompt['data'] = unserialize($newprompt['data']);
if(!empty($newprompt['data'][$categoryname])) {
$newprompt['data'][$categoryname] = intval($newprompt['data'][$categoryname]) + 1;
} else {
$newprompt['data'][$categoryname] = 1;
}
C::t('common_member_newprompt')->update($touid, array('data' => serialize($newprompt['data'])));
} else {
C::t('common_member_newprompt')->insert($touid, array($categoryname => 1));
}
sendmail_touser($touid, $mail_subject, $notestring, $frommyapp ? 'myapp' : $type);
}
$user = getuserbyuid($touid);
sendmail($user['email'], $mail_subject, $notestring);
model_forum_post.php 修改:
if方法最后多加一个通知
if(!empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) {
list($ac, $nauthorid) = explode('|', authcode($this->param['noticeauthor'], 'DECODE'));
if($nauthorid != $this->member['uid']) {
if($ac == 'q') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array(
'tid' => $this->thread['tid'],
'subject' => $this->thread['subject'],
'fid' => $this->forum['fid'],
'pid' => $this->pid,
'from_id' => $this->pid,
'from_idtype' => 'quote',
));
} elseif($ac == 'r') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array(
'tid' => $this->thread['tid'],
'subject' => $this->thread['subject'],
'fid' => $this->forum['fid'],
'pid' => $this->pid,
'from_id' => $this->thread['tid'],
'from_idtype' => 'post',
));
}
}
$thapost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid'], 0);
notification_add($thapost['authorid'], 'post', 'reppost_noticeauthor', array(
'tid' => $this->thread['tid'],
'subject' => $this->thread['subject'],
'fid' => $this->forum['fid'],
'pid' => $this->pid,
'from_id' => $this->thread['tid'],
'from_idtype' => 'post',
));
}
notification_add函数靠后部分修改:
require_once libfile('function/mail');
$mail_subject = lang('notification', 'mail_to_user');
if(empty($oldnote['new'])) {
C::t('common_member')->increase($touid, array('newprompt' => 1));
$newprompt = C::t('common_member_newprompt')->fetch($touid);
if($newprompt) {
$newprompt['data'] = unserialize($newprompt['data']);
if(!empty($newprompt['data'][$categoryname])) {
$newprompt['data'][$categoryname] = intval($newprompt['data'][$categoryname]) + 1;
} else {
$newprompt['data'][$categoryname] = 1;
}
C::t('common_member_newprompt')->update($touid, array('data' => serialize($newprompt['data'])));
} else {
C::t('common_member_newprompt')->insert($touid, array($categoryname => 1));
}
sendmail_touser($touid, $mail_subject, $notestring, $frommyapp ? 'myapp' : $type);
}
$user = getuserbyuid($touid);
sendmail($user['email'], $mail_subject, $notestring);
model_forum_post.php 修改:
if方法最后多加一个通知
if(!empty($this->param['noticeauthor']) && !$this->param['isanonymous'] && !$this->param['modnewreplies']) {
list($ac, $nauthorid) = explode('|', authcode($this->param['noticeauthor'], 'DECODE'));
if($nauthorid != $this->member['uid']) {
if($ac == 'q') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array(
'tid' => $this->thread['tid'],
'subject' => $this->thread['subject'],
'fid' => $this->forum['fid'],
'pid' => $this->pid,
'from_id' => $this->pid,
'from_idtype' => 'quote',
));
} elseif($ac == 'r') {
notification_add($nauthorid, 'post', 'reppost_noticeauthor', array(
'tid' => $this->thread['tid'],
'subject' => $this->thread['subject'],
'fid' => $this->forum['fid'],
'pid' => $this->pid,
'from_id' => $this->thread['tid'],
'from_idtype' => 'post',
));
}
}
$thapost = C::t('forum_post')->fetch_threadpost_by_tid_invisible($this->thread['tid'], 0);
notification_add($thapost['authorid'], 'post', 'reppost_noticeauthor', array(
'tid' => $this->thread['tid'],
'subject' => $this->thread['subject'],
'fid' => $this->forum['fid'],
'pid' => $this->pid,
'from_id' => $this->thread['tid'],
'from_idtype' => 'post',
));
}
相关文章推荐
- buffer cache
- OS存储器管理(二)
- Git的HTTP proxy设置方法
- Redis自定义动态字符串(sds)模块(二)
- 微信开放JS-SDK,助力网页开发
- 老罗Handler(22)各种方式发送handler以及发送更多类型数据给主线程
- RocketMQ消息系统 - 消息优先级
- Python学习笔记之基本数据类型
- iOS 封装一个Model 处理返回时间
- POJ 3659 Cell Phone Network(树形DP)
- Lock与synchronized 的区别
- 即将毕业的程序员历程总结
- 找到Qt程序所有依赖库的简便方法,带翻译文件
- 菜鸟不要怕,看一眼,你就会用GCD,带你装逼带你飞
- plsql语句块 for 遍历游标
- Codeforces650B Image Preview
- 整体流程
- js scrollTop, 滚动条操作
- 16.3.13(晴)
- 测试MarkDown