wordpress插件bac,同步多个blog
This entry was originally published at 孩子气☆孙秀楠宝宝
因为研究如何写一个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的配置,我的配置是这样的,
- include_once("bac/ixr.bloggerclient.php");
- $bac_username = "sunxiunan"; // your username at your Blogger instance
- $bac_password = "xxxxxx"; // and your password<br />
- $bac_server = "my.donews.com"; // the server receiving your crossposts
- $bac_path = "/sunxiunan/xmlrpc.php"; // the path to the xmlrpc engine
- $bac_key = "";
- $bac_blogid = "";
其中bac_key和bac_blogid都是给blogger.com来使用的,其他的blogger一般用不上。
如果还想配置一下同步出来的效果,可以修改这里,
- function bac_post_action($action, $ID)
- {
- // 前面代码省略
- if (!$category_match) return;
- $head = "<span style=\"display: none\">" . the_title(’’, ‘’, false) . "</span>\n";
- $head .= "<p><em>文章原文发表在这里:<a href=\"" . get_permalink($ID) . "\">原文链接</a>";
- $head .= " at <a href=\"" . get_settings(’siteurl’) . "\">" . get_settings(’blogname’) . "</a></em></p>\n\n";
- $content = get_the_content();
- $content = apply_filters(’the_content’, $content);
- $content = str_replace(’]]>’, ‘]]>’, $content);
- //!!!uncomment for urlparse support
- //$content = urlparse_external_links($content, $ID);
- $entry = $head . $content;
- $tail = "<span style=\"display: none\">" . the_title(’’, ‘’, false) . "</span>\n";
- $tail .= "<p><em>留言请点击这里:<a href=\"" . get_permalink($ID) . "#respond\">留言链接地址</a>";
- $tail .= "</em></p>\n\n";
- $entry .= $tail;
- //后面代码省略
- }
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