石锅拌饭

How to make ecto work with Jerome’s Keywords

by Robin Lu on Sep.15, 2005, about , , , ,

The support for tags in WordPress 1.5.2 still depends on plugins. I use Jerome’s Keywords for this purpose. However, it does not work well with Ecto. I digged into the source code of the plugin and wordpress implementation of xml-rpc a bit. Although I am not familiar with php, I managed to make Ecto work with Jerome’s Keywords plugin. Here’s how to do it:

  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:

$_REQUEST['keywords_list'] = $content_struct['mt_keywords'];

Have a try with your Ecto. Set tags when you are composing blogs. After publishing, you can find the tags you set in ecto work just fine with Jerome’s Keywords Plugin.

If you have no interesting in how it works, you can stop here. Now I’d like to explain how I made it.

First, Ecto supports submit tag information as keyword with Movable Type API as mt_keywords. What you have to do is just to enable it in Templates settings. Meanwhile, Jerome’s Keywords hooks the action “publish_post” and “edit_post” to add keywords into post meta table. It extracts the keyword from the HTML REQUEST. So, my hack is to fake the request parameter “keywords_list” with the information in mt_keywords. They happend to use the same structure to present the tags so all I have to do is to add a single line in each post related method in xmlrpc.php

:, , , ,

2 Trackbacks / Pingbacks for this entry

Search

Archives

Browse by tags

agile apple blog book design ecto extension firefox git google hack ichm iphone keyword life mac madfox movie nonsense opensource plugin pm ruby rubyonrails sns software startup wordpress work 财帮子