分类目录
文章索引模板
XML-RPC wp MetaWebLog - 一月 8, 2010 by yippee

XML-RPC wp « WordPress Codex
http://codex.wordpress.org/XML-RPC_wp



WordPress::API::Page
http://kobesearch.cpan.org/htdocs/WordPress-API/WordPress/API/Page.html



MetaWebLog API and Blog Writers – Rick Strahl’s Web Log
http://www.west-wind.com/WebLog/posts/23858.aspx



Windows Live Writer 1.0 beta and Metaweblog API
http://www.wictorwilen.se/Post/131.aspx



CodeProject: Coding Blog Engine with MetaWeblog API Support and Using it with Windows Live Writer. Free source code and programming help
http://www.codeproject.com/KB/XML/MetaWeblogAPI.aspx



C# implementation of newMediaObject for the MetaWeblog API – Laurent Kempé
http://weblogs.asp.net/lkempe/archive/2006/08/27/C_2300_-implementation-of-newMediaObject-for-the-MetaWeblog-API.aspx



Koders Code Search: Nucleus.cs – C#
http://www.koders.com/csharp/fid02CB94A9489AB2B08F7065D89E93CCC7361D4207.aspx?s=httpwebrequest#L125
FileInfo fi = new FileInfo(tiedosto); byte[] fbuffer = new byte[fi.Length]; using (FileStream fs = new FileStream(tiedosto, FileMode.Open)) using (BinaryReader br = new BinaryReader(fs)) { br.Read(fbuffer, 0, fbuffer.Length); } string filecontents = Convert.ToBase64String(fbuffer, 0, fbuffer.Length); StringBuilder sb = new StringBuilder();


基于XML-RPC的BloggerAPI学习 – 枫行天下的asp技术博客 – CSDN博客
http://blog.csdn.net/starlight36/archive/2008/06/20/2570828.aspx



使用BinaryWriter和BinaryReader 第2页|IT168 技术开发
http://tech.it168.com/d/2008-03-26/200803261505104_1.shtml



用C#读取二进制文件_分享彼此 共赢未来
http://hi.baidu.com/czyblues/blog/item/42a4c8cbfda572ff52664f9b.html



 

标签:,
Wordpress 2.9 Missed schedule problem - 一月 7, 2010 by yippee

Wordpress 2.9 Missed schedule problem [Solved]
http://www.shoutmeloud.com/wordpress-missed-schedule-problem-solved.html



WordPress › Support » 2.9 Schedule Posts “missed”
http://wordpress.org/support/topic/343080/page/3



Wordpress 2.9 Missed schedule problem [Solved]
http://www.shoutmeloud.com/wordpress-missed-schedule-problem-solved.html



WordPress › Support » 2.9 Schedule Posts “missed”
http://wordpress.org/support/topic/343080/page/2



“Missed Schedule” Future Posts | Scheduled M.I.A.s Wordpress Plugin — 5ubliminal’s 5pace
http://blog.5ubliminal.com/posts/missed-schedule-future-posts-scheduled-mias-wordpress-plugin/



WordPress 2.9: three bugs, and how to fix them
http://www.semiologic.com/2009/12/21/wp-2-9-three-bugs-and-how-to-fix-them/



#11219 (could not be converted to UTF-8 / WordPress should cache failed feed fetches so as to avoid overloading feed sources) – WordPress Trac
http://core.trac.wordpress.org/ticket/11219



#11168 (Fatal error: Call to undefined method WP_Error::__destruct()) – WordPress Trac
http://core.trac.wordpress.org/ticket/11168



#11505 (cron stopped working with standard configuration) – WordPress Trac
http://core.trac.wordpress.org/ticket/11505



Attachment – WordPress Trac
http://core.trac.wordpress.org/attachment/ticket/11505/11505.diff
wp-includes/http.php
  
1296 1296 
1297 1297                 // CURLOPT_TIMEOUT and CURLOPT_CONNECTTIMEOUT expect integers.  Have to use ceil since
1298 1298                 // a value of 0 will allow an ulimited timeout.
1299                   // Use _MS if available.
1300                   if ( defined( ‘CURLOPT_TIMEOUT_MS’ ) ) {
1301                           $timeout_ms = (int) ceil( 1000 * $r['timeout'] );
1302                           curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT_MS, $timeout_ms );
1303                           curl_setopt( $handle, CURLOPT_TIMEOUT_MS, $timeout_ms );
1304                   } else {
1305                           $timeout = (int) ceil( $r['timeout'] );
1306                           curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
1307                           curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
1308                   }
  1299                 $timeout = (int) ceil( $r['timeout'] );
  1300                 curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
  1301                 curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
1309 1302 
1310 1303                 curl_setopt( $handle, CURLOPT_URL, $url);
1311 1304                 curl_setopt( $handle, CURLOPT_RETURNTRANSFER, true );


 

标签:
WordPress 2.8.5 - 十月 22, 2009 by yippee

虽然WordPress开发人员已经在完善WordPress 2.9的功能,但是随着WordPress的流行,越来越多的朋友开始关注WordPress,于是,WordPress的安全问题也日益被暴露出来。所以,WordPress开发人员不得不重新回头去修复已经确认的数个WordPress 2.8版本的安全漏洞,毕竟目前WordPress 2.8版本是用户使用的主流。


WordPress 2.8.5修复问题列表:


修复Trackback拒绝服务攻击。


Removal of areas within the code where php code in variables was evaluated.


修改WordPress附件上传函数。


从低版本插件中隐藏了两个无关因要的标签数据。


目前在WordPress控制面板已经有升级提示,有升级需要的用户可以及时通过WordPress的一键升级功能完成升级。


也可以到WordPress.org下载,覆盖升级。(请先备份数据库,请不要跨版本升级!)


在WordPress官方博客里,还介绍了一个插件:WordPress Exploit Scanner,可以方便检测数据库中日志和评论的可以数据,也能检测出来可以的插件目录名称。


关于WordPress 2.8.4的漏洞,有兴趣的朋友可以看看这里:New 0-Day Wordpress Exploit。


 


As you know over the past couple of months we have been working on the new features for WordPress 2.9. We have also been working on trying to make WordPress as secure as possible and during this process we have identified a number of security hardening changes that we thought were worth back-porting to the 2.8 branch so as to get these improvements out there and make all your sites as secure as possible.


The headline changes in this release are:


    * A fix for the Trackback Denial-of-Service attack that is currently being seen.
    * Removal of areas within the code where php code in variables was evaluated.
    * Switched the file upload functionality to be whitelisted for all users including Admins.
    * Retiring of the two importers of Tag data from old plugins.


We would recommend that all sites are upgraded to this new version of WordPress to ensure that you have the best available protection.


If you think your site may have been hit by one of the recent exploits and you would like to make sure that you have cleared out all traces of the exploit then we would recommend that you take a look at the WordPress Exploit Scanner.  This is a plugin which searches the files on your website, and the posts and comments tables of your database for anything suspicious. It also examines your list of active plugins for unusual filenames.  You can read more about this plugin here – “WordPress Exploit Scanner“

标签:
wordpress的ROBOTS.TXT - 九月 25, 2009 by yippee

#User-agent: *
#Disallow: /


User-agent: Slurp
Disallow: /


User-agent: Sogou web spider
Disallow: /


User-agent: e-SocietyRobot
Disallow: /


User-agent: iaskspider
Disallow: /


User-agent: Yahoo! Slurp
Disallow: /


User-agent: Yahoo! Slurp China
Disallow: /
 


User-agent: ia_archiver
Disallow: /


User-agent: lanshanbot
Disallow: /


User-agent: *
Crawl-delay: 2400
#Disallow: /blog


Disallow: /cgi-bin/
Disallow: /bggzd.com
Disallow: /stats/
Disallow: /about/
Disallow: /contact/
Disallow: /tag/
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /contact
Disallow: /manual
Disallow: /manual/*
Disallow: /phpmanual/
Disallow: /category/
Disallow: /wp-
Disallow: /feed/
Disallow: /trackback/
Disallow: */feed*
Disallow: */trackback
Disallow: /*.php$
Disallow: /*.js$
Disallow: /*.inc$
Disallow: /*.css$
Disallow: /*.gz$
Disallow: /*.wmv$
Disallow: /*.cgi$
Disallow: /*.xhtml$
Disallow: /cgi-bin
Disallow: /wp-admin
Disallow: /wp-includes
Disallow: /wp-content/plugins
Disallow: /wp-content/cache
Disallow: /wp-content/themes
#Disallow: /trackback
#Disallow: /comments
Disallow: /category/*/*
#Disallow: */trackback
#Disallow: */comments

标签:,
Wordpress and google webmaster tools sitemap - 九月 24, 2009 by yippee

在GOOGLE Webmaster TOOLS中
提交FEED,提示
3  
Invalid URL
This is not a valid URL. Please correct it and resubmit.  
URL: http://
Parent tag: channel
Tag: link
Problem detected on: Sep 23, 2009
Warnings  13  
Incorrect namespace
Your Sitemap or Sitemap index file doesn’t properly declare the namespace.  
Parent tag: channel
Tag: link
Problem detected on: Sep 23, 2009
Warnings  14  
Invalid XML: too many tags
Too many tags describing this tag. Please fix it and resubmit.  
Parent tag: channel
Tag: link
Problem detected on: Sep 23, 2009


搜索了一下:
If you are trying to use your wordpress feed as your sitemap in google webmaster tools, and it looks like there are errors in lines 11 and 12 citing Invalid URL, Invalid XML: too many tags, and Incorrect namespace, it is because you are using your rss2 feed as the sitemap.


I haven’t checked whether google sitemap lacks support for rss2 or whether it is just having trouble with the namespaces in the feed, but I didn’t have to as the workaround is simple.


You are probably using the /feed path for your sitemap url. This, by default, points to your rss2 feed.


To fix it:


   1. Go into your sitemap overview (Dashboard > Sitemaps) and delete the /feed sitemap.
   2. Click on the Add Sitemap menu item and add either your rss feed (/feed) or atom feed (/feed/atom) as the sitemap.
   3. Wait an hour or two and check back.


The new sitemap should now be working like a charm.
http://unravelthe.net/view/web/wordpress-and-google-webmaster-tools-sitemap/#more-51



Using FeedBurner with Google Webmaster Tools
Print


If you use Google Webmaster Tools and expect to submit a feed as the source for a sitemap of your blog or website, you should use your site’s original feed, and not your FeedBurner feed, for the sitemap to work properly. Here’s why:


If you use our feed stats services to track feed item clickthroughs, FeedBurner rewrites your item URLs so that we can track the clicks before sending suscribers back to your website to view the original content. These links use the feedburner.com domain, of course. Sitemaps expect the original domain of the website in question to be found in the feed in order to function properly; these feedburner.com-rewritten permalinks will not work and then cause Webmaster Tools to report a sitemaps error. This error can be completely sidestepped by providing your original source feed instead. Webmaster Tools won’t lack for any information or functionality as a result, and you can keep clickthrough tracking turned on in your FeedBurner feed.


One other point: if you have a site whose original feed redirects traffic to FeedBurner (for example, if you use Blogger redirection, or you use our FeedSmith plugin for WordPress), you will need to give Webmaster Tools the address of a feed that does not get redirected as a sitemap source.


For Blogger users, the following general feed URL format should always work:


http://mybloggerblog.blogspot.com/feeds/posts/default?redirect=false


For WordPress FeedSmith plugin users, use this URL format:


http://www.mywpblog.com/?feed=rss2


For all other platforms, other feed URL variations that are not redirected are what you need to provide.
http://www.google.com/support/feedburner/bin/answer.py?hl=en&answer=97090

标签:,
wordpress 2.8.4 - 九月 23, 2009 by yippee


Yesterday a vulnerability was discovered: a specially crafted URL could be requested that would allow an attacker to bypass a security check to verify a user requested a password reset. As a result, the first account without a key in the database (usually the admin account) would have its password reset and a new password would be emailed to the account owner. This doesn’t allow remote access, but it is very annoying.


昨天的一个漏洞被发现:当一个特别定义的网址被请求时,将允许攻击者绕过验证用户要求密码重设的安全检查。结果将导致,第一个在数据库中没有密钥的帐户(通常是管理员帐户)会把密码重置和一个新的密码通过电子邮件发送给该帐户的拥有者。这并不会导致允许远程访问,但它是非常令人烦恼的。

We fixed this problem last night and have been testing the fixes and looking for other problems since then. Version 2.8.4 which fixes all known problems is now available for download and is highly recommended for all users of WordPress.


我们昨晚解决了这个问题,自那时起一直在测试修复和寻找其他问题。2.8.4版本修复了所有已知的问题,现在已经可以下载,并强烈建议所有WordPress的用户升级。

标签:
Wordpress搬迁Mysql改表名改表编码 - 九月 14, 2009 by yippee

实在对国内的域名服务和空间服务忍无可忍了。
好像知道我周末不能上网似的,周末就访问不了了。
一到周一好像又正常了。

转个域名搞得要身份证复印件什么乱七八糟的
注册的时候倒是无所谓,一怒之下,准备废掉原来的,改用新的。

把原来的数据倒过去

alter table ip_to_country convert to character set utf8; 改编码


Alter   TABLE table_name RENAME TO new_table_name 改表名

301域名转向 乱七八糟看了很多,还是一个台湾人的实际管用

# BEGIN WordPress
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
rewriterule ^(.*)$ http://www.yippeesoft.com/$1 [L,R=301]
</IfModule>
# END WordPress
 http://steachs.com/archives/709
2、更換域名,主機也搬移:


此轉向必須舊主機及域名都在有效運作中


將.htaccess放置在舊主機根目錄中,語法如下


藍色部份為新域名


    RewriteEngine on


    RewriteRule (.*) http://www.yippeesoft.com/$1 [R=301,L]


~~~~~~~~~~~~~~~~~~

301转向的代码大全
http://www.wangyeba.com/Article/web02/wytx/200905/20090511113730.shtml



使用 .htaccess 实现 301 域名重定向 | 芒果
http://www.mangguo.org/use-htaccess-realize-301-domain-redirect/



使用 .htaccess 实现 301 域名重定向 | 芒果
http://www.mangguo.org/use-htaccess-realize-301-domain-redirect/



教不落更換網址囉,如何利用.htaccess設定301永久轉向? | 就是教不落
http://steachs.com/archives/709
RewriteRule ^sblog(.*)$ $1 [R=301,L]


htaccess 如何做 301轉向(301 Redirect) | cocolike – wordpress架設的選擇權blog
http://cocolike.com/blog/seo-301-redirect.html



如何更换域名301重定向 设置首选域 | 别先生说事
http://www.mrbie.com/html/301-redirect-preferred-domain.html



» WP搬家更换域名 无缝301完美转移 第七日
http://www.sntip.com/2009/04/wp-replacement-of-301-perfect.html



换域名,WordPress的301重定向简单方法 | FDS’s Blog
http://blog.1xi.net/seo/wordpress-301
换域名,WordPress的301重定向简单方法。首先你要肯定自己是Linux主机,然后如下操作。
打开你目录底下的.htaccess文件,在里面添加一句
RewriteRule ^(.*)$ http://blog.1xi.net/$1 [R=301,L],备注:把http://blog.1xi.net换成你要更换的域名。
这样就可以把所有的页面重定向到你新站所对应的页面,如:


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ http://blog.1xi.net/$1 [R=301,L]
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>


# END WordPress


Wordpress换域名301重定向的方法+本站启用新域名 | 小墨|博客
http://www.leinky.com/powered-opening-of-new-domain-names-for-domain-names-301-wordpress-redirect-the-way/



本站启用新域名+Wordpress换域名301重定向的方法-飞豆网
http://www.feedou.com/articlepickservlet?commandkey=singlearticle&articleID=5c42b7601add5ecb011ae94a883f1d31




漫谈WordPress安装、迁移 – 网站交流 – 主机分享组织 — 享您所想 | 万能求助,站长交流,空间分享,生活交友,网络资源,娱乐休闲,交天下知己!
http://www.hostshare.cn/thread-393-1-1.html



MySQL :: MySQL 5.1 Reference Manual :: 12.1.7 ALTER TABLE Syntax
http://dev.mysql.com/doc/refman/5.1/en/alter-table.html



My SQL 设置字符集 – 幸福的小牛的日志 – 网易博客
http://blog.163.com/cute_calf/blog/static/1160057782009716112810851/
查看编码:


show variables like ‘collation_%’;


show variables like ‘character_set_%’;


修改:


MySQL:修改默认字符集,转换字符集(MySQL 5.X)


1. 修改 MySQL 数据库默认字符集(mysql database default character set)


alter database testdb default character set = gb2312;


2. 修改 MySQL 数据表默认字符集(mysql table default character set)


alter table ip_to_country default character set = gb2312;


注意:修改 MySQL 的默认字符集,不管是在数据库级别,还是数据表级别,对已经存储的字符数据无任何改变。只是新增的表或列,开始使用新的字符集。


3. 转换 MySQL 数据表字符集(mysql table character set)


MySQL 中有一个数据表 ip_to_country,以前该表字符列数据都是以 utf8 编码格式存放的,现在想转换为 gb2312 编码格式存放。需要使用 MySQL 转换字符集命令:convert to character set


alter table ip_to_country convert to character set gb2312;


提示:convert to 也会把数据表 ip_to_country 的默认字符集从 utf8 更改为 gb2312。


4. 转换 MySQL 数据表中某个列的字符集(mysql column character set)


alter table ip_to_country modify country_name varchar(50) character set gb2312;


这个语句把单独一个列 country_name 的字符集转换为 gb2312。这在用法在实际中比较少见,因为大多数情况下,都是改变整个表的字符集。


 

标签:,
Wordpress的K2模板BUG - 九月 8, 2009 by yippee

Fatal error: Call to undefined function is_active_module() in /opt/lampp/htdocs/wordpress/wp-content/themes/k2/theloop.php on line 76

找了下资料,要是我自己的,就不用这个模板了

1. If you get this error:


    Fatal error: Call to undefined function: get_option() in [...]/wp-content/themes/k2/theloop.php on line 28


To fix this, disable all the plugins that load their own version of prototype.js.


这个也太狠了··其他用了prototype的插件都得禁用


I had a slight issue with the 2.2 Wordpress upgrade. I got a “undefined function is_active_module()” from k2. The solution was to run the uninstall k2 function from its options page. Then set the theme as current and all is well.


这个搞得只有两栏目了


I solved the problem with Call to undefined function: is_active_module() and can continue using the sidebar widgets that I love.
It is not clean but, commenting the code that manages asides works.
I have commented the lines 76 to 78 in theloop.php


//if (is_home() and is_active_module(‘asides_sidebar_module’)) {
// $hide_asides = true;
//}


I noticed that I had no problem with sidebar widgets in all the other pages but home.
Now everything works smoothly. Hopefully I will have some time in this century to see how I could save asides, but I do not use them :-)
这个不知道有没有什么后遗症··


Installation


    * Copy ‘TechnoBlue’ folder to the ’styles’ folder of TripleK2
    * Go to Presentation > K2 Options
    * Select technoblue.css as the K2 Scheme
    * Click ‘Update Options’ to save

标签:,
Wordpress的BBTHME主题修改HELLOFLASH为D13Slideshow - 八月 27, 2009 by yippee

安装了BBTHEMS,介绍可以参考:http://blog.iibetter.com/?p=10140 Wordpress主题下载该主题采用了HELLOFLASH作为幻灯片插件:参考了:
HelloFlash(WordPress幻灯片插件)的使用方法及注意事项
http://paranimage.com/5-wordpress-slideshow-plugins-for-featured-posts/

HelloFlash使用方法及注意事项
然而还是时而好,时而坏,一怒之下,决定换个插件。

上网看到:
5款WordPress推荐文章幻灯片插件
http://paranimage.com/5-wordpress-slideshow-plugins-for-featured-posts/
好像第一个不错的样子:D13design提供的一个WordPress插件,以Javascript幻灯片动画的形式展示推荐内容。包含图片,标题和摘要。可选输出5篇或10篇,后台选择要输出哪些文章。幻灯片样式可设为循环播放,只播放一次或手动导航,以及其它一些方便的设置。下载后安装,似乎正常,可是配置页面总是显示不完整,提示如下:
<b>Fatal error</b>:  Maximum execution time of 30 seconds exceeded in <b>D:\PhpNow\htdocs\wp\wp-includes\plugin.php</b> on line <b>385</b><br />
看了看代码:
global $post;
foreach($myposts as $post) :
setup_postdata($post); ?>
<option value=”<?php echo(the_ID()); ?>” <?php if($post->ID==$temp){ echo(“selected”); } ?>><?php echo $post->ID; ?>: <?php the_title(); ?></option>
<?php endforeach; ?>
</select>

看来是由于我的BLOG条目2000多条,太多了,导致超时了。

找了找资料,改成:
$querystr = “       SELECT *       FROM wp_posts       ORDER BY wp_posts.post_date DESC       LIMIT 0,20        “;
global $wpdb;
$pageposts = $wpdb->get_results($querystr);
foreach ($pageposts as $topten)
{
$postid = $topten->ID;
$title = $topten->post_title;
?>
<option value=”<?php echo $topten->ID; ?>”
<?php
if($topten->ID==$temp){ echo(“selected”); } ?>>
<?php echo $topten->ID; ?>:
<?php echo $topten->post_title; ?>
</option>      <?php }; ?>

只显示前面20个终于正常了··参考资料:

WordPress:Displaying Posts Using a Custom Select Query
http://www.zzbaike.com/wiki/WordPress:Displaying_Posts_Using_a_Custom_Select_Query
wordpress源代码分析之get_option()函数
http://hi.baidu.com/seriouscool/blog/item/929fbbdd0a9a7adf8d1029e9.html
http://wordpress.org/extend/plugins/d13slideshow/faq/
如何为你的wordpress主题添加幻灯片展示

标签:, ,
20090710 php sqlite wordpress - 八月 18, 2009 by yippee

今天开始折腾WP了


要在PHP5里面开启SQLITE支持


extension=php_pdo.dll
extension=php_pdo_sqlite.dll
extension=php_sqlite.dll


否则会报告:


Fatal error: Call to undefined function sqlite_open() in xxx.php on line XX


<?php
print_r(PDO::getAvailableDrivers());


      $db=sqlite_open(“db.sqlite”); //打开db.sqlite数据库,如果不存在则尝试创建。
 sqlite_query($db,”drop table test”);
 sqlite_query($db,”create table test (id INTEGER PRIMARY KEY,name text);”); //创建test表,id字段为自动递增主键
 sqlite_query($db,”insert into test (name) values(‘hello’);”); //插入一行内容
 sqlite_query($db,”insert into test (name) values(‘world’);”);//插入一行内容
 $result=sqlite_query($db,”select * from test”); //取得test表的所有内容
 while($row=sqlite_fetch_array($result)) { //通过while循环表中所有内容
   print “”;
   print_r($row); 
   print “”;
 }
 sqlite_close($db);//关闭数据库的连接


?>


输出:
Array ( [0] => mysql [1] => sqlite [2] => sqlite2 ) Array ( [0] => 1 [id] => 1 [1] => hello [name] => hello ) Array ( [0] => 2 [id] => 2 [1] => world [name] => world ) ?>


验证完后,按照 http://wordpress.org/extend/plugins/pdo-for-wordpress/installation/



  • Step 1: unzip the files in your wp-content directory. After unzipping the structure should look like this


    wp-content
    ->plugins
    ->themes
    ->pdo
    db.php
    index.php[maybe]


    The key thing is the presence of the pdo directory and the db.php file in the ‘root’ of the wp-content directory.



  • Step 2: Edit your wp-config.php file so that:


    this line of code is placed directly after the define(‘COLLATE’,”); line:

    define(‘DB_TYPE’, ’sqlite’);    //mysql or sqlite`

    Note: currently only mysql and sqlite are supported. I hope that more flavours will appear soon.


  •  

    标签:, , , ,
    20090709 wordpress sqlite url database - 八月 18, 2009 by yippee

    既然初步决定使用WP,就收集了一些相关的资料


    关于SQLITE:


    系统环境依赖要求:
    主机php套件必须支持SQLite和PDO扩展(不过放心,常见系统都是完美支持的);SQLite的数据库信息存于独立文件中,该文件及文件夹必须要求读写权限。很简单,就这些要求。


    升级更换wordpress数据系统:
    这里指出一个简易的方法:首先在wordpress后台中使用“工具-导出”功能导出.xml文件。


    然后,下载SQLite的wordpress功能插件-“PDO(SQLite) For Wordpress”,将压缩包中的db.php和pdo文件夹放置到wp-content文件夹中。


     


    然后,编辑wp-config.php文件,在define(‘DB_COLLATE’, ”); 后面加入“define(‘DB_TYPE’,’sqlite’);”。


    关于URL重写


    进入管理后台,点菜单紧靠右边的“设置”,点选其下的“永久链接”(Permalinks)
    点选“自定义,请在下面填入自定义结构”,再其下框里输入:/posts/%post_id%.html
    点页面右下按钮“更新永久链接结构>>”保存设置,此时在 Wordpress 的根目录自动生成里一 .htaccess 文件,内容大体如下:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /codemo/wordpress23/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /codemo/wordpress23/index.php [L]
    </IfModule>
    # END WordPress
    刷新下你的 Wordpress 首页,便会发现帖子链接都变成形如:http://www.yyyqi.com/codemo/wordpress23/posts/1.html 的静态页形式了,伪静态顺利实现!
    另,其它自定义永久链接写法及对应效果:
    0、
    Permalinks写法:/%year%/%monthnum%/%postname%/
    效果:http://www.yyyqi.com/2007/03/zero-to-riding-the-rails-in-four-months.html
    1、
    Permalinks写法:/%year%/%monthnum%/%day%/%postname%/
    效果:http://www.yyyqi.com/2007/10/14/zero-to-riding-the-rails-in-four-months/
    2、
    Permalinks写法:/%year%/%monthnum%/%postname%.html
    效果:http://www.yyyqi.com/2007/03/zero-to-riding-the-rails-in-four-months.html
    3、
    Permalinks写法:/%year%/%monthnum%/%day%/%postname%.html
    效果:http://www.yyyqi.com/2007/03/15/zero-to-riding-the-rails-in-four-months.html
    4、
    Permalinks写法:/%category%/%postname%.html
    效果:http://www.yyyqi.com/category/zero-to-riding-the-rails-in-four-months.html


    关于数据导入导出···
    wordpress数据库表基本结构:


    wp_options:系统基本设置信息;
    wp_users:注册用户基本信息;
    wp_usermeta:注册用户附加信息,主要包括权限等设置;
    wp_categories: 日记分类,友站链接(blogroll)也包含其中;分类之间也可以有从属关系;公开日记在category_count中计数,私人日记不计数;
    wp_links:友站链接(blogroll);
    wp_link2cat: 友站链接的分类;
    wp_posts:日记,其中的上传的附件和图片也作为其中的记录,不过类别不同,与日记存在从属关系;其中有几个字段好像没用,如: post_category,post_parent
    wp_post2cat:日记(包括附件)的分类;
    wp_postmeta:日记中的一些附加信息,也包括上传附件的一些附加信息,自定义字段也存在这里,如:Jerome’s Keywords的tag属性就是保存在这里的;
    wp_comments:评论,评论的游客的userid为0;


    wordpress仅仅用了 10 个 Table就实现了这么强大的系统,让我钦佩:


        wp_comments
        wp_links
        wp_options
        wp_postmeta
        wp_posts
        wp_term_relationships
        wp_term_taxonomy
        wp_terms
        wp_usermeta
        wp_users


    下面我们按照它们之间的关系来介绍一下这几个表:


    按照功能大致分为五类。


        * user: 用户信息,包括wp_users表和wp_usermeta表。
        * link:链接信息,包括wp_links表。
        * post: 文章及评论信息,包括wp_posts、wp_postmeta、wp_comments。
        * category,link_category,tag:这个是比较复杂的信息模块,它包含了对分类,链接分类,标签的管理,包括wp_term,wp_term_relationships和wp_term_taxonomy表。
        * option: 全局设置信息,包括wp_options表。


    wp_posts
    作为一个博客系统,最核心的当然是博主发表的一些“文章”了,这些“文章”存放的地方就是这个 wp_posts 表了。注意,这里所说的“文章”是加引号的,因为这个表里存放的除了普通的文章之外,还有附件和页面(page)的一些信息。表里面的 post_type 这个字段就是用来标示类型的。还有一点需要注意的就是,这个表里一些字段是针对于 post_type 的特定类型的,比如 menu_order 这个字段是“页面(page)”特有的,用来指定“页面”的顺序。post_mime_type 是针对附件的,来指定附件的类型。


    wp_postmeta
    每篇文章的属性是不可能仅仅用 wp_posts 表里的那几个字段来完全标示的,往往还有一些因人而异的属性:写这篇文章时候的心情,地点等等。这些属性的名称和值类型都是不确定的,因此,Wordpress 采用了元信息(meta)来表示它们。这个表很简单,只有 meta_id, post_id, meta_key, meta_value 这四个字段。post_id 是相关 post 的 id。我们注意到 meta_value 是 longtext 类型的,这里仅是用来存储值,至于值的确切类型,需要程序员来关心。
    在撰写文章的时候,我们可以发现编辑框下面有一个 Custom Fields 的选项,我们可以在这里添加 post 的 meta 信息。


    wp_comments
    用户评论。除了评论的内容以外,还记录了评论用户的名字,邮箱,网址,浏览器类型等信息。比较重要的两个字段是 comment_post_ID 和 comment_approved,前一个用来指示这条评论隶属于哪一篇文章,后一个用来记录审核状况。还有一个比较有意思的是这个 commnet_agent 字段,我们可以利用这个字段来统计一下用户浏览器类型。


    wp_users
    用户帐号表。存储用户名、密码还有一些用户的基本信息。


    wp_usermeta
    类似上面的 wp_postmeta,存储一些因人而异的用户信息。(比如QQ?ICQ?)


    wp_options
    用来记录 Wordpress 的一些设置和选项。里面有一个 blog_id 字段,这个应该是用在 MU 版里面来标示不同的 Blog 的。


    wp_links
    用来存储 Blogroll 里面的链接。


    wp_terms
    wp_term_relationships
    wp_term_taxonomy


    这三个表是这里面关系最复杂的了,在 Wordpress 2.2 及以前的版本中是没有这三个表的,代之的是 wp_categories、wp_post2cat 和 wp_link2cat 这三个表。对比这两个版本我们可以发现:在 2.2 版和之前的版本,post 和 link 和 category 的关系都是通过各自单独的表来记录的。而在 2.3 版中加入了 tag 的支持,Wordpress 把 post、link、tag 的分类都抽象成了统一的形式,用新的三个表来记录这些信息。
    wp_terms
    记录分类,链接分类,标签的一些简要信息,包括名称,缩写。


    wp_term_taxonomy
    是对wp_terms中的信息的关系信息补充,有所属类型(category,link_category,tag),详细描述,父类,所拥有文章(链接)数量。


    wp_term_relationships
    关系表,多对多的,object_id是与不同的对象关联,例如wp_posts中的ID(wp_links中的link_id)等,term_taxonomy_id就是关联wp_term_taxonomy中的term_taxonomy_id。

    标签:, , , ,
    20090708 wordpress bo-blog - 八月 18, 2009 by yippee

    用了这麽久BOBLOG文本版本,主版本早已经升级到MYSQL了。我这个也许久没有动过了,这几天正好练手.NET SQLITE等。就把BLOG备份到SQLITE里面了。所以这段时间也没有更新。不过FEEDSKY订阅居然还增加了几个,真是奇怪。


    居然已经2000多了。目前的BOBLOG似乎还撑得住,可是占用的空间越来越大了。因此也想试一试WORDPRESS了。


    找了一些资料:


    首先看到一个BOBLOG转WORDPRESS的:从Bo-Blog搬家到WordPress全程攻略。发现要数据库版本的BOBLOG,又找了通文本版本升级到数据库版本的·····实在晕


    http://www.bo-blog.com/weblog/read.php/343.htm


    1. 完整正常安装 Bo-Blog V2.0.1。
    2. 安装后进入2.0的后台,到文章管理中删除自动生成的第一篇日志。
    3. 到2.0的后台的分类管理中删除自动生成的分类 (如果此时程序报错,请忽略)。
    4. 到2.0后台的“数据维护”-“刷新缓存”中,选择“刷新计数器”选项下的“最大ID缓存”,按“确定”。
    5. 上传 convert.php 到您安装 1.7 的文件夹下并在浏览器内运行,按照这个程序的指导完成数据转换。
    6. 程序在完成数据转换后,会要求您填写数据库的一些信息,此时如实填写,即可将所有数据转入数据库中。
    7. 转换完成后,到后台的维护选项中,先刷新所有计数器项目,然后刷新所有缓存。
    8. 在2.0里重新设置联合撰写人,重新更改副管理员撰写的日志的作者。


    http://bbs.bo-blog.com/thread-7863-1-1.html 这里一堆安装包 2.0.3以下版本升级文件包。


    1.首先你得确保你的部落格程序的版本号为1.7.0108.2。
    如果程序为非此版本号,请先升级至该版本。
    程序升级文件包请访问该连接:http://bbs.bo-blog.com/viewthrea … &extra=page%3D1

    2.先将数据备份。这是很重要滴。然后下载1.7~2.0版本的转换程式。
    请访问这里获取:http://bbs.bo-blog.com/viewthread.php?tid=2806&extra=page%3D2

    3.全新安装一个2.0版本的程序。建议安装版本号为2.0.1 sp1版本的程序。
    请访问这里获取:http://bbs.bo-blog.com/viewthread.php?tid=7863&extra=page%3D1

    4.然后根据1.7~2.0的转换程式包里面的要求操作。将1.7的数据转换到2.0.1 sp1里。这里是很关键的一步。要仔细操作。转换成功之后后面的工作会比较容易了。

    5.如果数据成功完整的转换到2.0.1sp1里,那么接下来就开始从这个版本上往上升级至2.1.1版本。请根据下面的向导操作,各个版本之间不可跳跃式升级。因为每个版本之间的数据库都有较大改动,跳跃式升级会带来不可预想的错误。

    2.0.1 sp1 –>2.0.2 sp2 –>2.0.3 beta 1 –>2.0.3 –>2.0.3 sp1 –>2.1.0 –>2.1.1

    建议按照该顺序进行升级。在操作前还是要说一句,请仔细阅读文件包内的相关升级说明后再操作。

    标签:, , , ,
    20090730 c# xml rpc wordpress - 八月 18, 2009 by yippee

    采用 WordPress API wrapper for .Net.


    在POST结构增加


     public string mt_keywords; //标签
            public string wp_slug; //URL别名


    Post pp = new Post();
                    pp.title = nl.name;
                    pp.description = nl.txt;
                    pp.dateCreated = DateTime.Parse(nl.time);
                    TreeNode[] ts = treeType.Nodes.Find(nl.parent, true);
                    if (ts.Length > 0)
                    {
                        pp.categories = new string[] { ts[0].Text };
                        
                    }
                    pp.wp_slug = nl.p;
                    string[] stags = nl.p.Split(‘-’);
                    string strtag = “”;
                    for (int i = 1; i < stags.Length;i++ )
                    {
                        strtag = stags[i] + “,” + strtag;
                    }
                    pp.mt_keywords = strtag;



                    string s = wp.NewPost(pp, true);


    将别名分拆后组成TAG


    然后发布,返回BLOGID号


     

    标签:, , , ,
    20090723 wordpress WP Cleaner - 八月 18, 2009 by yippee

    20090723 wordpress WP Cleaner

    WP Cleaner v1.0.1
    用了这个插件手工清除

    这个方法好像太麻烦了
    关掉wordpress的自动保存(autosave)功能
    方法:在wordpress目录/wp-admin/中找到以下四个文件:
    post-new.php
    page-new.php
    post.php
    page.php

    用文本编辑工具打开后在其中搜索“autosave”(不包括引号),都会在相应位置找到这样的一行:

    wp_enqueue_script(‘autosave’);

    通过在该行前加入“//”(不包括引号)来将这一行注释掉,保存。
    这个方法好像无效
    关掉WP自动保存,一劳永逸:

    首先,打开你的代码编辑器,我用的是EditPlus(小巧玲珑),把下面的代码粘帖上去。

    <?php
    /*
    Plugin Name: Disable Autosave
    */
    function disable_autosave() {
    wp_deregister_script(’autosave’);
    }
    add_action( ‘wp_print_scripts’, ‘disable_autosave’ );
    ?>

    保存为close-wp-autosave.php或者其它名字(字母),但是后缀一定要是.php,然后上传到你网站的plugin目录里,然后去管理页面的插件里激活它。就可以自动生效了

    用了个超级切换插件 好像也无效

    WordPress 给用户和插件开发者预留了一个参数,WP_POST_REVISIONS,可以让你轻松关闭文章版本管理功能。

    你可以直接在 wp-config.php 文件中定义 WP_POST_REVISIONS 这个常量,其共有三个参数:

    * true, –1: 默认值,将存储文章每一次的修订;
    * false, 0: 不保存任何修订的版本,但自动保存功能依然有效;
    * >0 的整数: 最多保留的版本数量,超过此数的版本将被删除。

    标签:,
    20090730 wordpress c# xml rpc info - 八月 18, 2009 by yippee

    WordPress 2.7 XML-RPC wrapper for .Net
    http://www.orbifold.net/default/?p=1721
    XML-RPC.Net
    http://www.xml-rpc.net/
    WordPress 2.5 XML-RPC wrapper for .Net
    http://www.orbifold.net/default/?p=1003
    Using Wordpress XMLRPC services | PHP Made Simple
    http://www.phpmadesimple.info/2009/07/05/using-wordpress-xmlrpc-services/
    Weblog Client « WordPress Codex
    http://codex.wordpress.org/Weblog_Client
    3.4. C# XML-RPC Tutorial
    http://www.wordtracker.com/docs/api/ch03s04.html
    CodeProject: Coding Blog Engine with MetaWeblog API Support and Using it with Windows Live Writer. Free source code and programming help
    http://www.codeproject.com/KB/XML/MetaWeblogAPI.aspx?display=Print
    WP-XML-RPCLib2 – SharpLab.
    http://blog.sharplab.net/computer/cprograming/wp-xml-rpclib/3015/
    WP-XML-RPCLib2 – SharpLab.
    http://blog.sharplab.net/computer/cprograming/wp-xml-rpclib/computer/cprograming/wp-xml-rpclib/3015/
    CodeProject: Coding Blog Engine with MetaWeblog API Support and Using it with Windows Live Writer. Free source code and programming help
    http://www.codeproject.com/KB/XML/MetaWeblogAPI.aspx
    MetaWebLog API and Blog Writers – Rick Strahl’s Web Log
    http://www.west-wind.com/WebLog/posts/23858.aspx
    Windows Live Writer Beta 2 Now Available
    http://www.gtrifonov.com/blog/2007/06/06/Windows_Live_Writer_Beta_2_Now_Available.aspx
    Coding blog engine with MetaWeblog API support and using it with Windows Live Writer
    http://www.gtrifonov.com/blog/2006/11/27/Coding_blog_engine_with_MetaWeblog_API_support_and.aspx
    15 Seconds : Programming for the Palm Part 2 – The Synchronization Process
    http://www.15seconds.com/Issue/030722.htm
    C# blog client
    http://www.aspcode.net/C-blog-client.aspx
    The MetaBlog API (Creating and Editing Posts)
    http://geekswithblogs.net/Tariq/archive/2009/07/05/133264.aspx
    public string wp_slug;

    XML-RPC Request Format
    http://www.tutorialspoint.com/xml-rpc/xml_rpc_request.htm
    3.4. C# XML-RPC Tutorial
    http://www.wordtracker.com/docs/api/ch03s04.html

    标签:, , , , ,