Changeset 40 for branches/2/mangos_import.php
- Timestamp:
- Jan 24, 2009, 5:55:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2/mangos_import.php
r9 r40 29 29 while($DbRow = $DbResult->fetch_array()) 30 30 { 31 $this->Database-> replace('TextGroup', array('Language' => 1, 'User' => 1, 'Revision' => 1, 'Time' => 'NOW()', 'Group' => $Group['Id'], 'Index' => $DbRow[$Group['MangosTableIndex']]));31 $this->Database->query('REPLACE INTO `TextGroup` (`Language`, `User`, `Revision`, `Time`, `Group`, `Index`) VALUES (1, 2, 1, "NOW()", '.$Group['Id'].', '.$DbRow[$Group['MangosTableIndex']].')'); 32 32 $TranslationGroupId = $this->Database->insert_id; 33 33 foreach($GroupItemList as $GroupItem) … … 51 51 // Import users 52 52 $this->Database->query('TRUNCATE TABLE `User`'); 53 $this->Database->insert('User', array('Name' => 'Anonym', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1)); 54 $AnonymousId = $this->Database->insert_id; 55 $this->Database->insert('User', array('Name' => 'MaNGOS', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1)); 56 $MangosId = $this->Database->insert_id; 57 $this->Database->insert('User', array('Name' => 'WoWEmu', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1)); 58 $WowemuId = $this->Database->insert_id; 59 $this->Database->insert('User', array('Name' => 'Neznámý', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1)); 60 $UnknownUserId = $this->Database->insert_id; 61 $UserIdIncrement = 4; 62 63 // Load old users 53 64 $DbResult = $this->Database->query('SELECT * FROM `quests`.`user`'); 54 65 while($User = $DbResult->fetch_array()) … … 59 70 if($User['gm'] == 1) $Role = 3; 60 71 if($User['gm'] == 2) $Role = 4; 61 $this->Database->insert('User', array('Name' => $User['user'], 'Password' => $User['pass'], 'Email' => $User['Email'], 'TranslationLanguage' => $Language, 'LastLoginTime' => $User['LastLogin'], 'LastIpAddress' => $User['LastIP'], 'Role' => $Role, 'Id' => $User['ID']));72 $this->Database->insert('User', array('Name' => $User['user'], 'Password' => $User['pass'], 'Email' => $User['Email'], 'TranslationLanguage' => $Language, 'LastLoginTime' => $User['LastLogin'], 'LastIpAddress' => $User['LastIP'], 'Role' => $Role, 'Id' => ($User['ID'] + $UserIdIncrement))); 62 73 } 63 $this->Database->insert('User', array('Name' => 'Anonym', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1));64 $this->Database->insert('User', array('Name' => 'MaNGOS', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1));65 $this->Database->insert('User', array('Name' => 'WoWEmu', 'Password' => '', 'Email' => '', 'TranslationLanguage' => 1, 'LastLoginTime' => '', 'LastIpAddress' => '', 'Role' => 1));66 $UnknownUserId = $this->Database->insert_id;67 74 $Output .= 'Uživatelé převedeni<br>'; 68 75 69 76 // Import texts 70 $this->Database->query('CREATE TABLE Transition (OldIndex INT, NewIndex INT, INDEX OldIndex) ENGINE=MEMORY');77 $this->Database->query('CREATE TABLE Transition (OldIndex INT, NewIndex INT, INDEX (OldIndex) ) ENGINE=MEMORY'); 71 78 //$this->Database->query('TRUNCATE TABLE `User`'); 72 79 $DbResult = $this->Database->query('SELECT * FROM `quests`.`quests`'); … … 75 82 if($Quest['Language'] > 0) 76 83 { 77 if($Quest['User'] == 0) $Quest['User'] = $UnknownUserId; 84 if($Quest['User'] == 0) $Quest['User'] = $UnknownUserId; else $Quest['User'] = $Quest['User'] + $UserIdIncrement; 78 85 if($Quest['Take'] > 0) 79 86 {
Note:
See TracChangeset
for help on using the changeset viewer.