How to make ecto work with Ultimate Tag Warrior

I once wrote about “How to make ecto work with Jerome’s Keywords“. Unfortunately, Jerome’s Keywords does not work well with Wordpress 2.0. With suggestion from Meng Yan, I switched to Ultimate Tag Warrior. Again, I met the problem of how to make ecto work with it. Here’s the solution.

  1. make sure Ecto is using Movable Type API to contact with your wordpress. You can check it out in the Account settings.
  2. set up the template of tags in Ecto. Set the “Tag separator” as “,” which is the default setting and “Put tags in” as “keywords” which is NOT the default setting.
  3. update the xmlrpc.php in the directory of your blog system. add the following line into the function mw_newPost and mw_editPost after where $content_struct is initialized:

$_POST['tagset'] = $content_struct['mt_keywords'];

Here’s the sample code to show where to make the modification (below the comments “ROBINLU HACK”):

/* metaweblog.newPost creates a post */
function mw_newPost($args) {
global $wpdb, $post_default_category;
... ...
$post_excerpt = $content_struct['mt_excerpt'];
$post_more = $content_struct['mt_text_more'];
// ROBIN LU HACK
$_POST['tagset'] = $content_struct['mt_keywords'];
$comment_status = (empty($content_struct['mt_allow_comments'])) ?
... ...
}
... ...
/* metaweblog.editPost ...edits a post */
function mw_editPost($args) {
global $wpdb, $post_default_category;
$this->escape($args);
$post_ID     = $args[0];
... ...
$post_title = $content_struct['title'];
$post_content = apply_filters( 'content_save_pre', $content_struct['description'] );
$catnames = $content_struct['categories'];
// ROBINLU HACK
$_POST['tagset'] = $content_struct['mt_keywords'];
$post_category = array();
... ...
}

Update: See Part II to get ecto fully functional with UTW.

42 条评论

解决wordpress插件stattraq的乱码问题

Stattraq是wordpress的一个统计插件,可以对点击、Page Views、引用以及搜索关键词等等进行统计。这个插件有一个问题,就是在显示一些诸如页面标题或者搜索关键词的时候常常出现乱码。今天检查了一下,发现是调用php函数htmlentities时出的问题,按照文档,缺省编码是ISO-8859-1,而我的是UTF-8,结果就乱码了。
修改的方式是把wp-stattraq目录下summary.php和query_strings.php里的

htmlentities(…)

改成:

htmlentities(…, ENT_COMPAT, “UTF-8″)

发表评论

相关主题

今天你被封了没有?

ICP备案对我们来说是只配履行义务不配享受权利,尽管我已经做了ICP备案, www.splyb.com 还是被封了。
很多人推举”封”作为本年度汉字。从96年开始上网,我所看到的”封”字,贯穿了中国互联网发展的全过程。我只能期望,这些逆社会发展而行的人,总有一天会成为被历史唾弃和嘲笑的对象。
通过ecto和bloglines,我找回了大部分数据,刚好赶上wordpress 2.0发布,干脆把家搬到了robinlu.com。以前的comments全部丢失了,还有一些页面内容,等到有时间再慢慢恢复吧。

发表评论

Recent Posts:

Recent Comments:

Archive:

Tags:

Bookmarks:

My music:

About Me:

I am a software engineer in Beijing, China. I write code for work and for fun. I am interested in web technology, life hacking and console games. This blog is dumped from my left brain.
View Robin Lu's profile on LinkedIn

My Flickr:

    drawingAt Modern Sky Music FestivalIMG_0389IMG_0312urumqi panaramaIMG_9664

Friends: