2007-3-15
2007-3-11
2007-3-8
前天在桑林志上看到Wordpress的Simple Tagging Plugin,标签云、相关标签、相关文章……我想用的都有了,赶紧下来装上,但是设置的时候出了问题,一直没能成功使用。 我用的是Wordpress2.1,以前没有用装过Ultimate Tag Worrior和Jerome’s Keywords,在导入Tag的时候,使用的方式是用分类转换为Tag,点击转换按钮后报了一个错:
WordPress database error: [Unknown column 'p2c.category_id' in 'on clause'] SELECT cats.cat_name, p2c.post_id FROM wp_posts posts INNER JOIN wp_categories cats ON (p2c.category_id = cats.cat_id) LEFT JOIN wp_post2cat p2c ON (posts.ID = p2c.post_id) WHERE posts.post_status IN ('publish') AND posts.post_type 'page'
郁闷呀,哪位碰到过类似的问题?请不吝赐教,253先~ Update:终于在Simple Tagging Plugin的Blog回复里面找到了解决办法,据说是Mysql版本太旧不支持INNER JOIN~ 我已经试过了,修改代码如下: 在simpletagging.admin.php文件里的473行,将以下代码替换:
$qry = " SELECT cats.cat_name, p2c.post_id FROM $wpdb->posts posts INNER JOIN $wpdb->categories cats ON (p2c.category_id = cats.cat_id) LEFT JOIN $wpdb->post2cat p2c ON (posts.ID = p2c.post_id) WHERE posts.post_status IN ('publish') AND posts.post_type <> 'page' ";
替换为:
$qry = "SELECT p2c.post_id , cats.cat_name FROM $wpdb->posts posts, $wpdb->post2cat p2c, $wpdb->categories cats WHERE p2c.category_id = cats.cat_ID AND posts.ID = p2c.post_id AND posts.post_status IN ('publish') AND posts.post_type <> 'page' ";
Technorati : SimpleTagging, plugin, tag, wordpress