WordPress.org

Plugin Directory

Changeset 279927


Ignore:
Timestamp:
08/23/10 22:13:58 (4 years ago)
Author:
ryan
Message:

Text updates. Better BASENAME processing. Props niallkennedy. see #WP14677

Location:
movabletype-importer/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • movabletype-importer/trunk/languages/movabletype-importer.pot

    r247848 r279927  
    6565#: movabletype-importer.php:209 
    6666msgid "" 
    67 "Below, you can see the names of the authors of the MovableType posts in " 
     67"Below, you can see the names of the authors of the Movable Type posts in " 
    6868"<em>italics</em>. For each of these names, you can either pick an author in " 
    6969"your WordPress installation from the menu, or enter a name for the author in " 
  • movabletype-importer/trunk/movabletype-importer.php

    r279921 r279927  
    66Author: wordpressdotorg 
    77Author URI: http://wordpress.org/ 
    8 Version: 0.3 
    9 Stable tag: 0.3 
     8Version: 0.4 
     9Stable tag: 0.4 
    1010License: GPL v2 - http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 
    1111*/ 
     
    207207<h2><?php _e('Assign Authors', 'movabletype-importer'); ?></h2> 
    208208<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin&#8217;s entries.', 'movabletype-importer'); ?></p> 
    209 <p><?php _e('Below, you can see the names of the authors of the MovableType posts in <em>italics</em>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.', 'movabletype-importer'); ?></p> 
     209<p><?php _e('Below, you can see the names of the authors of the Movable Type posts in <em>italics</em>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.', 'movabletype-importer'); ?></p> 
    210210<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user&#8217;s details if necessary.', 'movabletype-importer'); ?></p> 
    211211    <?php 
     
    373373            } else if ( 'PING:' == $line ) { 
    374374                $context = 'ping'; 
    375             } else if ( 0 === strpos($line, "AUTHOR:") ) { 
    376                 $author = trim( substr($line, strlen("AUTHOR:")) ); 
     375            } else if ( 0 === strpos($line, 'AUTHOR:') ) { 
     376                $author = trim( substr($line, strlen('AUTHOR:')) ); 
    377377                if ( '' == $context ) 
    378378                    $post->post_author = $author; 
    379379                else if ( 'comment' == $context ) 
    380380                     $comment->comment_author = $author; 
    381             } else if ( 0 === strpos($line, "TITLE:") ) { 
    382                 $title = trim( substr($line, strlen("TITLE:")) ); 
     381            } else if ( 0 === strpos($line, 'TITLE:') ) { 
     382                $title = trim( substr($line, strlen('TITLE:')) ); 
    383383                if ( '' == $context ) 
    384384                    $post->post_title = $title; 
    385385                else if ( 'ping' == $context ) 
    386386                    $ping->title = $title; 
    387             } else if ( 0 === strpos($line, "STATUS:") ) { 
    388                 $status = trim( strtolower( substr($line, strlen("STATUS:")) ) ); 
     387            } else if ( 0 === strpos($line, 'BASENAME:') ) { 
     388                $slug = trim( substr($line, strlen('BASENAME:')) ); 
     389                if ( !empty( $slug ) ) 
     390                    $post->post_name = $slug; 
     391            } else if ( 0 === strpos($line, 'STATUS:') ) { 
     392                $status = trim( strtolower( substr($line, strlen('STATUS:')) ) ); 
    389393                if ( empty($status) ) 
    390394                    $status = 'publish'; 
    391395                $post->post_status = $status; 
    392             } else if ( 0 === strpos($line, "ALLOW COMMENTS:") ) { 
    393                 $allow = trim( substr($line, strlen("ALLOW COMMENTS:")) ); 
     396            } else if ( 0 === strpos($line, 'ALLOW COMMENTS:') ) { 
     397                $allow = trim( substr($line, strlen('ALLOW COMMENTS:')) ); 
    394398                if ( $allow == 1 ) 
    395399                    $post->comment_status = 'open'; 
    396400                else 
    397401                    $post->comment_status = 'closed'; 
    398             } else if ( 0 === strpos($line, "ALLOW PINGS:") ) { 
    399                 $allow = trim( substr($line, strlen("ALLOW PINGS:")) ); 
     402            } else if ( 0 === strpos($line, 'ALLOW PINGS:') ) { 
     403                $allow = trim( substr($line, strlen('ALLOW PINGS:')) ); 
    400404                if ( $allow == 1 ) 
    401405                    $post->ping_status = 'open'; 
    402406                else 
    403407                    $post->ping_status = 'closed'; 
    404             } else if ( 0 === strpos($line, "CATEGORY:") ) { 
    405                 $category = trim( substr($line, strlen("CATEGORY:")) ); 
     408            } else if ( 0 === strpos($line, 'CATEGORY:') ) { 
     409                $category = trim( substr($line, strlen('CATEGORY:')) ); 
    406410                if ( '' != $category ) 
    407411                    $post->categories[] = $category; 
    408             } else if ( 0 === strpos($line, "PRIMARY CATEGORY:") ) { 
    409                 $category = trim( substr($line, strlen("PRIMARY CATEGORY:")) ); 
     412            } else if ( 0 === strpos($line, 'PRIMARY CATEGORY:') ) { 
     413                $category = trim( substr($line, strlen('PRIMARY CATEGORY:')) ); 
    410414                if ( '' != $category ) 
    411415                    $post->categories[] = $category; 
    412             } else if ( 0 === strpos($line, "DATE:") ) { 
    413                 $date = trim( substr($line, strlen("DATE:")) ); 
     416            } else if ( 0 === strpos($line, 'DATE:') ) { 
     417                $date = trim( substr($line, strlen('DATE:')) ); 
    414418                $date = strtotime($date); 
    415419                $date = date('Y-m-d H:i:s', $date); 
     
    425429                    $ping->comment_date = $date; 
    426430                } 
    427             } else if ( 0 === strpos($line, "EMAIL:") ) { 
    428                 $email = trim( substr($line, strlen("EMAIL:")) ); 
     431            } else if ( 0 === strpos($line, 'EMAIL:') ) { 
     432                $email = trim( substr($line, strlen('EMAIL:')) ); 
    429433                if ( 'comment' == $context ) 
    430434                    $comment->comment_author_email = $email; 
    431435                else 
    432436                    $ping->comment_author_email = ''; 
    433             } else if ( 0 === strpos($line, "IP:") ) { 
    434                 $ip = trim( substr($line, strlen("IP:")) ); 
     437            } else if ( 0 === strpos($line, 'IP:') ) { 
     438                $ip = trim( substr($line, strlen('IP:')) ); 
    435439                if ( 'comment' == $context ) 
    436440                    $comment->comment_author_IP = $ip; 
    437441                else 
    438442                    $ping->comment_author_IP = $ip; 
    439             } else if ( 0 === strpos($line, "URL:") ) { 
    440                 $url = trim( substr($line, strlen("URL:")) ); 
     443            } else if ( 0 === strpos($line, 'URL:') ) { 
     444                $url = trim( substr($line, strlen('URL:')) ); 
    441445                if ( 'comment' == $context ) 
    442446                    $comment->comment_author_url = $url; 
    443447                else 
    444448                    $ping->comment_author_url = $url; 
    445             } else if ( 0 === strpos($line, "BLOG NAME:") ) { 
    446                 $blog = trim( substr($line, strlen("BLOG NAME:")) ); 
     449            } else if ( 0 === strpos($line, 'BLOG NAME:') ) { 
     450                $blog = trim( substr($line, strlen('BLOG NAME:')) ); 
    447451                $ping->comment_author = $blog; 
    448             } else if ( 0 === strpos($line, "BASENAME:") ) { 
    449                 $post_name = trim( substr($line, strlen("BASENAME:")) ); 
    450                 $post->post_name = $post_name; 
    451452            } else { 
    452453                // Processing multi-line field, check context. 
  • movabletype-importer/trunk/readme.txt

    r279921 r279927  
    55Requires at least: 3.0 
    66Tested up to: 3.0 
    7 Stable tag: 0.2 
     7Stable tag: 0.4 
    88 
    99Import posts and comments from a Movable Type or TypePad blog. 
     
    3131* Use BASENAME, if present, as the slug for the post. 
    3232 
     33= 0.4 = 
     34* String updates 
     35 
    3336== Upgrade Notice == 
    3437 
    3538= 0.3 = 
    3639Use BASENAME for post slugs. 
     40 
     41= 0.4 = 
     42Import post slugs to make URL transition easier. 
     43 
Note: See TracChangeset for help on using the changeset viewer.