Attempting to connect to ".ASYSTEM." database [ {$dbDatabase} @ {$dbHost} ] ... \n"; flush(); $ASystemConnection = mysql_connect($dbHost, $dbUsername, $dbPassword, TRUE); if(!mysql_select_db($dbDatabase, $ASystemConnection)) { goError("Error! Cound not connect to ".ASYSTEM." 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 ".ASYSTEM." and e107 databases ... "; /* ++++++++++++++ USERS ++++++++++++++ */ $result = mysql_query("SELECT * FROM {$dbPrefix}users", $ASystemConnection); if(!$result) { goError("Error! Unable to access ".$dbPrefix."users table."); } $pass = 0; $fail = 0; while($aResult = mysql_fetch_array($result)) { $aArray = convertUsers(); $query = createQuery($aArray, $aResult, $mySQLprefix."user"); if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;} flush(); } echo "Inserted $pass users into database ($fail fails). "; /* +++++++++++++++ END +++++++++++++++ */ /* ++++++++++++++ NEWS ++++++++++++++ */ $query = "SELECT * FROM {$dbPrefix}stories LEFT JOIN {$dbPrefix}users ON {$dbPrefix}stories.aid={$dbPrefix}users.username ORDER BY {$dbPrefix}stories.sid ASC"; $result = mysql_query($query, $ASystemConnection); if(!$result) { goError("Error! Unable to access ".$dbPrefix."stories table."); } $pass = 0; $fail = 0; while($aResult = mysql_fetch_array($result)) { $aArray = convertNews(); $query = createQuery($aArray, $aResult, $mySQLprefix."news"); if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;} flush(); } echo "Inserted $pass news items into database ($fail fails). "; /* +++++++++++++++ END +++++++++++++++ */ /* ++++++++++++++ BANLIST ++++++++++++++ */ $result = mysql_query("SELECT * FROM {$dbPrefix}banned_ip", $ASystemConnection); if(!$result) { goError("Error! Unable to access ".$dbPrefix."banned_ip table."); } $pass = 0; $fail = 0; while($aResult = mysql_fetch_array($result)) { $aArray = convertBans(); $query = createQuery($aArray, $aResult, $mySQLprefix."banlist"); if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;} flush(); } echo "Inserted $pass banned IP addresses into database ($fail fails). "; /* +++++++++++++++ END +++++++++++++++ */ /* ++++++++++++++ CUSTOM PAGES ++++++++++++++ */ $result = mysql_query("SELECT * FROM {$dbPrefix}pages", $ASystemConnection); if(!$result) { goError("Error! Unable to access ".$dbPrefix."pages table."); } $pass = 0; $fail = 0; while($aResult = mysql_fetch_array($result)) { $aArray = convertPages(); $query = createQuery($aArray, $aResult, $mySQLprefix."page"); if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;} flush(); } echo "Inserted $pass custom pages into database ($fail fails). "; /* +++++++++++++++ END +++++++++++++++ */ /* ++++++++++++++ FORUMS ++++++++++++++ $result = mysql_query("SHOW COLUMNS FROM {$mySQLprefix}forum", $e107Connection); if(!$result) { goError("Error! Unable to access the e107 'forum' table - have you installed the e107 Forum System plugin?"); } $result = mysql_query("SELECT * FROM {$dbPrefix}bbforums ORDER BY forum_order ASC", $ASystemConnection); if(!$result) { goError("Error! Unable to access ".$dbPrefix."bbforums table."); } $pass = 0; $fail = 0; while($aResult = mysql_fetch_array($result)) { $aArray = convertForums(); $query = createQuery($aArray, $aResult, $mySQLprefix."forum"); if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;} flush(); } $query = "INSERT INTO {$mySQLprefix}forum VALUES (0, 'Default Forum Parent', 'This parent has been created by the ".ASYSTEM." conversion script, you can edit it from admin -> forums', '0', '0', '".time()."', '', '0', '0', '', '', '', '0', '0')"; mysql_query($query, $e107Connection); $id = mysql_insert_id(); $query = "UPDATE {$mySQLprefix}forum SET forum_parent='$id' WHERE forum_name!='Default Forum Parent'"; mysql_query($query, $e107Connection); echo "Inserted $pass forums into database ($fail fails). "; /* +++++++++++++++ END +++++++++++++++ */ /* ++++++++++++++ FORUM POSTS ++++++++++++++ $query = "SELECT * FROM {$dbPrefix}bbposts LEFT JOIN {$dbPrefix}bbposts_text ON {$dbPrefix}bbposts.post_id={$dbPrefix}bbposts_text.post_id LEFT JOIN {$dbPrefix}users ON {$dbPrefix}bbposts.poster_id={$dbPrefix}users.user_id ORDER BY {$dbPrefix}bbposts.post_id ASC"; $result = mysql_query($query, $ASystemConnection); if(!$result) { goError("Error! Unable to access ".$dbPrefix."stories table."); } $pass = 0; $fail = 0; while($aResult = mysql_fetch_array($result)) { $aArray = convertForumPosts(); $query = createQuery($aArray, $aResult, $mySQLprefix."forum_t"); $poster = ($aResult['poster_id'] == -1 ? "0.".($aResult['username'] ? $aResult['username'] : "Anonymous") : $aResult['poster_id'].".".$aResult['username']); $query = str_replace("''", "'$poster'", $query); if(mysql_query($query, $e107Connection)){$pass++;}else{$fail++;} flush(); } echo "Inserted $pass forum posts into database ($fail fails). "; +++++++++++++++ END +++++++++++++++ */ echo " |