'; echo '

'.__('Import RSS').'

'; } function footer() { echo ''; } function unhtmlentities($string) { // From php.net for < 4.3 compat $trans_tbl = get_html_translation_table(HTML_ENTITIES); $trans_tbl = array_flip($trans_tbl); return strtr($string, $trans_tbl); } function greet() { echo '

'.__('Howdy! This importer allows you to extract posts as well as comments from any RSS 2.0 file into your blog. This is useful if you want to import your posts from a system that is not handled by a custom import tool. Pick an RSS file to upload and click Import.

Note that you could also import your comments. Just make sure your comments exist within each "Item" element in the following format:

<comment>
  <author>Commenter name</author>
  <email>Commenter email</email>
  <url>Commenter website</url>
  <date>Comment date</date>
  <content>Comment text</content>
</comment>

Remember that you may have multiple occurances of comment element within each "Item" element (because a post can have many associated comments). Duplicate comments would automatically be ignored.').'

'; wp_import_upload_form("admin.php?import=rss&step=1"); } //function get_posts() { function import_posts_with_comments() { global $wpdb; echo(''); } function import() { $file = wp_import_handle_upload(); if ( isset($file['error']) ) { echo $file['error']; return; } $this->file = $file['file']; $this->import_posts_with_comments(); wp_import_cleanup($file['id']); echo '

'; printf(__('All done. Have fun!'), get_option('home')); echo '

'; } function dispatch() { if (empty ($_GET['step'])) $step = 0; else $step = (int) $_GET['step']; $this->header(); switch ($step) { case 0 : $this->greet(); break; case 1 : $this->import(); break; } $this->footer(); } function RSS_Import() { // Nothing. } } $rss_import = new RSS_Import(); register_importer('rss', 'RSS', __('Import posts from an RSS feed'), array ($rss_import, 'dispatch'));