Extra Form
PHP PHP 7.2
CMS Rhymix

회원 정보 작성 댓글 보기에 보면 스티커 댓글이 있는 경우

{@sticker:24461|24475}

이런 식으로 표시가 되는데 '스티커 댓글입니다' 라고 표시하려면 아래 파란 부분을 어떻게 바꿔줘야 할까요? 

 

/modules/member/skins/default/comment_list.html

 

<tr loop="$comment_list => $no,$comment">
<td>{$no}</td>
<td>
<a href="{getUrl('','document_srl',$comment->document_srl)}#comment_{$comment->comment_srl}" target="_blank">{$comment->getSummary() ?: $lang->msg_no_text_comment}</a>
</td>

 

https://xetown.com/questions/494632

팁을 보고 컨텐츠 위젯은 원하는 대로 바꿨는데 요건 잘 안되네요. 

 

이렇게 바꿨는데 어디가 잘못된걸까요?

{@ $length = mb_strlen(trim(preg_replace('/\s+/', ' ', strip_tags($item->getTitle()))), 'UTF-8');}
<a href="{getUrl('','document_srl',$comment->document_srl)}#comment_{$comment->comment_srl}" target="_blank"><!--@if (strpos($item->getTitle(), 'sticker') === 2) -->{$lang->sticker_comment}<!--@elseif ($length > 0) -->{$comment->getSummary() ?: $lang->msg_no_text_comment}<!--@end--></a>

 

이런 에러 메세지가 나옵니다.

Error #0 "Call to a member function getTitle() on null" in modules/member/skins/default/comment_list.html on line 19

getTitle 함수가 잘못 된듯한데... 참고로, 여러 가지 문제로 전 지금 정신이 나가 있습니다. ^^

  • profile

    $item->getTitle() 이런부분은 위젯이나 모듈등에서 정의하는게 다 다릅니다. 질문한 위젯의 경우 위와 같이 불러오게 정의 되어 있어 가능한 것이고 지금 적용하시려는 곳에서는 어떤정의로 댓글내용을 불러오는지 확인하셔서 적용하셔야 합니다.

    $item,getTitle() 은 해당 위젯에서 정의가 되어 있어 가능한 것입니다.

     

    이런 힌트는 지금 수정하시려는 스킨을 잘 찾아보시면 나와 있을겁니다.

  • profile ?
    답변 감사합니다.
  • profile ?
    이상하네요. 아까는 분명히 $itme, getTitle() 부문을 $comment, getSummary로 바꿔서 했는데도 안됐는데... 지금은 또 되네요. 오타를 냈었나 보네요. 역시 지금 제 정신이 아닌듯 합니다.

    팁 감사했습니다. 항상 도움만 받네요. ^^