Saturday, January 26, 2008

The Most Popular RSS Reader In China

For the reason of language, a lot of peoples use local RSS Reader in China. Here is the most popular RSS reader in China, except Google Reader and Bloglines.

ZhuaXia: An earlier professional RSS reader. But seems stop update now.

XianGuo: Another professional RSS reader, with a lot of function better than other. I think it is the best RSS reader in China.

YouDao: A RSS reader from the Netease, Netease is the most biggest website in China, and the third biggest portal website after Sina Corp and Sohu.

QQ reader: RSS reader from Tencent QQ. Tencent QQ is the most popular free instant messaging computer program in China, and the world's third most popular IM service.

Wednesday, January 16, 2008

WordPress MU Optimization Script

WordPress MU will be automatically established more than 10 tables when a new user register, so when a large number of users register will caused a lot of problem. Then I write some performance scripts can delete the WordPress MU inactive users.

The PHP source code as follows:


  $mysql_host = "localhost";
  $mysql_user = "root";
  $mysql_pass = "";
  $mysql_db = "wordpress";
  $mysql_mylink = mysql_connect($mysql_host, $mysql_user, $mysql_pass)
  or die ("Cannot make the connection");
  mysql_select_db($mysql_db, $mysql_mylink)
  or die ("Cannot connect to the database");
  $strsql="select * from wp_blogs where blog_id>2 ";
  $rs_query = mysql_query($strsql);
  $alls=mysql_num_rows($rs_query);
  while (($RS = mysql_fetch_array($rs_query))) {
  extract($RS);
  $blogid=$RS["blog_id"];
  $query2 = "select * from wp_".$blogid."_posts ";
  $result = mysql_query($query2);
  $num= mysql_num_rows($result);
  //print $num;
  if ($num<=2) {
  print "DROP TABLE IF EXISTS wp_".$blogid."_comments;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_links ;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_options ;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_postmeta ;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_posts ;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_terms ;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_term_relationships ;";
  print "DROP TABLE IF EXISTS wp_".$blogid."_term_taxonomy ;";
  print "DELETE from wp_blogs where blog_id=".$blogid.";";
  }
  }
  mysql_close ();

Wednesday, January 9, 2008

Custom WordPress Database Error Page

From what i have mentioned before, we can use a program to monitor the WordPress MySQL server, when the server is down, WordPress will auto send an e-mail and write to a text log file in a recorded. Now, WordPress 2.3.2, the latest version of the popular blogging platform allows you to define a custom database error page.

It is very simple. Just follow the following steps and within a few minutes your custom database error page is ready!

First, upload a file named log.txt to the WordPress root directory, chmod it to 666.

Second, Download the file db-error.php and upload it to WordPress content directory(wp-content/db-error.php).

Finally, replace the e-mail address of the code to your own e-mail.

That's it! From now on this error file will be report the error whenever your WordPress blog has encountered some trouble connecting to the database server.