This script will import your Mambo database to e107. It will copy over users only.



\n
Please enter the details for your Mambo database ...

Host  
Username  
Password  
Database  
Table Prefix  


"; $ns -> tablerender("mambo to e107 Conversion Script", $text); require_once(e_ADMIN."footer.php"); exit; } if(!isset($_POST['mamboHost']) || !isset($_POST['mamboUsername']) || !isset($_POST['mamboPassword']) || !isset($_POST['mamboDatabase'])){ echo "Field(s) left blank, please go back and re-enter values."; require_once(e_ADMIN."footer.php"); exit; } extract($_POST); $text .= "
Attempting to connect to Mambo database [ {$mamboDatabase} @ {$mamboHost} ] ...
\n"; flush(); $phpbbConnection = mysql_connect($mamboHost, $mamboUsername, $mamboPassword, TRUE); if(!mysql_select_db($mamboDatabase, $phpbbConnection)){ goError("Error! Cound not connect to Mambo database. Please go back to the previous page and check your settings"); } $e107Connection = mysql_connect($mySQLserver, $mySQLuser, $mySQLpassword, TRUE); if(!mysql_select_db($mySQLdefaultdb, $e107Connection)){ goError("Error! Cound not connect to e107 database."); } echo "Successfully connected to Mambo and e107 databases ...

"; $phpbb_res = mysql_query("SELECT * FROM {$mamboPrefix}users", $phpbbConnection); if(!$phpbb_res){ goError("Error! Unable to access ".$mamboPrefix."users table."); } $text = "
"; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $result = mysql_query("SELECT name,username,email,block,sendEmail,gid,password,usertype,UNIX_TIMESTAMP(registerDate) AS regDate,UNIX_TIMESTAMP(lastvisitDate) AS lvDate FROM mos_users", $phpbbConnection); while ($mos = mysql_fetch_array($result, MYSQL_ASSOC)) { $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $text .= ""; $block = ($mos['block']) ? 2 : 0; $admin = ($mos['usertype'] == "superadministrator") ? 1 : 0; $class = ''; // Potential class allocation - can edit to list class numbers here $query = "INSERT INTO ".$mySQLprefix."user VALUES ("; $query .= "0, '".$mos['name']."', '".$mos['username']."', '', '".$mos['password']."', '', '".$mos['email']."', '', '', '', '1', '".$mos['regDate']."', '".$mos['lvDate']."', 0, 0, 0, 0, 0, '', '{$block}', '', '', '', 0, '{$admin}', '".$mos['name']."', '{$class}', '', '', 0, '' "; $query .= ")"; $message = mysql_query($query, $e107Connection) ? LAN_CREATED: LAN_CREATED_FAILED; } $text .= "
nameusernameemailpasswordusertypeblocksendEmailgidregDatelvDate
".$mos['name']."".$mos['username']."".$mos['email']."".$mos['password']."".$mos['usertype']."".$mos['block']."".$mos['sendEmail']."".$mos['gid']."".$mos['regDate']."".$mos['lvDate']."
"; echo $text."

"; echo "
$message
"; function goError($error){ echo "{$error}
"; require_once(e_ADMIN."footer.php"); exit; } require_once(e_ADMIN."footer.php"); ?>