From f598aff5b695d959a487ef7505bd9fdb41767d1d Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sat, 18 Feb 2006 00:06:33 +0000 Subject: [PATCH] greymatter importer from bungeman. fixes #2464 git-svn-id: https://develop.svn.wordpress.org/trunk@3546 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/import/greymatter.php | 312 +++++++++++++++++++++++++++++++++ 1 file changed, 312 insertions(+) diff --git a/wp-admin/import/greymatter.php b/wp-admin/import/greymatter.php index e69de29bb2..809512d22f 100644 --- a/wp-admin/import/greymatter.php +++ b/wp-admin/import/greymatter.php @@ -0,0 +1,312 @@ +'; + echo '

'.__('Import Graymatter').'

'; + } + + function footer() { + echo ''; + } + + function greet() { + $this->header(); +?> +

This is a basic GreyMatter to WordPress import script.

+

What it does:

+ +

What it does not:

+ +

 

+ +
+ + +

Second step: GreyMatter details:

+

+ + + + + + + + + + + + + + + +
Path to GM files:
Path to GM entries:

This importer will search for files 00000001.cgi to 000-whatever.cgi,
so you need to enter the number of the last GM post here.
(if you don't know that number, just log into your FTP and look it out
in the entries' folder)
Last entry's number:
+

+

When you're ready, click OK to start importing:

+
+

 

+footer(); + } + + + + function gm2autobr($string) { // transforms GM's |*| into b2's
\n + $string = str_replace("|*|","
\n",$string); + return($string); + } + + function import() { + global $wpdb; + + $wpvarstoreset = array('gmpath', 'archivespath', 'lastentry'); + for ($i=0; $iheader(); +?> +

The importer is running...

+ +

 

+

Completed Greymatter import !

+footer(); + } + + function dispatch() { + if (empty ($_GET['step'])) + $step = 0; + else + $step = (int) $_GET['step']; + + switch ($step) { + case 0 : + $this->greet(); + break; + case 1: + $this->import(); + break; + } + } + + function GM_Import() { + // Nothing. + } +} + +$gm_import = new GM_Import(); + +register_importer('greymatter', 'Greymatter', __('Import posts and comments from your Greymatter blog'), array ($gm_import, 'dispatch')); +?>