Make WordPress Core


Ignore:
Timestamp:
04/11/2004 05:36:45 PM (21 years ago)
Author:
saxmatt
Message:

Turn magic quotes runtime off, fix english, normalize newlines going in.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/import-mt.php

    r847 r1059  
    11<?php
    22define('MTEXPORT', '');
     3
     4
    35if (!file_exists('../wp-config.php')) die("There doesn't seem to be a wp-config.php file. You must install WordPress before you import any entries.");
    46require('../wp-config.php');
     
    1416    body {
    1517        font-family: Georgia, "Times New Roman", Times, serif;
    16         margin-left: 15%;
    17         margin-right: 15%;
     18        margin-left: 20%;
     19        margin-right: 20%;
    1820    }
    1921    #logo {
     
    4244    case 0:
    4345?>
    44 <p>Howdy! We're about to begin the process to import all of your Movable Type entries into WordPress. It's pretty easy, but it can possible take a little bit of time so be patient. Before we get started, you need to edit this file (<code>import-mt.php</code>) and change one line so we know where to find your MT export file. Look for the line that says:</p>
     46<p>Howdy! We&#8217;re about to begin the process to import all of your Movable Type entries into WordPress. Before we get started, you need to edit this file (<code>import-mt.php</code>) and change one line so we know where to find your MT export file. To make this easy put the import file into the <code>wp-admin</code> directory. Look for the line that says:</p>
    4547<p><code>define('MTEXPORT', '');</code></p>
    4648<p>and change it to</p>
    47 <p><code>define('MTEXPORT', '/path/to/your/import.txt');</code></p>
     49<p><code>define('MTEXPORT', 'import.txt');</code></p>
    4850<p>You have to do this manually for security reasons.</p>
    4951<p>If you've done that and you&#8217;re all ready, <a href="import-mt.php?step=1">let's go</a>! Remember that the import process may take a minute or so if you have a large number of entries and comments. Think of all the rebuilding time you'll be saving once it's done. :)</p>
    5052<p>On our test system, importing a blog of 1189 entries and about a thousand comments took 18 seconds. </p>
    51 <p>The importer is smart enough not to import duplicates, so you can run this multiple times without worry if for whatever reason it doesn't finish. </p>
     53<p>The importer is smart enough not to import duplicates, so you can run this multiple times without worry if&#8212;for whatever reason&#8212;it doesn't finish. </p>
    5254<?php
    5355    break;
     
    7072
    7173// Bring in the data
     74set_magic_quotes_runtime(0);
    7275$datalines = file(MTEXPORT); // Read the file into an array
    7376$importdata = implode('', $datalines); // squish it
     77$importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
     78
    7479$posts = explode("--------", $importdata);
    7580$i = -1;
     
    7883    ++$i;
    7984    unset($post_categories);
    80     $post = preg_replace("/(\r\n|\n|\r)/", "\n", $post);
    8185    echo "<li>Importing post... ";
    8286
Note: See TracChangeset for help on using the changeset viewer.