Improved Wordpress-Importer

Found a bug? Tell us!!
Post Reply
Jtb
Regular
Posts: 25
Joined: Sun Jan 21, 2007 11:52 pm

Improved Wordpress-Importer

Post by Jtb »

Hi,

just a small patch for wordpress.inc.php

Code: Select all

51a52
>
95a97
>
167c169,170
<         $res = @$this->nativeQuery("SELECT * FROM {$this->data['prefix']}posts ORDER BY post_date;", $wpdb);
---
>         // We want only real posts - not attachments or static pages
>         $res = @$this->nativeQuery("SELECT * FROM {$this->data['prefix']}posts where post_status IN('publish', 'draft') ORDER BY post_date;", $wpdb);
173a177,181
>
>             // Split entries at more-tag - there will be only one, but to be safe we split only at the first more-tag
>             $content = explode("<!--more-->", $entries[$x]['post_content'], 2);
>             $body = $content[0];
>             $extended = $content[1];
179c187,188
<                            'body'           => $this->strtr($entries[$x]['post_content']));
---
>                            'body'           => $this->strtr($body),
>                            'extended'       => $this->strtr($extended));
Jens
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: Improved Wordpress-Importer

Post by garvinhicking »

Hi!

Thanks a lot for that patch, I just committed it. I made the import of staticpages/attachments optional, so that people are still able to import them as blog entries if they like.

Many thanks,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply