X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/7688c6ba71852cd89123b62b2d57683535e4702a..11be8dc178e77d0b46189bbd8e33a216a9b90942:/wp-admin/import/blogger.php diff --git a/wp-admin/import/blogger.php b/wp-admin/import/blogger.php index b518cd73..0879cd11 100644 --- a/wp-admin/import/blogger.php +++ b/wp-admin/import/blogger.php @@ -1,26 +1,66 @@

$title

$welcome

$prereqs

$stepone

+
+ ".screen_icon()." +

$title

+

$welcome

$prereqs

$stepone

- + @@ -31,7 +71,9 @@ class Blogger_Import { } function uh_oh($title, $message, $info) { - echo "

$title

$message

$info
"; + echo "
"; + screen_icon(); + echo "

$title

$message

$info
"; } function auth() { @@ -178,12 +220,13 @@ class Blogger_Import { $init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');'; $pstat = "
 
$pdone/{$blog['total_posts']}
"; $cstat = "
 
$cdone/{$blog['total_comments']}
"; - $rows .= "$blogtitle{$blog['host']}$pstat$cstat\n"; + $rows .= "$blogtitle{$blog['host']}$pstat$cstat\n"; } - echo "

$title

\n$rows
$name$url$posts$comments$action
"; + echo "

$title

\n$rows
$name$url$posts$comments$action
"; echo " \n"; } @@ -381,7 +425,7 @@ class Blogger_Import { $AtomParser = new AtomParser(); $AtomParser->parse( $entry ); $result = $this->import_post($AtomParser->entry); - if ( is_wp_error( $result ) ) + if ( is_wp_error( $result ) ) return $result; unset($AtomParser); } @@ -485,7 +529,7 @@ class Blogger_Import { } function import_post( $entry ) { - global $wpdb, $importing_blog; + global $importing_blog; // The old permalink is all Blogger gives us to link comments to their posts. if ( isset( $entry->draft ) ) @@ -506,7 +550,7 @@ class Blogger_Import { $post_status = isset( $entry->draft ) ? 'draft' : 'publish'; // Clean up content - $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content); + $post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content); $post_content = str_replace('
', '
', $post_content); $post_content = str_replace('
', '
', $post_content); @@ -520,7 +564,7 @@ class Blogger_Import { $post = compact('post_date', 'post_content', 'post_title', 'post_status'); $post_id = wp_insert_post($post); - if ( is_wp_error( $post_id ) ) + if ( is_wp_error( $post_id ) ) return $post_id; wp_create_categories( array_map( 'addslashes', $entry->categories ), $post_id ); @@ -559,7 +603,7 @@ class Blogger_Import { $comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ); // Clean up content - $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $comment_content); + $comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content); $comment_content = str_replace('
', '
', $comment_content); $comment_content = str_replace('
', '
', $comment_content); @@ -613,16 +657,16 @@ class Blogger_Import { $blogtitle = "{$blog['title']} ({$blog['host']})"; $mapthis = __('Blogger username'); $tothis = __('WordPress login'); - $submit = js_escape( __('Save Changes »') ); + $submit = js_escape( __('Save Changes') ); foreach ( $blog['authors'] as $i => $author ) $rows .= ""; - return "

$heading

$blogtitle

$directions

$rows
$mapthis$tothis
"; + return "

$heading

$blogtitle

$directions

$rows
$mapthis$tothis
"; } function get_user_options($current) { - global $wpdb, $importer_users; + global $importer_users; if ( ! isset( $importer_users ) ) $importer_users = (array) get_users_of_blog(); @@ -641,7 +685,7 @@ class Blogger_Import { $host = $this->blogs[$importing_blog]['host']; // Get an array of posts => authors - $post_ids = (array) $wpdb->get_col("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = '$host'"); + $post_ids = (array) $wpdb->get_col( $wpdb->prepare("SELECT post_id FROM $wpdb->postmeta WHERE meta_key = 'blogger_blog' AND meta_value = %s", $host) ); $post_ids = join( ',', $post_ids ); $results = (array) $wpdb->get_results("SELECT post_id, meta_value FROM $wpdb->postmeta WHERE meta_key = 'blogger_author' AND post_id IN ($post_ids)"); foreach ( $results as $row ) @@ -658,7 +702,7 @@ class Blogger_Import { $post_ids = (array) array_keys( $authors_posts, $this->blogs[$importing_blog]['authors'][$author][0] ); $post_ids = join( ',', $post_ids); - $wpdb->query("UPDATE $wpdb->posts SET post_author = $user_id WHERE id IN ($post_ids)"); + $wpdb->query( $wpdb->prepare("UPDATE $wpdb->posts SET post_author = %d WHERE id IN ($post_ids)", $user_id) ); $this->blogs[$importing_blog]['authors'][$author][1] = $user_id; } $this->save_vars(); @@ -770,14 +814,14 @@ class Blogger_Import { $this->$key = $value; if ( isset( $_REQUEST['blog'] ) ) { - $blog = is_array($_REQUEST['blog']) ? array_shift( array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog']; + $blog = is_array($_REQUEST['blog']) ? array_shift( $keys = array_keys( $_REQUEST['blog'] ) ) : $_REQUEST['blog']; $blog = (int) $blog; $result = $this->import_blog( $blog ); if ( is_wp_error( $result ) ) echo $result->get_error_message(); } elseif ( isset($_GET['token']) ) $this->auth(); - elseif ( $this->token && $this->token_is_valid() ) + elseif ( isset($this->token) && $this->token_is_valid() ) $this->show_blogs(); else $this->greet(); @@ -788,7 +832,7 @@ class Blogger_Import { $restart = __('Restart'); $message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.'); $submit = __('Clear account information'); - echo "

$restart

$message

"; + echo "

$restart

$message

"; } } @@ -821,9 +865,6 @@ thead td { font-weight: bold; } position: relative; text-align: center; } -.submit { - text-align: center !important; -}