Import blog
- Status
- Open
- Subject
- Import blog
- Category
- Feature request
- Feature
- Wiki (page view, edit, history, rename, etc)
Blog - Submitted by
- Nicolamr
- Lastmod by
- Nicolamr
- Rating
- Description
- It should be easier for new users to migrate to tikiwiki: an import blog function (e.g. from wordpress) would help.
- Workaround
Ok, lets release early!
tikiwiki 3.0
exported file from wordpress 2.7.1- doesn't consider page creators
- doesn't import comments
- no wiki 2 html
- no file validation
- doesn't import history
tiki-import_wpdump.phpCopy to clipboard<?php error_reporting( E_ALL ); require_once( 'tiki-setup.php' ); require_once( 'import/import_wordpress_dump.php' ); header( 'Content-Type: text/plain' ); if( $tiki_p_admin != 'y' ) die( 'Admin access required' ); if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { $dom = new DOMDocument; $dom->load( $_FILES['importfile']['tmp_name'] ); echo "Processing...\n"; flush(); $importer = new ImportWordPressDump; $importer->import( $dom ); exit; } header( 'Content-Type: text/html' ); ?> <html> <head> <title>Import Wordpress-Style Tiki Dump</title> </head> <body> <form method="post" enctype="multipart/form-data" action=""> <input type="file" name="importfile"/> <input type="submit" value="Import"/> </form> </body> </html>/import/import_wordpress_dump.phpCopy to clipboard<?php //this script may only be included - so its better to die if called directly. if ( basename($_SERVER['SCRIPT_NAME']) == basename(__FILE__) ) { header("location: index.php"); exit; } class ImportWordPressDump { function import( DOMDocument $dom ) { $pages = $dom->getElementsByTagName('item'); foreach( $pages as $page ) { $data = $this->extractInfo( $page ); $this->importPage( $data ); } } function extractInfo( DOMElement $element ) { $data = array(); $data['revisions'] = array(); foreach( $element->childNodes as $node ) if( $node instanceof DOMElement ) { $data[$node->tagName] = (string) $node->textContent; } return $data; } function importPage($data) { global $tikilib; if( $tikilib->page_exists( $data['title'] ) ) { print "Page already exists, no action taken: {$data['title']}\n"; return; } $tikilib->create_page($data['title'], 0, $data['content:encoded'], strtotime($data['wp:post_date'])); $this->oldidnames['wp:post_id'] = $data['title']; } } ?>- Priority
- 25
- Demonstrate Bug on Tiki 19+
-
This bug has been demonstrated on show2.tiki.org
Please demonstrate your bug on show2.tiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show2.tiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Demonstrate Bug (older Tiki versions)
-
This bug has been demonstrated on show.tikiwiki.org
Please demonstrate your bug on show.tikiwiki.org
Show.tiki.org is not configured properlyThe public/private keys configured to connect to show.tikiwiki.org were not accepted. Please make sure you are using RSA keys. Thanks.
- Ticket ID
- 2673
- Created
- Thursday 13 August, 2009 12:44:49 UTC
by Unknown - LastModif
- Sunday 16 August, 2009 17:26:38 UTC