Blog, Wordpress, 随笔

Simple Tagging Plugin安装失败

前天在桑林志上看到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' ";

<

p class=”zoundry_bw_tags”> Technorati : , , ,

  • 按你的方法改了

    你好。 我安装你的方法改了,还是出错

    WordPress database error: [Table ‘wordpress.wp_post2cat’ doesn’t exist] SELECT p2c.category_id AS cat_id, COUNT(p2c.rel_id) AS numposts, UNIX_TIMESTAMP(max(posts.post_date_gmt)) + ‘8’ AS last_post_date, UNIX_TIMESTAMP(max(posts.post_date_gmt)) AS last_post_date_gmt FROM wp_post2cat p2c INNER JOIN wp_posts posts ON p2c.post_id=posts.id WHERE 1 = 1 AND posts.post_type = ‘post’ AND posts.post_status = ‘publish’ AND posts.post_date_gmt

  • 94smart

    你可以到他们的Blog去留言,应该会有人给你解答,我的问题也是通过这种方法解决的。