Extra Form
PHP PHP 5.6
CMS XpressEngine

알림 센터 스킨의 ncenterlist.html에서 현재 알림을 트리거한 댓글의 dsrl을 뽑아 내려고 하는데요..

 

<div class="list">
<ul>
<li loop="$ncenterlite_list => $o">
<a href="{$o->url}">
<block cond="$useProfileImage">
<img src="{$o->profileImage}"|cond="$o->profileImage" src="{Context::getRequestUri()}modules/ncenterlite/skins/default/img/p.png"|cond="!$o->profileImage" alt="" class="nc_profile_img" />
</block>
<span class="msg">{$o->text}</span><span class="ago">{$o->ago}</span>
</a>
</li>
</ul>
<a cond="$ncenterlite_page_navigation->total_count > 5" class="more" href="#" data-page="2">{$lang->ncenterlite_more}</a>
</div>

 

모듈의 srl은 $o->srl을 토대로 아래의 코드로 뽑을 수 있고

{@ $module_srl = getModel('module')->getModuleInfoByDocumentSrl($o->srl)->module_srl }

 

게시물의 srl은 그냥 $o->srl 이더라구요.

 

저는 알림을 트리거한 댓글의 srl을 뽑으려고 합니다!

아무래 해봐도 잘 안되서 이렇게 도움을 부탁드립니다.

 

의외로 간단할거 같은데, 제가 찾지 못하고 있는 건가요?

  • profile

    알림센터에서 뭔가의 고유번호가 들어갈 만한 필드는 srl, target_srl, target_p_srl이 있습니다.

    아마 이 3개 중 하나에는 댓글 번호가 들어갈 것 같네요.

    target_type이나 notify_type으로 이게 댓글 알림인지 다른 종류의 알림인지 구분할 수도 있고요.

  • profile ?
    감사합니다.
    그런데, 값을 출력해 보니, {$o->srl} {$o->target_srl} {$o->target_p_srl} 모두 동일한 srl 번호가 나옵니다.
    아마 해당 게시물의 document_srl인거 같아요.
  • ? profile
    https://github.com/xe-public/xe-module-ncenterlite/blob/master/ncenterlite.controller.php#L274-L342

    이 부분의 소스를 보면 알림센터 최신버전 기준으로 srl은 문서번호, target_srl은 댓글번호, target_p_srl은 (대댓글인 경우) 부모댓글의 번호인 것 같습니다만...