묻고답하기

제가 위의 제목 과 같은 기능을 찾다가...  어떤분의 글을 보고 그대로 해 봤습니다.

 

글 내용은 여기를 참조 하세요.

http://www.xpressengine.com/qna/21425129 

 

---------------------

 

xe - modules - comment - comment.controller.php 열고
line 413 쯤에
$admins_emails = $module_info->admin_mail;
이것을
$admins_emails = $module_info->admin_mail.','.$obj->email_address;
이것으로 수정

그리고

게시판 설정에 가서

관리자 메일에 이메일을 하나 등록......

 

-------------------------

 내용은 위 와 같은데요...

 

제 xe 버전은 : 1.5.4.2  인데. 위글에서 알려 주신 소스를 수정 하니 댓글 자체가 달리지 않습니다.

--> 이후 조치는 [게시판정보] 에만 관리자 이메일이 있었는데, [권한관리]에도 관리자 이메일을 넣습니다.

---->그러니 결과가  댓글은 달리는데, 관리자 와  원글에게도 댓글 이메일이 오질 않습니다.

 

이 수정전에는 [게시판정보] 에 관리자 이메일이 있어서, 관리자에게는 메일이 왔었거든요..

이제는 양쪽 모두에게 댓글 메일이 오질 않습니다.

 

뭐가 이상이 있는지? 

 

 

 

/**
 * Send email to module's admins after a new comment was interted successfully
 * if Comments Approval System is used
 * @param object $obj
 * @return void
 */
 function sendEmailToAdminAfterInsertComment($obj)
 {
  $using_validation = $this->isModuleUsingPublishValidation($obj->module_srl);
  
  $oDocumentModel = &getModel('document');
  $oDocument = $oDocumentModel->getDocument($obj->document_srl);

  $oMemberModel = &getModel("member");
  if (isset($obj->member_srl) && !is_null($obj->member_srl))
  {
   $member_info = $oMemberModel->getMemberInfoByMemberSrl($obj->member_srl);
  }
  else
  {
   $member_info->is_admin = "N";
   $member_info->nick_name = $obj->nick_name;
   $member_info->user_name = $obj->user_name;
   $member_info->email_address = $obj->email_address;
  }
  
  $oCommentModel = &getModel("comment");
  $nr_comments_not_approved = $oCommentModel->getCommentAllCount(null,false);
  $oModuleModel = &getModel("module");
  $module_info = $oModuleModel->getModuleInfoByDocumentSrl($obj->document_srl);
  // If there is no problem to register comment then send an email to all admin were set in module admin panel
  if($module_info->admin_mail && $member_info->is_admin != 'Y')
  {
   $oMail = new Mail();
   $oMail->setSender($obj->email_address, $obj->email_address);
   $mail_title = "[XE - ".Context::get('mid')."] A new comment was posted on document: \"".$oDocument->getTitleText()."\"";
   $oMail->setTitle($mail_title);
   if ($using_validation)
   {
    $url_approve = getFullUrl('','module','comment','act','procCommentAdminChangePublishedStatusChecked','cart[]',$obj->comment_srl,'will_publish','1','search_target','is_published','search_keyword','N');
    $url_trash = getFullUrl('','module','comment','act','procCommentAdminDeleteChecked','cart[]',$obj->comment_srl,'search_target','is_trash','search_keyword','true');
    $mail_content = "
     A new comment on the document \"".$oDocument->getTitleText()."\" is waiting for your approval.
     <br />
     <br />
     Author: ".$member_info->nick_name."
     <br />Author e-mail: ".$member_info->email_address."
     <br />Comment:
     <br />\"".$obj->content."\"
     <br />
     <br />
     Approve it: <a href=\"".$url_approve."\">".$url_approve."</a>
     <br />Trash it: <a href=\"".$url_trash."\">".$url_trash."</a>
     <br />Currently ".$nr_comments_not_approved." comments on \"".Context::get('mid')."\" module are waiting for approval. Please visit the moderation panel:
     <br /><a href=\"".getFullUrl('','module','admin','act','dispCommentAdminList','search_target','module','search_keyword',$obj->module_srl)."\">".getFullUrl('','module','admin','act','dispCommentAdminList','search_target','module','search_keyword',$obj->module_srl)."</a>
    ";
    $oMail->setContent($mail_content);
   }
   else
   {
    $mail_content = "
     Author: ".$member_info->nick_name."
     <br />Author e-mail: ".$member_info->email_address."
     <br />Comment:
     <br />\"".$obj->content."\"
    ";
    $oMail->setContent($mail_content);
    // get email of thread's author
    $document_author_email = $oDocument->variables['email_address'];
    //get admin info
    $logged_info = Context::get('logged_info');
    
    //mail to author of thread - START
    if($document_author_email != $obj->email_address && $logged_info->email_address != $document_author_email) {
      $oMail->setReceiptor($document_author_email, $document_author_email);
      $oMail->send();
    }
    // mail to author of thread - STOP
   }
   
   // get all admins emails

   $admins_emails = $module_info->admin_mail.','.$obj->email_address;     // 수정한 내용
   $target_mail = explode(',',$admins_emails);
   
   // send email to all admins - START
   for($i=0;$i<count($target_mail);$i++)
   {
    $email_address = trim($target_mail[$i]);
    if(!$email_address) continue;
    $oMail->setReceiptor($email_address, $email_address);
    $oMail->send();
   }
   //  send email to all admins - STOP
  }
  
  $comment_srl_list = array(0 => $obj->comment_srl);
  // call a trigger for calling "send mail to subscribers" (for moment just for forum)
  ModuleHandler::triggerCall("comment.sendEmailToAdminAfterInsertComment","after",$comment_srl_list);
  
  /*
  // send email to author - START
  $oMail = new Mail();
  $mail_title = "[XE - ".Context::get('mid')."] your comment on document: \"".$oDocument->getTitleText()."\" have to be approved";
  $oMail->setTitle($mail_title);
  //$mail_content = sprintf("From : <a href=\"%s?document_srl=%s&comment_srl=%s#comment_%d\">%s?document_srl=%s&comment_srl=%s#comment_%d</a><br/>\r\n%s  ", getFullUrl(''),$comment->document_srl,$comment->comment_srl,$comment->comment_srl, getFullUrl(''),$comment->document_srl,$comment->comment_srl,$comment->comment_srl,$comment>content);
  $mail_content = "
   Your comment #".$obj->comment_srl." on document \"".$oDocument->getTitleText()."\" have to be approved by admin of <strong><i>".  strtoupper($module_info->mid)."</i></strong> module before to be publish.
   <br />
   <br />Comment content:
   ".$obj->content."
   <br />
  ";
  $oMail->setContent($mail_content);
  $oMail->setSender($obj->email_address, $obj->email_address);
  $oMail->setReceiptor($obj->email_address, $obj->email_address);
  $oMail->send();
  // send email to author - START
  */
  return;
 }
  

 

 

그리고, 다른 xe 사이트는 버전이 1.4.5.7 입니다.

여기에서는

xe - modules - comment - comment.controller.php 열고 확인 하니, 코드가 완전히 다른것같아요.

 

이런경우는  xe - modules - comment 의 comment 폴더만 최신것으로 바꾸어도 되는지여?

아니면, xe를 업그레이드 해야 할지?    알려 주시면 고맙겠습니다.

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
송문열1 xe에 사용되는 코딩들 대충이라도 알려면 어떤걸 배워야하나요?  
영무니 core 업데이트 하고 접속하면 설치 화면이 나옵니다.  
호루라기 홈페이지 즐겨찾기 할때 등록되는 이름 변경 어디서 하나요?  
브레인630 작성댓글보기에서 게시판이름과 특정게시판에서 추출하려고 하면  
호루라기 XE 홈페이지 즐겨찾기 등록 이름 변경 어디서 하나요? [1] 2013.03.18 by Love_Park
rosery 모바일에서 새 글 아이콘 표시  
꿈틀잉 좀 괴상한 질문입니다.ㅡㅡa 게시물 갱신..  
참치찌개 1.7.3.0 에서 로그인시 아이디 사용하기 [1] 2013.03.17 by 송동우
참치찌개 1.7.3.0 페이지 모듈의 타입 변경 [2] 2013.03.17 by 송동우
티지레몬 레이아웃 변경시 해당 레이아웃 파일이 삭제 됩니다.  
위위위 갑자기 로그인과 글등록이 안됩니다  
세노츠 url 효과라고 해야하려나요? [1] file 2013.03.17 by 송동우
音志 회원 로그인 정지를 부여해도 경고창이 안떠요 [1] 2013.03.17 by 송동우
참치찌개 1.7.3.0 레이아웃 적용을 어떻게 하나요? [1] 2013.03.17 by 송동우
미디안 모바일 접속시 메뉴가 바로 나오게 할수 있을까요..? [2] 2013.03.17 by XE만세
비엣남알유티 게시판에 글 올릴 때 unexpected error occured 오류. file  
들비체 게시판 썸네일 정렬방법이 어디 있나요?  
그누와엑스이 voteNmove 오류. [3] 2013.03.17 by 송동우
브레인630 회원정보변경시 레이아웃이 사라짐  
淸心事達 회원 자동가입 방지 captcha 문의합니다. [1] 2013.03.17 by 푸시아
식군 content 위젯에서 탭 메뉴 질문. [1] 2013.03.17 by 송동우
sho2kan 레이아웃 css와 게시판 css, 에디터 css 충돌 문제.. file  
손주사랑 엮인글인지 뭔지 이건 삭제해야 되나요? file  
도로테비 미투데이 위젯이 크롬에서 가장 상단에 함께 출력됩니다 [1] 2013.03.17 by 송동우
우냠냠냠 회원그룹별로 다른목록을 출력하고싶습니다. [1] 2013.03.17 by 송동우
제로보드장이 제로보드 포인트를 온라인으로 판매할수있는 방법이...도움이 필요합니다 [2] 2013.03.17 by misol
홍길동친구 글자(제목)을 자르고 싶어요 [1] 2013.03.17 by 송동우
Sean_ 해외 아니면 한국내 호스팅 회사 선택? [1] 2013.03.17 by Fidelity
서기에요 이런 위젯스킨 있을까요? [1] file 2013.03.17 by 서기에요
서기에요 최근글 2배열 질문..