]> git.mjollnir.org Git - s9y.git/commitdiff
* document
authorgarvinhicking <garvinhicking>
Thu, 12 Jan 2006 10:17:45 +0000 (10:17 +0000)
committergarvinhicking <garvinhicking>
Thu, 12 Jan 2006 10:17:45 +0000 (10:17 +0000)
* fix wp 2.0 import

docs/NEWS
include/admin/importers/wordpress.inc.php

index 339df3ca8fa219cd568ee627fd6cfa8f4849ee9a..ac6e9debf490124a0cc93e87abd087483b0eea61 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,12 @@
 Version 1.0 ()
 ------------------------------------------------------------------------
 
+   * Make WordPress importer not fail on the missing "user_level" column
+     for WordPress 2.0 (garvinhicking)
+
+   * Add new option to spamblock plugin to forbid trackbacks from URLs that
+     don't have our URL in them. (garvinhicking)
+
    * Recognize "multiselect" as new plugin item type. Calls to get_config()
      will return a string, that needs exploding to convert it into the
      array of multi-selected input values.
index 2abccab04073a301241c329996d00a90a82bf36b..f65f87ad2514b5ea938f0a1391543f477e557de0 100644 (file)
@@ -91,7 +91,8 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
         }
 
         /* Users */
-        $res = @$this->nativeQuery("SELECT ID, user_login, user_pass, user_email, user_level FROM {$this->data['prefix']}users;", $wpdb);
+        // Fields: ID, user_login, user_pass, user_email, user_level
+        $res = @$this->nativeQuery("SELECT * FROM {$this->data['prefix']}users;", $wpdb);
         if ( !$res ) {
             return sprintf(COULDNT_SELECT_USER_INFO, mysql_error($wpdb));
         }
@@ -99,14 +100,14 @@ class Serendipity_Import_WordPress extends Serendipity_Import {
         for ( $x=0 ; $x<mysql_num_rows($res) ; $x++ ) {
             $users[$x] = mysql_fetch_assoc($res);
 
-            $data = array('right_publish' => ($users[$x]['user_level'] >= 1) ? 1 : 0,
+            $data = array('right_publish' => (!isset($users[$x]['user_level']) || $users[$x]['user_level'] >= 1) ? 1 : 0,
                           'realname'      => $users[$x]['user_login'],
                           'username'      => $users[$x]['user_login'],
                           'password'      => $users[$x]['user_pass']); // WP uses md5, too.
 
-            if ( $users[$x]['user_level'] <= 1 ) {
+            if ( isset($users[$x]['user_level']) && $users[$x]['user_level'] <= 1 ) {
                 $data['userlevel'] = USERLEVEL_EDITOR;
-            } elseif ( $users[$x]['user_level'] < 5 ) {
+            } elseif ( isset($users[$x]['user_level']) && $users[$x]['user_level'] < 5 ) {
                 $data['userlevel'] = USERLEVEL_CHIEF;
             } else {
                 $data['userlevel'] = USERLEVEL_ADMIN;