/dev/null

Static is evil.

April 30, 2008

Uluru and other photos from Australia added

23:30


Uluru, originally uploaded by Michael Zero Mayer.

I finally managed to upload some of my good old Australia photos to flickr :)

WordPress 2.5.1 bugs

23:10

  • First of all, the classic theme mixes up the “Newer Posts” and “Older Posts” in the page footer. The link to the next page should be “Older Posts” of course, because the latest posts are on the first page.
  • For one reason or another, there are two versions of the search widget: One built-in that comes with the theme and one is “dynamic” and comes from wp-includes/widgets.php. The first one has a title “Search:”, the last one doesn’t have a title nor can you enter one. To fix this, I added <label for=”s”><?php _e(‘Search’); ?></label> to line 462 in widgets.php.

WordPress forum…

Switched from Drupal 5 to WordPress 2.5

Tags: — 13:37

After having trouble with the Drupal upgrade I decided to give WordPress a try. The funny thing is to copy the existing posts to the new tables. If you got the same problem, you can use this view:

CREATE VIEW wp_import AS SELECT a.nid AS ID, 1 AS post_author, FROM_UNIXTIME(a.created) AS post_date, FROM_UNIXTIME(a.created) AS post_date_gmt, b.body AS post_content, b.title AS post_title, 0 AS post_category, b.teaser AS post_except, ‘publish’ AS post_status, ‘open’ AS comment_status, ‘open’ AS ping_status, ” AS post_password, ‘post’ + a.nid AS post_name, ” AS to_ping, ” AS pinged, FROM_UNIXTIME(a.changed) AS post_modified, FROM_UNIXTIME(a.changed) AS post_modified_gmt, ” AS post_content_filtered, 0 AS post_parent, a.nid AS guid, 0 AS menu_order, ‘post’ AS post_type, ” AS post_mime_type, 0 AS comment_count FROM node a JOIN node_revisions b ON a.nid = b.nid WHERE a.type = ‘blog’ AND a.nid > 1 AND a.status = 1;

Then you can easily import all your stuff (without the images, sorry):

INSERT wordpress.wp_posts SELECT * FROM wp_import;

Wanna convert your custom markup to HTML? No problem, just run this query (works for cached content only, so you might want to click on each of your older posts once as a quick fix):

UPDATE wordpress.wp_posts w, (SELECT a.nid, b.data AS filtered FROM node_revisions a, cache_filter b WHERE CONCAT_WS(‘:’, a.format, MD5(a.body)) = b.cid) AS c SET post_content = c.filtered WHERE c.filtered IS NOT NULL AND w.ID = c.nid;

There might be a way to import a Drupal blog via RSS as well – let’s see if somebody answers to my posting on the WordPress support forum.

Update (6.5.2008)

I found another blog post that explains how to migrate from Drupal 5 to WordPress 2.0. The provided SQL script also converts categories and comments, which mine does not. However, it does not care about input filters, so Wikicode will not be converted to HTML. The perfect solution would be a combination of our scripts ;)

Powered by PHP, Memcached, Suhosin, MySQL and WordPress