]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/import/blogger.php
Wordpress 2.6.2
[autoinstalls/wordpress.git] / wp-admin / import / blogger.php
index b518cd73a8379564aff4ab06027047a37fd7ba89..140d8f2bbd745cdcfb7c9351b10f6591b25d1d00 100644 (file)
@@ -12,7 +12,7 @@ class Blogger_Import {
                $auth_url = "https://www.google.com/accounts/AuthSubRequest";
                $title = __('Import Blogger');
                $welcome = __('Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.');
-               $prereqs = __('To use this importer, you must have a Google account, an upgraded (New, was Beta) blog, and it must be on blogspot or a custom domain (not FTP).');
+               $prereqs = __('To use this importer, you must have a Google account and an upgraded (New, was Beta) blog hosted on blogspot.com or a custom domain (not FTP).');
                $stepone = __('The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.');
                $auth = __('Authorize');
 
@@ -20,7 +20,7 @@ class Blogger_Import {
                <div class='wrap'><h2>$title</h2><p>$welcome</p><p>$prereqs</p><p>$stepone</p>
                        <form action='$auth_url' method='get'>
                                <p class='submit' style='text-align:left;'>
-                                       <input type='submit' value='$auth' />
+                                       <input type='submit' class='button' value='$auth' />
                                        <input type='hidden' name='scope' value='http://www.blogger.com/feeds/' />
                                        <input type='hidden' name='session' value='1' />
                                        <input type='hidden' name='secure' value='0' />
@@ -178,7 +178,7 @@ class Blogger_Import {
                        $init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');';
                        $pstat = "<div class='ind' id='pind$i'>&nbsp;</div><div id='pstat$i' class='stat'>$pdone/{$blog['total_posts']}</div>";
                        $cstat = "<div class='ind' id='cind$i'>&nbsp;</div><div id='cstat$i' class='stat'>$cdone/{$blog['total_comments']}</div>";
-                       $rows .= "<tr id='blog$i'><td class='blogtitle'>$blogtitle</td><td class='bloghost'>{$blog['host']}</td><td class='bar'>$pstat</td><td class='bar'>$cstat</td><td class='submit'><input type='submit' id='submit$i' value='$value' /><input type='hidden' name='blog' value='$i' /></td></tr>\n";
+                       $rows .= "<tr id='blog$i'><td class='blogtitle'>$blogtitle</td><td class='bloghost'>{$blog['host']}</td><td class='bar'>$pstat</td><td class='bar'>$cstat</td><td class='submit'><input type='submit' class='button' id='submit$i' value='$value' /><input type='hidden' name='blog' value='$i' /></td></tr>\n";
                }
 
                echo "<div class='wrap'><h2>$title</h2><noscript>$noscript</noscript><table cellpadding='5px'><thead><td>$name</td><td>$url</td><td>$posts</td><td>$comments</td><td>$action</td></thead>\n$rows</table></form></div>";
@@ -381,7 +381,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);
                                        }
@@ -520,7 +520,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 );
@@ -613,12 +613,12 @@ class Blogger_Import {
                $blogtitle = "{$blog['title']} ({$blog['host']})";
                $mapthis = __('Blogger username');
                $tothis = __('WordPress login');
-               $submit = js_escape( __('Save Changes &raquo;') );
+               $submit = js_escape( __('Save Changes') );
 
                foreach ( $blog['authors'] as $i => $author )
                        $rows .= "<tr><td><label for='authors[$i]'>{$author[0]}</label></td><td><select name='authors[$i]' id='authors[$i]'>" . $this->get_user_options($author[1]) . "</select></td></tr>";
 
-               return "<div class='wrap'><h2>$heading</h2><h3>$blogtitle</h3><p>$directions</p><form action='index.php?import=blogger&noheader=true&saveauthors=1' method='post'><input type='hidden' name='blog' value='$importing_blog' /><table cellpadding='5'><thead><td>$mapthis</td><td>$tothis</td></thead>$rows<tr><td></td><td class='submit'><input type='submit' class='authorsubmit' value='$submit' /></td></tr></table></form></div>";
+               return "<div class='wrap'><h2>$heading</h2><h3>$blogtitle</h3><p>$directions</p><form action='index.php?import=blogger&noheader=true&saveauthors=1' method='post'><input type='hidden' name='blog' value='$importing_blog' /><table cellpadding='5'><thead><td>$mapthis</td><td>$tothis</td></thead>$rows<tr><td></td><td class='submit'><input type='submit' class='button authorsubmit' value='$submit' /></td></tr></table></form></div>";
        }
 
        function get_user_options($current) {
@@ -641,7 +641,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 +658,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,7 +770,7 @@ 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 ) )
@@ -788,7 +788,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 "<div class='wrap'><h2>$restart</h2><p>$message</p><form method='post' action='?import=blogger&noheader=true'><p class='submit' style='text-align:left;'><input type='submit' value='$submit' name='restart' /></p></form></div>";
+                       echo "<div class='wrap'><h2>$restart</h2><p>$message</p><form method='post' action='?import=blogger&noheader=true'><p class='submit' style='text-align:left;'><input type='submit' class='button' value='$submit' name='restart' /></p></form></div>";
                }
        }
 
@@ -821,9 +821,6 @@ thead td { font-weight: bold; }
        position: relative;
        text-align: center;
 }
-.submit {
-       text-align: center !important;
-}
 </style>
 <?php
        }
@@ -840,7 +837,7 @@ thead td { font-weight: bold; }
 
 $blogger_import = new Blogger_Import();
 
-register_importer('blogger', __('Blogger'), __('Import posts, comments, and users from a Blogger blog'), array ($blogger_import, 'start'));
+register_importer('blogger', __('Blogger'), __('Import posts, comments, and users from a Blogger blog.'), array ($blogger_import, 'start'));
 
 class AtomEntry {
        var $links = array();