存档

文章标签 ‘wordpress’

How to Delete WordPress Post Revisions

2010年1月12日 T 2 条评论

Just take a note, maybe I will use it someday. My memeries do not always serve me, tha’s so sad, -_-!!

As we all know WordPress saves your drafts automatically, that leaves a lot of revisions as backups on the server. It’s good, who wouldn’t  piss off if he typed for a long time and encountered some accidents like computer shut down for no reason. But on the other hand, when my articles posted, in most of the cases, I don’t need these revisions any more. Leaves them on the server as redundancy is useless and I guess they are adverse to the server’s performance. O.K., then things get really simple: KILL THEM ALL!

Try to access your WordPress database through some tools like phpMyAdmin(that’s the only tool I familiar with…), follow the steps below:

  1. Your database
  2. SQL
  3. type the following codes
    DELETE FROM wp_posts WHERE post_type = "revision";
  4. then press the button “Go”

Job Done.

分类: computer, study_note 标签: ,

WordPress升级到2.9后的一个问题

2009年12月29日 T 没有评论

WordPress升级到2.9后莫名其妙地发现首页google reader shared items显示不正常,而后台控制板里也出现相同问题,都出现了如下的错误提示:

Warning: curl_setopt() [function.curl-setopt]: CURLPROTO_FILE cannot be activated when in safe_mode or an open_basedir is set in …

当时立马去google,发现很多人在报同样的问题但没什么解决方案,有的说是插件问题,停用再重启就好了,我也没这个精力去搞,首页停了google reader shared items的插件就没管了,想想等这官方的升级就应该可以解决了。今天又查查 了,官方好像依然没啥反应,但wordpress论坛又有大神出没,感谢eric.fournier提供的解决方案(具体参考这里,eric.fournier大神在13楼):
编辑文件 /wp-includes/http.php 找到第1300行,将

if ( defined( 'CURLOPT_TIMEOUT_MS' ) ) {
$timeout_ms = (int) ceil( 1000 * $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT_MS, $timeout_ms );
curl_setopt( $handle, CURLOPT_TIMEOUT_MS, $timeout_ms );
} else {
$timeout = (int) ceil( $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
}

替换为

if ( defined( 'CURLOPT_TIMEOUT_MS' ) ) {
// EDF - The option doesn't work with safe mode or when open_basedir is set. More
// research is probably necessary however this seems to fix the problems I was
// seeing in the "WordPress Development Blog" section of the Dashboard.
if ( !ini_get('safe_mode') && !ini_get('open_basedir') ) {
$timeout_ms = (int) ceil( 1000 * $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT_MS, $timeout_ms );
curl_setopt( $handle, CURLOPT_TIMEOUT_MS, $timeout_ms );
}
} else {
$timeout = (int) ceil( $r['timeout'] );
curl_setopt( $handle, CURLOPT_CONNECTTIMEOUT, $timeout );
curl_setopt( $handle, CURLOPT_TIMEOUT, $timeout );
}

O.K.,圆满解决。


update: 插件(Recommended Reading: Google Reader Shared)依然有问题,每次配置完以后是好的,首页一刷新,设置就丢了,比较奇怪。看了看官方论坛,放出了wordpress 2.9 beta1,装上以后对我的问题仍然没有解决。期待后续的正式版能解决。

关于Godaddy上架设Wordpress那点事

2009年8月25日 T 没有评论

图床在picasa,不能翻墙的朋友就掠过,略过吧。

遭遇三个问题:

  1. 问题描述:遭遇error,名为“Cannot modify header information…”。
    解决办法:将wp-config.php从主机上下载下来,用记事本等文本编辑器打开,再另存一遍,注意编码用ANSI
  2. 问题描述:Godaddy上架设Wordpress,那么wp-config.php里的MySQL主机名可就不是”localhost”了。(我梦游的主机上就是localhost,不知道是哪个主机比较另类。。?)那么MySQL主机名在哪里呢?
    解决办法:说大不清楚,还是看图说话吧。
  3. From Drop
    From Drop Box
    From Drop Box
    From Drop Box
    From Drop Box
    From Drop Box
    From Drop Box
  4. 问题描述:关于域名重定位,比如希望打开http://xxx.net自动转到http://xxx.net/blog
    解决办法:暂无。指标不治本的方法,是在http://xxx.net的首页里添加一句”<meta http-equiv=”refresh” content=”0.1;url=http://xxx.net/blog”>“,但这样访问者仍能看到http://xxx.net的预设页面,不是很爽。求解!