fixed the posts notification procedure.

This commit is contained in:
BJRambo 2016-04-19 16:23:30 +09:00
parent c859f4c2de
commit 2a882142fe
4 changed files with 45 additions and 55 deletions

View file

@ -29,7 +29,7 @@ $lang->ncenterlite_article = '<strong>%1$s</strong> wrote an article as "%2$s".'
$lang->ncenterlite_board = '<strong>%1$s</strong> wrote an article as "%3$s" on the board %2$s.';
$lang->ncenterlite_commented = '<strong>%1$s</strong> commented as "%3$s" on your %2$s.';
$lang->ncenterlite_commented_board = '<strong>%1$s</strong> commented as "%3$s" on the board %2$s.';
$lang->ncenterlite_mentioned = '<strong>%s</strong> mentioned you on <strong>"%s" %s</strong>.';
$lang->ncenterlite_mentioned = '<strong>%s</strong> mentioned you on <strong>"%s"board</strong> to <strong>"%s"</strong> .';
$lang->ncenterlite_message_string = 'You have <strong>%d</strong> new <strong>message(s)</strong>.';
$lang->ncenterlite_message_mention = '<strong>%1$s</strong> sent a message as <strong>"%2$s"</strong>.';
$lang->ncenterlite_test_noti = '<strong>%s</strong>! Skin test notification has been done.';

View file

@ -38,7 +38,7 @@ $lang->ncenterlite_article = '<strong>%1$s</strong>님이 <strong>"%2$s"</strong
$lang->ncenterlite_board = '<strong>%1$s</strong>님이 게시판 <strong>"%2$s"</strong>에 <strong>"%3$s"</strong>라고 글을 남겼습니다.';
$lang->ncenterlite_commented = '<strong>%1$s</strong>님이 회원님의 %2$s에 <strong>"%3$s"</strong>라고 댓글을 남겼습니다.';
$lang->ncenterlite_commented_board = '<strong>%1$s</strong>님이 <strong>"%2$s"</strong>게시판에 <strong>"%3$s"</strong>라고 댓글을 남겼습니다.';
$lang->ncenterlite_mentioned = '<strong>%s</strong>님이 <strong>"%s" %s</strong>에서 회원님을 언급하였습니다.';
$lang->ncenterlite_mentioned = '<strong>%s</strong>님이 <strong>"%s"</strong>게시판에서 <strong>"%s" </strong>게시글작성하며 회원님을 언급하였습니다.';
$lang->ncenterlite_message_string = '<strong>%d</strong>개의 읽지 않은 <strong>메시지</strong>가 있습니다.';
$lang->ncenterlite_message_mention = '<strong>%s</strong>님께서 <strong>"%s"</strong>라고 메시지를 보내셨습니다.';
$lang->ncenterlite_test_noti = '<strong>%s</strong>님! 스킨 테스트 알림을 완료했습니다.';

View file

@ -88,8 +88,48 @@ class ncenterliteController extends ncenterlite
$logged_info = Context::get('logged_info');
$admin_list = $oNcenterliteModel->getMemberAdmins();
$admin_document_notify = false;
if(isset($config->use['admin_content']) && is_array($config->admin_notify_module_srls) && in_array($module_info->module_srl, $config->admin_notify_module_srls))
// 맨션 알림일경우 맨션알림 시작.
if(!empty($mention_targets))
{
if(!$mention_targets && !count($mention_targets) || !isset($config->use['mention']))
{
return new Object();
}
// !TODO 공용 메소드로 분리
foreach($mention_targets as $mention_member_srl)
{
$target_member_config = $oNcenterliteModel->getMemberConfig($mention_member_srl);
$notify_member_config = $target_member_config->data;
if($notify_member_config->mention_notify == 'N')
{
continue;
}
$args = new stdClass();
$args->member_srl = $mention_member_srl;
$args->srl = $obj->document_srl;
$args->target_p_srl = $obj->document_srl;
$args->target_srl = $obj->document_srl;
$args->type = $this->_TYPE_DOCUMENT;
$args->target_type = $this->_TYPE_MENTION;
$args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl);
$args->target_summary = cut_str(strip_tags($obj->title), 50);
$args->target_nick_name = $obj->nick_name;
$args->target_email_address = $obj->email_address;
$args->regdate = date('YmdHis');
$args->target_browser = $module_info->browser_title;
$args->notify = $this->_getNotifyId($args);
$output = $this->_insertNotify($args, $is_anonymous);
if(!$output->toBool())
{
return $output;
}
}
}
if(isset($config->use['admin_content']) && is_array($config->admin_notify_module_srls) && in_array($module_info->module_srl, $config->admin_notify_module_srls) && empty($mention_targets))
{
foreach($admin_list as $admins)
{
@ -115,56 +155,6 @@ class ncenterliteController extends ncenterlite
{
return $output;
}
else
{
$admin_document_notify = true;
}
}
}
if(!$mention_targets && !count($mention_targets) || !isset($config->use['mention']))
{
return new Object();
}
// 맨션 알림일경우 맨션알림 시작.
if($mention_targets)
{
// !TODO 공용 메소드로 분리
foreach($mention_targets as $mention_member_srl)
{
$target_member_config = $oNcenterliteModel->getMemberConfig($mention_member_srl);
$notify_member_config = $target_member_config->data;
if($notify_member_config->mention_notify == 'N')
{
continue;
}
if(is_array($admin_list) && in_array($mention_member_srl, $admin_list) && isset($config->use['admin_content']) && $admin_document_notify == true)
{
continue;
}
$args = new stdClass();
$args->member_srl = $mention_member_srl;
$args->srl = $obj->document_srl;
$args->target_p_srl = $obj->document_srl;
$args->target_srl = $obj->document_srl;
$args->type = $this->_TYPE_DOCUMENT;
$args->target_type = $this->_TYPE_MENTION;
$args->target_url = getNotEncodedFullUrl('', 'document_srl', $obj->document_srl);
$args->target_summary = cut_str(strip_tags($obj->title), 50);
$args->target_nick_name = $obj->nick_name;
$args->target_email_address = $obj->email_address;
$args->regdate = date('YmdHis');
$args->target_browser = $module_info->browser_title;
$args->notify = $this->_getNotifyId($args);
$output = $this->_insertNotify($args, $is_anonymous);
if(!$output->toBool())
{
return $output;
}
}
}

View file

@ -168,7 +168,7 @@ class ncenterliteModel extends ncenterlite
//$str = sprintf('<strong>%1$s</strong>님이 게시판 <strong>"%2$s"</strong>에 <strong>"%3$s"</strong>라고 댓글을 남겼습니다.', $target_member, $type, $v->target_summary);
break;
case 'M':
$str = sprintf($lang->ncenterlite_mentioned, $target_member, $v->target_summary, $type);
$str = sprintf($lang->ncenterlite_mentioned, $target_member, $v->target_browser, $v->target_summary);
//$str = sprintf('<strong>%s</strong>님이 <strong>"%s" %s</strong>에서 회원님을 언급하였습니다.', $target_member, $v->target_summary, $type);
break;
// 메시지. 쪽지