«

»

wordpress插件bac,同步多个blog

This entry was originally published at 孩子气☆孙秀楠宝宝

bac插件地址

因为研究如何写一个blog离线写作软件。找到了bac这个插件。

bac的作用是可以将主要blog的内容同步更新到另一个支持xmlrpc协议的blogger上,协议可以是MovableType,MetaWeblog(WP使用),blogger都可以。

因为my.donews.com使用WP建立,支持XMLRPC协议,所以在上面申请了一个http://my.donews.com/sunxiunan/

插件安装并不复杂,

1,下载,解压缩到某个目录。

2,找到bac-data.sql,将其导入数据库。新建了一个table。

3,修改bac.php的配置,我的配置是这样的,

  1. include_once("bac/ixr.bloggerclient.php");
  2. $bac_username = "sunxiunan";  // your username at your Blogger instance
  3. $bac_password = "xxxxxx"; // and your password<br />
  4. $bac_server = "my.donews.com"; // the server receiving your crossposts
  5. $bac_path = "/sunxiunan/xmlrpc.php"; // the path to the xmlrpc engine
  6. $bac_key = "";
  7. $bac_blogid = "";

    其中bac_key和bac_blogid都是给blogger.com来使用的,其他的blogger一般用不上。

    如果还想配置一下同步出来的效果,可以修改这里,

  1. function bac_post_action($action, $ID)
  2. {
  3. // 前面代码省略
  4. if (!$category_match) return;
  5. $head = "<span style=\"display: none\">" . the_title(’’, ‘’, false) . "</span>\n";
  6. $head .= "<p><em>文章原文发表在这里:<a href=\"" . get_permalink($ID) . "\">原文链接</a>";
  7. $head .= " at <a href=\"" . get_settings(’siteurl’) . "\">" . get_settings(’blogname’) . "</a></em></p>\n\n";
  8. $content = get_the_content();
  9. $content = apply_filters(’the_content’, $content);
  10. $content = str_replace(’]]>’, ‘]]>’, $content);
  11. //!!!uncomment for urlparse support
  12. //$content = urlparse_external_links($content, $ID);
  13. $entry = $head . $content;
  14.  
  15. $tail = "<span style=\"display: none\">" . the_title(’’, ‘’, false) . "</span>\n";
  16. $tail .= "<p><em>留言请点击这里:<a href=\"" . get_permalink($ID) . "#respond\">留言链接地址</a>";
  17. $tail .= "</em></p>\n\n";
  18. $entry .= $tail;
  19. //后面代码省略
  20.  
  21. }

4,在服务器上wp-content/plugins里面建立一个bac目录,把ixr.bloggerclient.php传到这个目录下。将bac.php传到plugins这个目录。然后在控制面板里面激活插件就可以了。

就好像如此这种结构:
–plugins/bac.php
–plugins/bac/ixr.bloggerclient.php

有问题请留言。

wordpress插件bac,同步多个blog

Leave comment:Comment URL

发表您的评论

提示:如果你刚刚提交过评论,但是还没有被显示出来,请点击这里刷新一下: 刷新评论