Notice
Recent Posts
Recent Comments
Link
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

ideapla.net

엑토와 WP 태그 연동 본문

blo9.com

엑토와 WP 태그 연동

양주일 2006. 5. 7. 14:07
엑토를 이용해서 Jerome's Keyword와 태그 연동되게 만드는 방법은 Robin Lu의 블로그에 자세한 설명이 있다.


Jerome의 키워드 플러그인과 연동 방법

그러나 추가는 잘 되는데 다시 엑토에서 글쓰기 할 때, 엑토의 태그 표시 부분에 기존에 쓴 태그가 선택되지 않는다. 그냥 업데이트(수정) 하면 모든 태그가 삭제됨.
이럴땐 아래 글을 참고해서 xmlrpc.php를 뜯어고치면 된다!
How to make ecto work with Ultimate Tag Warrior - Part II

구체적으로 말하면, 엑토에서 글 수정 할 때, 태그가 나타나도록 하는 법은 아래 코드를 xmlrpc.php(WP의 루트폴더에 있음) 45줄 근처에 function logIO(... 바로 위에 추가한다.

//--- coded by Jason(blo9.com) for Ecto
function ecto_get_keywords($postid){
$ecto_tags = get_post_meta($postid, 'keywords');
$ecto_tags_list = array();
foreach($ecto_tags as $et)
$ecto_tags_list = array_merge($ecto_tags_list, explode(",", $et));

$ecto_tags_output = "";
foreach($ecto_tags_list as $k){
$k = trim($k);
if(!empty($k) && !empty($ecto_tags_output))
$ecto_tags_output .= ", ";
$ecto_tags_output .="$k";
}
return $ecto_tags_output;
}

다음으로 function mw_getPost() 내부에 'mt_allow_comments' => $allow_comments, 다음에 아래 코드를 추가한다.

'mt_allow_comments' => $allow_comments,
'mt_keywords' => ecto_get_keywords($post_ID),
'mt_allow_pings' => $allow_pings

마지막으로 function mw_getRecentPosts() 에도 위와 같은 위치에 아래 코드를 추가한다.

'mt_allow_comments' => $allow_comments,
'mt_keywords' => ecto_get_keywords($entry['ID']),
'mt_allow_pings' => $allow_pings