diff -ruN dotclear-importer/dotclear-importer.php dotclear-importer.patched//dotclear-importer.php
--- dotclear-importer/dotclear-importer.php	2010-10-05 01:42:10.702830001 +0200
+++ dotclear-importer.patched//dotclear-importer.php	2010-10-05 01:41:10.890830000 +0200
@@ -129,7 +129,7 @@
 		$dbprefix = get_option('dcdbprefix');
 
 		// Get Categories
-		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'categorie', ARRAY_A);
+		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'category', ARRAY_A);
 	}
 
 	function get_dc_users()
@@ -141,7 +141,6 @@
 		$dbprefix = get_option('dcdbprefix');
 
 		// Get Users
-
 		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'user', ARRAY_A);
 	}
 
@@ -153,9 +152,7 @@
 		$dbprefix = get_option('dcdbprefix');
 
 		// Get Posts
-		return $dcdb->get_results('SELECT '.$dbprefix.'post.*, '.$dbprefix.'categorie.cat_libelle_url AS post_cat_name
-						FROM '.$dbprefix.'post INNER JOIN '.$dbprefix.'categorie
-						ON '.$dbprefix.'post.cat_id = '.$dbprefix.'categorie.cat_id', ARRAY_A);
+		return $dcdb->get_results('SELECT '.$dbprefix.'post.* FROM '.$dbprefix.'post', ARRAY_A);
 	}
 
 	function get_dc_comments()
@@ -177,7 +174,7 @@
 		set_magic_quotes_runtime(0);
 		$dbprefix = get_option('dcdbprefix');
 
-		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY position', ARRAY_A);
+		return $dcdb->get_results('SELECT * FROM '.$dbprefix.'link ORDER BY link_position', ARRAY_A);
 	}
 
 	function cat2wp($categories='')
@@ -194,8 +191,8 @@
 				extract($category);
 
 				// Make Nice Variables
-				$name = $wpdb->escape($cat_libelle_url);
-				$title = $wpdb->escape(csc ($cat_libelle));
+				$name = $wpdb->escape($cat_url);
+				$title = $wpdb->escape(csc ($cat_title));
 				$desc = $wpdb->escape(csc ($cat_desc));
 
 				if ($cinfo = category_exists($name)) {
@@ -223,7 +220,8 @@
 
 		// Midnight Mojo
 		if (is_array($users)) {
-			echo '<p>'.__('Importing Users...', 'dotclear-importer').'<br /><br /></p>';
+			echo '<p>'.__('Importing Users...', 'dotclear-importer').'</p>';
+			echo '<p>'.__('(  if you see any error (WP_Error): maybe you have a conflict with your current users from your wordpress and your imported users from dotclear. )', 'dotclear-importer').'<br /><br /></p>';
 			foreach ($users as $user) {
 				$count++;
 				extract($user);
@@ -292,6 +290,10 @@
 		$dcposts2wpposts = array();
 		$cats = array();
 
+		foreach($this->get_dc_cats() as $buffer) {
+			$categories[$buffer["cat_id"]] = $buffer["cat_title"];
+		}
+
 		// Do the Magic
 		if (is_array($posts)) {
 			echo '<p>'.__('Importing Posts...', 'dotclear-importer').'<br /><br /></p>';
@@ -308,7 +310,7 @@
 				$uinfo = ( get_userdatabylogin( $user_id ) ) ? get_userdatabylogin( $user_id ) : 1;
 				$authorid = ( is_object( $uinfo ) ) ? $uinfo->ID : $uinfo ;
 
-				$Title = $wpdb->escape(csc ($post_titre));
+				$Title = $wpdb->escape(csc ($post_title));
 				$post_content = textconv ($post_content);
 				$post_excerpt = "";
 				if ($post_chapo != "") {
@@ -320,7 +322,6 @@
 				$post_status = $stattrans[$post_pub];
 
 				// Import Post data into WordPress
-
 				if ($pinfo = post_exists($Title,$post_content)) {
 					$ret_id = wp_insert_post(array(
 							'ID'			=> $pinfo,
@@ -359,11 +360,13 @@
 					if ( is_wp_error( $ret_id ) )
 						return $ret_id;
 				}
+
+				// print "Dotclear($post_id) => Wordpress($ret_id)<br/>";
 				$dcposts2wpposts[$post_id] = $ret_id;
 
 				// Make Post-to-Category associations
 				$cats = array();
-				$category1 = get_category_by_slug($post_cat_name);
+				$category1 = get_category_by_slug($categories[$cat_id]);
 				$category1 = $category1->term_id;
 
 				if ($cat1 = $category1) { $cats[1] = $cat1; }
@@ -372,18 +375,23 @@
 			}
 		}
 		// Store ID translation for later use
-		add_option('dcposts2wpposts',$dcposts2wpposts);
+		// add_option('dcposts2wpposts', $dcposts2wpposts); // after storing, all datas are altered  ôO
+								    // bug into add_option ?!!
 
 		echo '<p>'.sprintf(__('Done! <strong>%1$s</strong> posts imported.', 'dotclear-importer'), $count).'<br /><br /></p>';
-		return true;
+
+		return $dcposts2wpposts;
 	}
 
-	function comments2wp($comments='') {
+	function comments2wp($comments='', $linker) {
 		// General Housekeeping
 		global $wpdb;
 		$count = 0;
 		$dccm2wpcm = array();
-		$postarr = get_option('dcposts2wpposts');
+
+		//$postarr = get_option('dcposts2wpposts'); // after storing, all datas are altered ôO
+							    // bug into add_option ?!!
+		$postarr = $linker;
 
 		// Magic Mojo
 		if (is_array($comments)) {
@@ -395,8 +403,8 @@
 				// WordPressify Data
 				$comment_ID = (int) ltrim($comment_id, '0');
 				$comment_post_ID = (int) $postarr[$post_id];
-				$comment_approved = $comment_pub;
-				$name = $wpdb->escape(csc ($comment_auteur));
+				$comment_approved = ($comment_status == 1) ? 1 : 0;
+				$name = $wpdb->escape(csc ($comment_author));
 				$email = $wpdb->escape($comment_email);
 				$web = "http://".$wpdb->escape($comment_site);
 				$message = $wpdb->escape(textconv ($comment_content));
@@ -449,35 +457,19 @@
 				$count++;
 				extract($link);
 
-				if ($title != "") {
-					if ($cinfo = term_exists(csc ($title), 'link_category')) {
-						$category = $cinfo['term_id'];
-					} else {
-						$category = wp_insert_term($wpdb->escape (csc ($title)), 'link_category');
-						$category = $category['term_id'];
-					}
-				} else {
-					$linkname = $wpdb->escape(csc ($label));
-					$description = $wpdb->escape(csc ($title));
+				$linkname = $wpdb->escape(csc ($link_title));
+				$description = $wpdb->escape(csc ($link_desc));
 
-					if ($linfo = link_exists($linkname)) {
-						$ret_id = wp_insert_link(array(
-									'link_id'		=> $linfo,
-									'link_url'		=> $href,
-									'link_name'		=> $linkname,
-									'link_category'		=> $category,
-									'link_description'	=> $description)
-									);
-					} else {
-						$ret_id = wp_insert_link(array(
-									'link_url'		=> $url,
-									'link_name'		=> $linkname,
-									'link_category'		=> $category,
-									'link_description'	=> $description)
-									);
-					}
-					$dclinks2wplinks[$link_id] = $ret_id;
+				if ( ($linfo = link_exists($linkname)) == NULL ) {
+					$ret_id = wp_insert_link(array(
+								'link_url'		=> $link_href,
+								'link_name'		=> $link_title,
+								'link_description'	=> $link_desc
+								));
+				} else {
+					$ret_id = link_exists($linkname);
 				}
+				$dclinks2wplinks[$link_id] = $ret_id;
 			}
 			add_option('dclinks2wplinks',$dclinks2wplinks);
 			echo '<p>';
@@ -511,10 +503,23 @@
 
 		echo '<form action="admin.php?import=dotclear&amp;step=3" method="post">';
 		wp_nonce_field('import-dotclear');
-		printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Posts', 'dotclear-importer'));
+		printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Posts and Comments', 'dotclear-importer'));
 		echo '</form>';
 	}
 
+	function import_posts_and_comments() {
+		$posts    = $this->get_dc_posts();
+		$comments = $this->get_dc_comments();
+
+		$link_between_posts_and_comments = $this->posts2wp($posts);
+		$this->comments2wp($comments, $link_between_posts_and_comments);
+
+		echo '<form action="admin.php?import=dotclear&amp;step=5" method="post">';
+		wp_nonce_field('import-dotclear');
+		printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Links', 'dotclear-importer'));
+		echo '</form>';
+	}
+	/*
 	function import_posts() {
 		// Post Import
 		$posts = $this->get_dc_posts();
@@ -538,6 +543,7 @@
 		printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Links', 'dotclear-importer'));
 		echo '</form>';
 	}
+	*/
 
 	function import_links()
 	{
@@ -656,6 +662,14 @@
 				$this->import_users();
 				break;
 			case 3 :
+				$result = $this->import_posts_and_comments();
+				if ( is_wp_error( $result ) )
+					echo $result->get_error_message();
+				// goto directly to 5
+				break;
+			/*
+			// ------ previous code ------
+			case 3 :
 				$result = $this->import_posts();
 				if ( is_wp_error( $result ) )
 					echo $result->get_error_message();
@@ -663,6 +677,7 @@
 			case 4 :
 				$this->import_comments();
 				break;
+			*/
 			case 5 :
 				$this->import_links();
 				break;
