Changeset 179 for trunk/export/export.php
- Timestamp:
- Apr 12, 2009, 12:01:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r178 r179 98 98 if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)"; 99 99 if($Setting['language-other']) $WhereLang .= " OR (Language = 3)"; 100 if($WhereLang == '') $WhereLang = 1; 101 else $WhereLang = '('.substr($WhereLang, 4).')'; 102 103 $SelectedUsers = ''; 104 foreach($Setting['users-selection'] as $Item) 105 $SelectedUsers .= ','.$Item; 106 $SelectedUsers = substr($SelectedUsers, 1); 107 108 if($SelectedUsers == '') $Where = 0; 109 else $Where = 'ID IN ('.$SelectedUsers.')'; 110 111 $UserNames = ''; 112 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where); 113 while($DbRow = mysql_fetch_assoc($DbResult)) 114 $UserNames .= ','.$DbRow['user']; 115 $UserNames = substr($UserNames, 1); 116 117 if($SelectedUsers == '') $WhereUsers = 1; 118 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 119 100 if($WhereLang == '') $WhereLang = 1; 101 else $WhereLang = '('.substr($WhereLang, 4).')'; 102 103 $SelectedUsers = ''; 104 foreach($Setting['users-selection'] as $Item) 105 $SelectedUsers .= ','.$Item; 106 $SelectedUsers = substr($SelectedUsers, 1); 107 108 if($SelectedUsers == '') $Where = 0; 109 else $Where = 'ID IN ('.$SelectedUsers.')'; 110 111 $UserNames = ''; 112 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE '.$Where); 113 while($DbRow = mysql_fetch_assoc($DbResult)) 114 $UserNames .= ','.$DbRow['user']; 115 $UserNames = substr($UserNames, 1); 116 117 if($SelectedUsers == '') $WhereUsers = 1; 118 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 120 119 121 120 //data to aowow … … 123 122 $Database->SelectDatabase($AoWoWconf['mangos']['db']); 124 123 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 125 $AoWoWTables = array('aowow_resistances' , 'aowow_spelldispeltype', 'aowow_skill');126 foreach($AoWoWTables as $AoWoWTable ) {127 $Buffer .= $AoWoWTable.', ';124 $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID'); 125 foreach($AoWoWTables as $AoWoWTable => $IndexColum) { 126 $Buffer .= '--'.$AoWoWTable.', '; 128 127 $Buffer .= "\n\n"; 129 $Query = 'SELECT name FROM '.$AoWoWTable;128 $Query = 'SELECT name,'.$IndexColum.' FROM '.$AoWoWTable; 130 129 $ID = $Database->SQLCommand($Query); 131 130 while($Line = mysql_fetch_assoc($ID)) { … … 138 137 //echo ($Line['name'].'='.$Tran['tran']); 139 138 if ($Tran['tran'] <> '') 140 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE name = "'.addslashes($Line['name']).'";'."\n";139 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n"; 141 140 } 142 141 $Buffer .= "\n\n"; 143 142 } 143 if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); 144 144 return($Buffer); 145 145 }
Note:
See TracChangeset
for help on using the changeset viewer.