Changeset 200 for trunk/export/export.php
- Timestamp:
- Jun 9, 2009, 8:04:54 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/export.php
r180 r200 3 3 function ExportToMangosSQL($Setting) 4 4 { 5 global $Database, $Config, $TranslationTree ;5 global $Database, $Config, $TranslationTree, $LanguageList; 6 6 7 7 $AnoNe = array('Ne', 'Ano'); 8 8 if($_SESSION['UserID'] != '') 9 9 { 10 $DbResult = $Database->SQLCommand( "SELECT user FROM `user` WHERE ID=".$_SESSION['UserID']);11 $User = mysql_fetch_assoc($DbResult); 12 } else $User = array('user' => 'Neznámý'); 13 14 $WhereLang = ''; 15 if($Setting['language-cz']) $WhereLang .= " OR (Language = 1)";16 if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)";17 if($Setting['language-other']) $WhereLang .= " OR (Language = 3)";10 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 11 $User = mysql_fetch_assoc($DbResult); 12 } else $User = array('user' => 'Neznámý'); 13 14 $WhereLang = ''; 15 foreach($LanguageList as $Language) 16 if($Language['Enabled'] == 1) 17 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 18 18 if($WhereLang == '') $WhereLang = 1; 19 19 else $WhereLang = '('.substr($WhereLang, 4).')'; … … 81 81 } 82 82 83 function ExportToAoWoWSQL($Setting) { 84 global $Database, $Config, $TranslationTree,$AoWoWconf; 85 require_once('../aowow/configs/config.php'); 83 function ExportToAoWoWSQL($Setting) 84 { 85 global $Database, $Config, $TranslationTree, $AoWoWconf, $LanguageList; 86 87 require_once('../aowow/configs/config.php'); 86 88 87 89 $Buffer = ExportToMangosSQL($Setting); 88 90 89 90 if($_SESSION['UserID'] != '') 91 { 92 $DbResult = $Database->SQLCommand( "SELECT user FROM `user` WHERE ID=".$_SESSION['UserID']);93 $User = mysql_fetch_assoc($DbResult); 94 } else $User = array('user' => 'Neznámý'); 95 96 $WhereLang = ''; 97 if($Setting['language-cz']) $WhereLang .= " OR (Language = 1)";98 if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)";99 if($Setting['language-other']) $WhereLang .= " OR (Language = 3)";91 $AnoNe = array('Ne', 'Ano'); 92 if($_SESSION['UserID'] != '') 93 { 94 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 95 $User = mysql_fetch_assoc($DbResult); 96 } else $User = array('user' => 'Neznámý'); 97 98 $WhereLang = ''; 99 foreach($LanguageList as $Language) 100 if($Language['Enabled'] == 1) 101 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 100 102 if($WhereLang == '') $WhereLang = 1; 101 103 else $WhereLang = '('.substr($WhereLang, 4).')'; … … 118 120 else $WhereUsers = '(User IN ('.$SelectedUsers.'))'; 119 121 120 // data to aowow122 // Data to aowow 121 123 122 124 $Database->SelectDatabase($AoWoWconf['mangos']['db']); 123 125 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 124 $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID'); 125 foreach($AoWoWTables as $AoWoWTable => $IndexColum) { 126 $Buffer .= '--'.$AoWoWTable.', '; 127 $Buffer .= "\n\n"; 128 $Query = 'SELECT name,'.$IndexColum.' FROM '.$AoWoWTable; 129 $ID = $Database->SQLCommand($Query); 130 while($Line = mysql_fetch_assoc($ID)) { 126 $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID'); 127 foreach($AoWoWTables as $AoWoWTable => $IndexColum) 128 { 129 $Buffer .= '--'.$AoWoWTable.', '; 130 $Buffer .= "\n\n"; 131 $Query = 'SELECT name,'.$IndexColum.' FROM '.$AoWoWTable; 132 $ID = $Database->SQLCommand($Query); 133 while($Line = mysql_fetch_assoc($ID)) 134 { 131 135 $Ori_text = $Line['name']; 132 136 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT text as en, 133 137 (SELECT text FROM '.$Config['Database']['Database'].'.global_strings as tabletran 134 138 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$WhereLang.' … … 137 141 text = "'.addslashes($Ori_text).'" LIMIT 1')); 138 142 //echo ($Line['name'].'='.$Tran['tran']); 139 if ($Tran['tran'] <> '') {} else { 140 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT OptionText as en, 143 if ($Tran['tran'] == '') 144 { 145 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT OptionText as en, 141 146 (SELECT OptionText FROM '.$Config['Database']['Database'].'.npc_option as tabletran 142 147 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$WhereLang.' … … 144 149 FROM '.$Config['Database']['Database'].'.npc_option as tableen WHERE 145 150 OptionText = "'.addslashes($Ori_text).'" LIMIT 1')); 146 147 148 149 150 151 } 152 if ($Tran['tran'] <> '') 153 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n"; 154 } 155 $Buffer .= "\n\n"; 151 156 } 152 157 if($Setting['Diacritics'] != 1) $Buffer = utf2ascii($Buffer); … … 157 162 function ExportToXML($Setting) 158 163 { 159 global $Database, $Config, $TranslationTree ;164 global $Database, $Config, $TranslationTree, $LanguageList; 160 165 161 166 $AnoNe = array('Ne', 'Ano'); 162 167 if($_SESSION['UserID'] != '') 163 168 { 164 $DbResult = $Database->SQLCommand( "SELECT user FROM `user` WHERE ID=".$_SESSION['UserID']);165 $User = mysql_fetch_assoc($DbResult); 166 } else $User = array('user' => 'Neznámý'); 167 168 $WhereLang = ''; 169 if($Setting['language-cz']) $WhereLang .= " OR (Language = 1)";170 if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)";171 if($Setting['language-other']) $WhereLang .= " OR (Language = 3)";169 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 170 $User = mysql_fetch_assoc($DbResult); 171 } else $User = array('user' => 'Neznámý'); 172 173 $WhereLang = ''; 174 foreach($LanguageList as $Language) 175 if($Language['Enabled'] == 1) 176 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 172 177 if($WhereLang == '') $WhereLang = 1; 173 178 else $WhereLang = '('.substr($WhereLang, 4).')'; … … 239 244 function ExportToDBC($Setting) 240 245 { 241 global $Database, $Config, $TranslationTree ;246 global $Database, $Config, $TranslationTree, $LanguageList; 242 247 243 248 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/dbc/'; … … 246 251 if($_SESSION['UserID'] != '') 247 252 { 248 $DbResult = $Database->SQLCommand( "SELECT user FROM `user` WHERE ID=".$_SESSION['UserID']);249 $User = mysql_fetch_assoc($DbResult); 250 } else $User = array('user' => 'Neznámý'); 251 252 $WhereLang = ''; 253 if($Setting['language-cz']) $WhereLang .= " OR (Language = 1)";254 if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)";255 if($Setting['language-other']) $WhereLang .= " OR (Language = 3)";253 $DbResult = $Database->SQLCommand('SELECT user FROM `user` WHERE ID='.$_SESSION['UserID']); 254 $User = mysql_fetch_assoc($DbResult); 255 } else $User = array('user' => 'Neznámý'); 256 257 $WhereLang = ''; 258 foreach($LanguageList as $Language) 259 if($Language['Enabled'] == 1) 260 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 256 261 if($WhereLang == '') $WhereLang = 1; 257 262 else $WhereLang = '('.substr($WhereLang, 4).')'; … … 311 316 function ExportToLua($Setting) 312 317 { 313 global $Database, $Config, $TranslationTree ;318 global $Database, $Config, $TranslationTree, $LanguageList; 314 319 315 320 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/lua/'; … … 323 328 324 329 $WhereLang = ''; 325 if($Setting['language-cz']) $WhereLang .= " OR (Language = 1)";326 if($Setting['language-sk']) $WhereLang .= " OR (Language = 2)";327 if($Setting['language-other']) $WhereLang .= " OR (Language = 3)";330 foreach($LanguageList as $Language) 331 if($Language['Enabled'] == 1) 332 if(isset($Setting['language'.$Language['Id']])) $WhereLang .= ' OR (Language = '.$Language['Id'].')'; 328 333 if($WhereLang == '') $WhereLang = 1; 329 334 else $WhereLang = '('.substr($WhereLang, 4).')';
Note:
See TracChangeset
for help on using the changeset viewer.