정보 멘션 기능 #1
페이지 정보
본문
https://sir.kr/g5_plugin/6259 여기 코드에서
멘션 기능을 넣기 위해서는
classes.php 내의
[code]
add_event('comment_update_after', array($this, 'comment_insert'), 1, 5); // 댓글
add_event('write_update_after', array($this, 'write_insert'), 1, 5); //글 답변
public function write_insert($board, $wr_id, $w, $qstr, $redirect_url){ // 글에 답변을 한 경우
public function comment_insert($board, $wr_id, $w, $qstr, $redirect_url){ // 글에 댓글 또는 댓글에 댓글을 한 경우
[/code]
내부 함수에. https://sir.kr/g4_tiptech/30139 의 글에서 처럼.
글과 댓글에 @을 찾아서.. 해당 아이디로 알림을 보내면 될 것 같은데. PHP는 힘들다.. (debugging 툴이 필요해..)
[code]
if (preg_match_all('/@(\S+?)/iU', $wr_content, $matches, PREG_SET_ORDER)) {
$mentioned_list = Array();
foreach ( $matches as $v ) {
if ( array_search($v[1], $mentioned_list) === false ) {
$mentioned_list[] = $v[1];
}
}
foreach ( $mentioned_list as $mentioned ) {
}
}
[/code]
댓글목록


