Skip to content
inureyes edited this page Dec 16, 2014 · 7 revisions

플러그인을 호출할 수 있는 이벤트들에 대한 목록입니다. PageOutline

기본적으로 이벤트 핸들러들은 $target, $mother 두 개의 인자를 순서대로 받습니다. 일반적으로 $target은 플러그인에 의해 변경될 가능성이 있는 데이터(글의 본문 등)가, $mother는 해당 데이터가 속한 곳에 대한 정보(글 ID 등)가 넘겨지며 $mother는 생략될 수도 있습니다.

이벤트 핸들러가 동작하는 시점은 fireEvent 함수에 의하여 지정됩니다. 이벤트를 발생시키는 방법은

  • 텍스트큐브의 fireEvent에 따른 내장 이벤트 발생 함수가 동작할 때 -> listener
  • 스킨에 특정한 치환자가 있을 때 ( [[##치환자##]] 형태로 명기합니다) -> tag
  • 사이드바 위젯, 표지 위젯, 관리 패널의 알림판 위젯이 호출될 때 -> sidebar_', '''cover''', '_center 입니다. 자세한 설명은 [wiki:PluginIntroduction 플러그인 안내 문서]를 읽어보세요.

AddPostByBlogAPI

BlogAPI로 글을 작성할 때 발생하는 이벤트 ||$target||글 번호 (entry ID)|| ||$mother||글 정보를 담은 객체 (Post)|| ||비고||-||

DeletePostByBlogAPI

BlogAPI로 글을 삭제할 때 발생하는 이벤트 ||$target||글 번호 (entry ID)|| ||$mother||글 정보를 담은 객체 (Post)|| ||비고||-||

UpdatePostByBlogAPI

BlogAPI로 글을 수정할 때 발생하는 이벤트 ||$target||글 번호 (entry ID)|| ||$mother||글 정보를 담은 객체 (Post)|| ||비고||-||

ViewRecentPostDate

사이드바등의 최근 글 목록의 시간이 출력될 때 발생하는 이벤트. ||$target||최근글 목록의 시간 (Timestamp::format2 출력형태)|| ||$mother||최근글 목록의 시간 (unixtime)|| ||비고||-||

ReceiveNotifiedComment

댓글 알리미가 들어올 때 발생하는 이벤트. ||$target||$post struct|| ||$mother||$post struct|| ||비고||false가 리턴되면 댓글알리미를 받지 않습니다.||

DeleteCommentNotified

댓글 알리미가 지워질 때 발생하는 이벤트

  • $post가 들어갑니다.

UpdatePost

글을 업데이트 할 경우 발생하는 이벤트 ||$target||post의 내용|| ||$mother||post의 id||

DeletePost

글을 삭제할 경우 발생하는 이벤트 ||$target||null|| ||$mother||post의 id||

BindKeyword

키워드를 본문에 바인딩 할 때 발생하는 이벤트

  • $target : 키워드 출력

setKeylogSkin

키로그 팝업 스킨을 정할 때 사용하는 이벤트

  • $mother : 사용하지 않음
  • $target : 스킨 html의 경로

ViewTagLists

태그 리스트를 보여줄 때 사용하는 이벤트

  • $target : 출력되는 태그 리스트 형식

'UpdateDB_' . $plugin . '_' . $name

ViewListHeadTitle

ViewSiteTags

ViewCommentListTitle

ViewCommentIcon

ViewGuestCommentIcon

ViewArchiveDate

ViewCalendarHead

캘린더의 요일을 보여줄 때 발생하는 이벤트.

  • $mother : 날짜정보
  • $target : 출력될 날짜

ViewCommentDate

댓글의 작성일자를 보여줄 때 발생하는 이벤트.

  • $mother : comment의 정보
  • $target : 출력될 날짜

ViewCommentListDate

댓글 리스트의 작성일자를 보여줄 때 발생하는 이벤트.

  • $mother : comment의 정보
  • $target : 출력될 날짜

ViewGuestCommentDate

방명록의 작성일자를 보여줄 때 발생하는 이벤트.

  • $mother : post의 정보
  • $target : 출력될 날짜

ViewListDate

검색, 태그등의 리스트의 작성일자를 보여줄 때 발생하는 이벤트.

  • $mother : 리스트의 정보
  • $target : 출력될 날짜

ViewNoticeDate

공지글의 작성일자를 보여줄 때 발생하는 이벤트.

  • $mother : post의 정보
  • $target : 출력될 날짜

ViewPostDate

글의 작성일자를 보여줄 때 발생하는 이벤트.

  • $mother : post의 정보
  • $target : 출력될 날짜

ViewRecentCommentDate

최근 댓글의 날짜를 출력할 때 발생하는 이벤트.

  • $mother : comment의 정보
  • $target : 출력될 날짜

ViewRecentTrackbackDate

최근 Trackback날짜를 출력할 때 발생하는 이벤트.

  • $mother : trackback의 정보
  • $target : 출력될 날짜

ViewTrackbackDate

Trackback날짜를 출력할 때 발생하는 이벤트.

  • $mother : trackback의 정보
  • $target : 출력될 날짜

아래의 가상 스킨 치환자들은 $target만 받습니다.

SKIN_html_start

meta 스킨 치환자br 스킨에 따로 추가하지 않아도 사용가능한 치환자. (태터툴즈에서 자동으로 생성한다)br 여러 플러그인에서 중복 사용 할 수 있지만, 이벤트 핸들러들은 독립적이어야 함.br 다른 플러그인들을 위하여 반드시 $target을 상속받아 $target을 돌려줘야 함.

SKIN_head_start

meta 스킨 치환자br 스킨에 따로 추가하지 않아도 사용가능한 치환자. (텍스트큐브에서 자동으로 생성한다)br 여러 플러그인에서 중복 사용 할 수 있지만, 이벤트 핸들러들은 독립적이어야 함.br 다른 플러그인들을 위하여 반드시 $target을 상속받아 $target을 돌려줘야 함.

SKIN_head_end

meta 스킨 치환자
스킨에 따로 추가하지 않아도 사용가능한 치환자. (텍스트큐브에서 자동으로 생성한다)br 여러 플러그인에서 중복 사용 할 수 있지만, 이벤트 핸들러들은 독립적이어야 함.br 다른 플러그인들을 위하여 반드시 $target을 상속받아 $target을 돌려줘야 함.

SKIN_body_start

meta 스킨 치환자br 스킨에 따로 추가하지 않아도 사용가능한 치환자. (텍스트큐브에서 자동으로 생성한다)br 여러 플러그인에서 중복 사용 할 수 있지만, 이벤트 핸들러들은 독립적이어야 함.br 다른 플러그인들을 위하여 반드시 $target을 상속받아 $target을 돌려줘야 함.

SKIN_body_end

meta 스킨 치환자br 스킨에 따로 추가하지 않아도 사용가능한 치환자. (텍스트큐브에서 자동으로 생성한다)br 여러 플러그인에서 중복 사용 할 수 있지만, 이벤트 핸들러들은 독립적이어야 함.br 다른 플러그인들을 위하여 반드시 $target을 상속받아 $target을 돌려줘야 함.

SKIN_html_end

meta 스킨 치환자br 스킨에 따로 추가하지 않아도 사용가능한 치환자. (텍스트큐브에서 자동으로 생성한다)br 여러 플러그인에서 중복 사용 할 수 있지만, 이벤트 핸들러들은 독립적이어야 함.br 다른 플러그인들을 위하여 반드시 $target을 상속받아 $target을 돌려줘야 함.

UpdatingVisitorStatistics

  • UpdatingVisitorStatistics : 방문자 통계 정보 갱신 여부

ViewRefererURL

  • ViewRefererURL : 리퍼러 로그 URL를 출력할 때

ViewRSS

  • ViewRSS : RSS 피드를 출력할 때

SaveFeedItem

  • SaveFeedItem : 리더에서 읽어온 피드를 저장할 때

AddingComment

  • AddingComment : 댓글 추가 여부

ModifyingComment

  • ModifyingComment : 댓글 수정 여부

AddingTrackback

  • AddingTrackback : 트랙백 수신 여부

AddingRefererLog

  • AddingRefererLog : 리퍼러 로그 추가 여부

ViewCommenter

코멘트가 보일때 발생

  • $target :
    1. htmlspecialchars($commentSubItem['name'])
    2. '<a href="'.htmlspecialchars(addProtocolSense($commentSubItem['homepage'])).'" onclick="return openLinkInNewWindow(this)">'.htmlspecialchars($commentSubItem['name']).'</a>'
    • 코멘트 작성자의 이름
    • $commentSubItem['homepage']가 있는 경우에 2.를 적용해서 링크포함
  • $mother : $commentSubItem
    • 코멘트에 대한 정보
    • array index : blogid, replier, id, entry, parent, name, password, homepage, secret, comment, ip, written

ViewGuestCommenter

방명록에서 코멘트가 보일때 발생. ViewCommenter 이벤트와 동일

ViewCommentContent

코멘트의 내용이 보일때 발생

  • $target : nl2br(addLinkSense(htmlspecialchars($commentSubItem['comment']),' onclick="return openLinkInNewWindow(this)"'))
    • 코멘트 내용, addLinkSense는 http://로 시작하는 문장(?)에 자동으로 링크를 넣어줌
  • $mother : $commentSubItem
    • 코멘트에 대한 정보
    • array index : owner, replier, id, entry, parent, name, password, homepage, secret, comment, ip, written

ViewGuestCommentContent

방명록에서 코멘트의 내용이 보일때 발생. ViewCommentContent 이벤트와 동일

ViewNoticeContent

공지 내용을 볼때 발생

  • $target : $view. 글 내용
  • $mother : $id. 글 id

ViewPostContent

  • ViewPostContent : 글 내용을 볼때 발생. ViewNoticeContent 이벤트와 동일

AddPost

새로 글을 작성시 발생

  • $target : $id
    • $id=mysql_insert_id();
  • $mother : $entry
    • array index : visibility, category, title, content, location, tag, acceptComment, acceptTrackback, published

AddComment

코멘트가 입력될때 발생

  • $target : $id
    • $id = mysql_insert_id();
  • $mother : $comment
    • array index : entry, parent, name, password, homepage, secret, comment, ip

AddGuestComment

  • AddGuestComment : 방명록에서 코멘트가 입력될때 발생, AddComment 이벤트와 동일

AddNoticeEditorToolbox

공지관리에서 공지 작성/수정시 위지윅/textarea 출력 후 발생

  • $target : 공백
  • $mother : null

AddPostEditorToolbox

글관리에서 글 작성/수정시 위지윅/textarea 출력 후 발생

  • $target : 공백
  • $mother : null

GetRemoteFeed

원격지의 Feed를 받아올때 발생

  • $target : null
  • $mother : $url
    • $url=$feedRow['xmlURL'];
    • $feedRow 는 Feeds 테이블

ViewLink

사이드바에서 링크목록 출력시 발생

  • $target : htmlspecialchars(UTF8::lessenAsEm($link['name'],$skinSetting['linkLength']))
    • 링크의 이름
    • $link 는 Links 테이블
    • $skinSetting 은 SkinSettings 테이블
  • $mother : null

ViewAttachedImage

업로드한 이미지를 보여줄때 발생

  • $target :
    1. "<img src=\"$url\" $property/>"
    2. "<img src=\"$url\" $property style=\"cursor: pointer\" onclick=\"open_img('$url')\"/>"
    • 이미지의 크기가 변경된 경우 2, 아닌 경우 1
  • $mother : $path
    1. $path="$folderPath/$filename";

ViewAttachedImageMobile

모바일 뷰에서 이미지가 출력될 때 발생.

  • $target : "<img src=\"$blogURL/imageResizer/?f=".urlencode($filename)."\" alt=\"\"/>"
  • $mother : $path

$suri\['directive'\].'/'.$suri\['value'\]

http://.../plugin/test 요청시 /plugin/test 이벤트 발생 (blog/plugin/index.php)

  • $target : null
  • $mother : null
  • 코드 첨부
define('ROOT','../..');
$url=isset($_SERVER['REDIRECT_URL'])?$_SERVER['REDIRECT_URL']:$_SERVER['SCRIPT_NAME'];
$depth=substr_count(ROOT,'/');
if($depth>0){
    if(ereg("^((/+[^/]+){{$depth}})/*(.*)$",$url,$matches)){
        $suri['directive']=$matches[1];
        if($matches[3]!==false)
            $suri['value']=$matches[3];
    }else
        respondNotFoundPage();
}else{
    $suri['directive']='/';
    $suri['value']=ltrim($url,'/');
}
Clone this wiki locally