Index: trunk/include/onuninstall.php
===================================================================
--- trunk/include/onuninstall.php	(revision 187)
+++ trunk/include/onuninstall.php	(revision 188)
@@ -24,23 +24,34 @@
 	$db =& Database::getInstance() ;
 	$mid = $module->getVar('mid') ;
-/*
-	// TABLES (loading mysql.sql)
-	$sql_file_path = dirname(__FILE__).'/sql/mysql.sql' ;
-	$prefix_mod = $db->prefix() . '_' . $mydirname ;
-	if( file_exists( $sql_file_path ) ) {
-		$ret[] = "SQL file found at <b>".htmlspecialchars($sql_file_path)."</b>.<br  /> Deleting tables...<br />";
-		$sql_lines = file( $sql_file_path ) ;
-		foreach( $sql_lines as $sql_line ) {
-			if( preg_match( '/^CREATE TABLE \`?([a-zA-Z0-9_-]+)\`? /i' , $sql_line , $regs ) ) {
-				$sql = 'DROP TABLE '.$prefix_mod.'_'.$regs[1] ;
-				if (!$db->query($sql)) {
-					$ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1]).'<b>.</span><br />';
-				} else {
-					$ret[] = 'Table <b>'.htmlspecialchars($prefix_mod.'_'.$regs[1]).'</b> dropped.<br />';
-				}
+	
+	$xp_prefix = $mydirname;
+	if ($xp_prefix == 'wordpress'){
+	 	$xp_prefix = 'wp';
+	}
+	
+	$xoops_prefix = $db->prefix();
+
+	if (empty($xoops_prefix) || empty($xp_prefix)) {
+		$ret[] = '<span style="color:#ff0000;">ERROR: Empty Prefix.</span><br />';
+		return false;
+	}
+	
+	$prefix_mod = $xoops_prefix  . '_' . $xp_prefix;
+	$sql = "SHOW TABLES LIKE '$prefix_mod%'";
+	if ($result = $db->query($sql)) {
+		while ($table = $db->fetchRow($result)){
+			$drop_sql = 'DROP TABLE '. $table[0] ;
+			if (!$db->queryF($drop_sql)) {
+				$ret[] = '<span style="color:#ff0000;">ERROR: Could not drop table <b>'.htmlspecialchars($table[0]).'<b>.</span><br />';
+			} else {
+				$ret[] = 'Table <b>'.htmlspecialchars($table[0]).'</b> dropped.<br />';
 			}
 		}
+	} else {
+		$ret[] = '<span style="color:#ff0000;">ERROR: Table not found of prefix <b>'.htmlspecialchars($prefix_mod).'<b> .</span><br />';
+		return false;
 	}
-*/
+
+
 	// TEMPLATES (Not necessary because modulesadmin removes all templates)
 	/* $tplfile_handler =& xoops_gethandler( 'tplfile' ) ;
Index: trunk/xoops_version.php
===================================================================
--- trunk/xoops_version.php	(revision 187)
+++ trunk/xoops_version.php	(revision 188)
@@ -40,5 +40,5 @@
 
 // status
-$modversion['codename'] = "Bata3(r186)";
+$modversion['codename'] = "Bata3(r188)";
 
 // onInstall, onUpdate, onUninstall
@@ -55,19 +55,12 @@
 }
 
-$modversion['tables'] = array(
-	$db_prefix . "_comments",
-	$db_prefix . "_links",
-	$db_prefix . "_options",
-	$db_prefix . "_postmeta",
-	$db_prefix . "_posts",
-	$db_prefix . "_users",
-	$db_prefix . "_usermeta",
-	$db_prefix . "_terms",
-	$db_prefix . "_term_relationships",
-	$db_prefix . "_term_taxonomy",
-	$db_prefix . "_views",	
-	$db_prefix . "_d3forum_link",
-	$db_prefix . "_group_role"
-);
+/*
+ * Table information is not described. 
+ * 
+ * The create of the table is do with oninstall.php. 
+ * The drop of the table is do with onuninstall.php. 
+ *
+ * $modversion['tables'] = array( ,,,);
+ */
 
 
