Page 1 of 1

Improved Wordpress-Importer

Posted: Sun Jan 21, 2007 11:55 pm
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));

Re: Improved Wordpress-Importer

Posted: Mon Jan 22, 2007 11:46 am
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