Changeset 180
- Timestamp:
- Apr 15, 2009, 8:30:13 PM (16 years ago)
- Location:
- trunk/export
- Files:
-
- 32 added
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/create_addon.php
r151 r180 180 180 while($Line = mysql_fetch_array($DbResult)) 181 181 { 182 $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original']))); 183 $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Translation']))); 184 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original); 185 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated); 182 $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original']))); 183 $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Translation']))); 184 if ($Setting['Export'] == 'Addon-2.x.x') { 185 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original); 186 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated); 187 } 186 188 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n"; 187 189 } … … 191 193 while($Line = mysql_fetch_array($DbResult)) 192 194 { 193 $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original']))); 194 $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", $Line['Original'])); 195 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original); 196 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated); 195 $Original = str_replace("\r", '', str_replace("\n", '\r\\'."\n", addslashes($Line['Original']))); 196 $Translated = str_replace("\r", '', str_replace("\n", '\r\\'."\n", $Line['Original'])); 197 if ($Setting['Export'] == 'Addon-2.x.x') { 198 $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original); 199 $Translated = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Translated); 200 } 197 201 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n"; 198 202 } … … 595 599 MakeLanguageFiles($Setting); 596 600 MakeClientStrings($Setting); 597 MakeMainScript($Setting);601 // MakeMainScript($Setting); 598 602 } 599 603 -
trunk/export/export.php
r179 r180 129 129 $ID = $Database->SQLCommand($Query); 130 130 while($Line = mysql_fetch_assoc($ID)) { 131 $Ori_text = $Line['name']; 131 132 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT text as en, 132 133 (SELECT text FROM '.$Config['Database']['Database'].'.global_strings as tabletran … … 134 135 AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.') LIMIT 1) as tran 135 136 FROM '.$Config['Database']['Database'].'.global_strings as tableen WHERE 136 text = "'.addslashes($ Line['name']).'" LIMIT 1'));137 text = "'.addslashes($Ori_text).'" LIMIT 1')); 137 138 //echo ($Line['name'].'='.$Tran['tran']); 139 if ($Tran['tran'] <> '') {} else { 140 $Tran = mysql_fetch_assoc($Database->SQLCommand('SELECT OptionText as en, 141 (SELECT OptionText FROM '.$Config['Database']['Database'].'.npc_option as tabletran 142 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$WhereLang.' 143 AND '.$WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.') LIMIT 1) as tran 144 FROM '.$Config['Database']['Database'].'.npc_option as tableen WHERE 145 OptionText = "'.addslashes($Ori_text).'" LIMIT 1')); 146 } 138 147 if ($Tran['tran'] <> '') 139 148 $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET name = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n"; -
trunk/export/index.php
r178 r180 54 54 if(!isset($ExportSetting['language-other'])) $ExportSetting['language-other'] = 1; 55 55 if(!isset($ExportSetting['users-order'])) $ExportSetting['users-order'] = ''; 56 if(!isset($ExportSetting['Export'])) $ExportSetting['Export'] = 'Addon ';56 if(!isset($ExportSetting['Export'])) $ExportSetting['Export'] = 'Addon-3.x.x'; 57 57 if(!isset($ExportSetting['groups'])) $ExportSetting['groups'] = array(); 58 58 … … 201 201 } else echo('Nemáte oprávnění.'); 202 202 break;*/ 203 case 'Addon ':204 if(function_exists('gzcompress')) 205 { 206 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW /';207 echo('Generování addonu... <br />');203 case 'Addon-2.x.x': 204 if(function_exists('gzcompress')) 205 { 206 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW-2.x.x/'; 207 echo('Generování addonu...'.$ExportSetting['Export'].'<br />'); 208 208 MakeAddon($ExportSetting); 209 $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Addon .zip';209 $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Addon-2.x.x.zip'; 210 210 $Zip = new zipfile(); 211 211 CreateZipFromDir($Zip, $TempDir, 'CzWoW/'); 212 $Zip->addFile(file_get_contents('CzWoW/OptionsFrame.xml'), 'CzWoW/OptionsFrame.xml'); 213 $Zip->addFile(file_get_contents('CzWoW/CzWoW.xml'), 'CzWoW/CzWoW.xml'); 214 $Zip->addFile(file_get_contents('CzWoW/CzWoW.toc'), 'CzWoW/CzWoW.toc'); 215 //$Zip->addFile(file_get_contents('addon/CzWoW/CzWoW.lua'), 'CzWoW/CzWoW.lua'); 216 $Zip->addFile(file_get_contents('CzWoW/GameMenuFrame.xml'), 'CzWoW/GameMenuFrame.xml'); 217 $Zip->addFile(file_get_contents('CzWoW/Localization.lua'), 'CzWoW/Localization.lua'); 218 $Zip->addFile(file_get_contents('ProffBot/ProffBot.toc'), 'ProffBot/ProffBot.toc'); 219 $Zip->addFile(file_get_contents('ProffBot/ProffBot.xml'), 'ProffBot/ProffBot.xml'); 220 $Zip->addFile(file_get_contents('ProffBot/ProffBot.lua'), 'ProffBot/ProffBot.lua'); 212 $Zip->addFile(file_get_contents('files/2.4.3/CzWoW/OptionsFrame.xml'), 'CzWoW/OptionsFrame.xml'); 213 $Zip->addFile(file_get_contents('files/2.4.3/CzWoW/CzWoW.xml'), 'CzWoW/CzWoW.xml'); 214 $Zip->addFile(file_get_contents('files/2.4.3/CzWoW/CzWoW.toc'), 'CzWoW/CzWoW.toc'); 215 $Zip->addFile(file_get_contents('files/2.4.3/CzWoW/CzWoW.lua'), 'CzWoW/CzWoW.lua'); 216 $Zip->addFile(file_get_contents('files/2.4.3/CzWoW/GameMenuFrame.xml'), 'CzWoW/GameMenuFrame.xml'); 217 $Zip->addFile(file_get_contents('files/2.4.3/CzWoW/Localization.lua'), 'CzWoW/Localization.lua'); 218 219 $Zip->addFile(file_get_contents('files/2.4.3/ProffBot/ProffBot.toc'), 'ProffBot/ProffBot.toc'); 220 $Zip->addFile(file_get_contents('files/2.4.3/ProffBot/ProffBot.xml'), 'ProffBot/ProffBot.xml'); 221 $Zip->addFile(file_get_contents('files/2.4.3/ProffBot/ProffBot.lua'), 'ProffBot/ProffBot.lua'); 221 222 $Buffer = $Zip->file(); 222 223 file_put_contents($SaveFilename, $Buffer); … … 228 229 229 230 echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '. 230 '<a href="'.$SaveFilename.'">CzWoW_Addon.zip</a><br />'. 231 '<a href="'.$SaveFilename.'">CzWoW_Addon-2.x.x.zip</a><br />'. 232 'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.'); 233 echo('<br /><strong>Použití ve hře</strong><br />Menu addonu ve hře vyvoláte povelem /czwow.'); 234 break; 235 case 'Addon-3.x.x': 236 if(function_exists('gzcompress')) 237 { 238 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW-3.x.x/'; 239 echo('Generování addonu...'.$ExportSetting['Export'].'<br />'); 240 MakeAddon($ExportSetting); 241 $SaveFilename = $Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Addon-3.x.x.zip'; 242 $Zip = new zipfile(); 243 CreateZipFromDir($Zip, $TempDir, 'CzWoW/'); 244 $Zip->addFile(file_get_contents('files/3.0.9/CzWoW/OptionsFrame.xml'), 'CzWoW/OptionsFrame.xml'); 245 $Zip->addFile(file_get_contents('files/3.0.9/CzWoW/CzWoW.xml'), 'CzWoW/CzWoW.xml'); 246 $Zip->addFile(file_get_contents('files/3.0.9/CzWoW/CzWoW.toc'), 'CzWoW/CzWoW.toc'); 247 $Zip->addFile(file_get_contents('files/3.0.9/CzWoW/CzWoW.lua'), 'CzWoW/CzWoW.lua'); 248 $Zip->addFile(file_get_contents('files/3.0.9/CzWoW/GameMenuFrame.xml'), 'CzWoW/GameMenuFrame.xml'); 249 $Zip->addFile(file_get_contents('files/3.0.9/CzWoW/Localization.lua'), 'CzWoW/Localization.lua'); 250 $Buffer = $Zip->file(); 251 file_put_contents($SaveFilename, $Buffer); 252 echo('Hotovo<br /><br />'); 253 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 254 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 255 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 1000)'. 256 '</script>'); 257 258 echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '. 259 '<a href="'.$SaveFilename.'">CzWoW_Addon-3.x.x.zip</a><br />'. 231 260 'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.'); 232 261 echo('<br /><strong>Použití ve hře</strong><br />Menu addonu ve hře vyvoláte povelem /czwow.'); … … 337 366 RadioButton('Export', 'XMLDirect', $ExportSetting['Export'] == 'XMLDirect').'XML - přímo zobrazit<br />'. 338 367 RadioButton('Export', 'XMLCompressed', $ExportSetting['Export'] == 'XMLCompressed').'XML - komprimovaný soubor<br />'. 339 RadioButton('Export', 'Addon', $ExportSetting['Export'] == 'Addon').'Addon - komprimovaný soubor<br />'. 368 RadioButton('Export', 'Addon-2.x.x', $ExportSetting['Export'] == 'Addon-2.x.x').'Addon pro verzi 2.x.x - komprimovaný soubor<br />'. 369 RadioButton('Export', 'Addon-3.x.x', $ExportSetting['Export'] == 'Addon-3.x.x').'Addon pro verzi 3.x.x (beta) - komprimovaný soubor<br />'. 340 370 RadioButton('Export', 'Lua', $ExportSetting['Export'] == 'Lua').'Lua skripty - komprimovaný soubor<br />'); 341 371 if(Licence(LICENCE_ADMIN)) {
Note:
See TracChangeset
for help on using the changeset viewer.