Changeset 200 for trunk/export/index.php
- Timestamp:
- Jun 9, 2009, 8:04:54 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/index.php
r197 r200 18 18 19 19 20 $Addon_verses = scandir('files', 1);21 unset($Addon_verses[count($Addon_verses) -1]);22 unset($Addon_verses[count($Addon_verses) -1]);23 unset($Addon_verses[count($Addon_verses) -1]);24 unset($Addon_verses[count($Addon_verses) -1]);20 $Addon_verses = scandir('files', 1); 21 unset($Addon_verses[count($Addon_verses) - 1]); 22 unset($Addon_verses[count($Addon_verses) - 1]); 23 unset($Addon_verses[count($Addon_verses) - 1]); 24 unset($Addon_verses[count($Addon_verses) - 1]); 25 25 26 26 … … 52 52 } 53 53 54 if (array_key_exists('ExportSetting',$_GET)) { 54 if (array_key_exists('ExportSetting',$_GET)) 55 { 55 56 $ExportSetting = unserialize(stripcslashes(stripcslashes($_GET['ExportSetting']))); 56 } else { 57 } else 58 { 57 59 if(array_key_exists('UserID', $_SESSION) and ($_SESSION['UserID'] != '')) 58 60 { … … 93 95 case 'result': 94 96 if (array_key_exists('Export',$_POST)) $ExportSetting['Export'] = $_POST['Export']; 95 switch($ExportSetting['Export'])96 {97 case 'MangosSQLCompressed':98 if(function_exists('gzcompress')) 99 { 100 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/';101 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);97 switch($ExportSetting['Export']) 98 { 99 case 'MangosSQLCompressed': 100 if(function_exists('gzcompress')) 101 { 102 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/'; 103 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 102 104 $SaveFilename = $TempDir.'CzWoW_SQL.zip'; 103 105 $SQLFilename = 'CzWoW_SQL.sql'; … … 115 117 '<a href="'.$SaveFilename.'">'.$SQLFilename.'</a><br />'. 116 118 '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.'); 117 break;118 case 'MangosSQLDirect':119 break; 120 case 'MangosSQLDirect': 119 121 echo('Vygenerovaný SQL kód: <br /><pre class="SQLCode">'); 120 122 echo(htmlspecialchars(ExportToMangosSQL($ExportSetting))); 121 123 echo('</pre>'); 122 124 break; 123 case 'AoWoWSQLCompressed':124 if(function_exists('gzcompress')) 125 { 126 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/';127 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);125 case 'AoWoWSQLCompressed': 126 if(function_exists('gzcompress')) 127 { 128 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/'; 129 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 128 130 $SaveFilename = $TempDir.'CzAoWoW_SQL.zip'; 129 131 $SQLFilename = 'CzAoWoW_SQL.sql'; … … 141 143 '<a href="'.$SaveFilename.'">'.$SQLFilename.'</a><br />'. 142 144 '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.'); 143 break;144 case 'AoWoWSQLDirect':145 break; 146 case 'AoWoWSQLDirect': 145 147 echo('Vygenerovaný SQL kód: <br /><pre class="SQLCode">'); 146 148 echo(htmlspecialchars(ExportToAoWoWSQL($ExportSetting))); 147 149 echo('</pre>'); 148 150 break; 149 case 'AoWoWImport':150 require_once('../aowow/configs/config.php');151 case 'AoWoWImport': 152 require_once('../aowow/configs/config.php'); 151 153 echo('Gewneruji SQL kód '); 152 154 $AoWoWSQL = ExportToAoWoWSQL($ExportSetting); 155 echo('<strong>Hotovo</strong><br />'); 156 157 $Database->SelectDatabase($AoWoWconf['mangos']['db']); 158 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 159 160 echo('Aktualizuji aktuality '); 161 $Database->SQLCommand("UPDATE `aowow_news` SET `text_loc0` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ', `text_loc8` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ' WHERE `aowow_news`.`id` =3"); 162 echo('<strong>Hotovo</strong><br />'); 163 164 echo('Mažu dočasné soubory '); 165 $files = scandir('../aowow/cache/mangos'); 166 foreach($files as $file) 167 { 168 $end = substr($file, strlen($file) - 3); 169 if($end == 'aww') unlink('../aowow/cache/mangos/'.$file); 170 } 171 $files = scandir('../aowow/cache/templates/wowhead'); 172 foreach($files as $file) 173 { 174 $end = substr($file, strlen($file) - 3); 175 if ($end == 'php') unlink('../aowow/cache/templates/wowhead/'.$file); 176 } 153 177 echo ('<strong>Hotovo</strong><br />'); 154 178 155 $Database->SelectDatabase($AoWoWconf['mangos']['db']);156 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);157 158 echo('Aktualizuji aktuality ');159 $Database->SQLCommand("UPDATE `aowow_news` SET `text_loc0` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ',160 `text_loc8` = 'Poslední aktualizace dat ".Date ("d. n. Y, H:i:s")." ' WHERE `aowow_news`.`id` =3");161 echo ('<strong>Hotovo</strong><br />');162 163 echo('Mažu dočasné soubory ');164 $files = scandir('../aowow/cache/mangos');165 foreach($files as $file) {166 $end = substr($file,strlen($file)-3);167 if ($end == 'aww') unlink('../aowow/cache/mangos/'.$file);168 }169 $files = scandir('../aowow/cache/templates/wowhead');170 foreach($files as $file) {171 $end = substr($file,strlen($file)-3);172 if ($end == 'php') unlink('../aowow/cache/templates/wowhead/'.$file);173 }174 echo ('<strong>Hotovo</strong><br />');175 176 179 echo('Importuji do AoWoW '); 177 178 179 180 if($Line <> '') $Database->SQLCommand($Line);181 echo('. ');182 }183 echo 180 $BufferArray = explode(";\n", $AoWoWSQL); 181 foreach($BufferArray as $Line) 182 { 183 if($Line <> '') $Database->SQLCommand($Line); 184 echo('. '); 185 } 186 echo('<strong>Hotovo</strong><br />'); 184 187 185 //TODO aowow_itemenchantmet, aowow_char_titles, aowow_factions, aowow_itemset, aowow_spelldispeltype, aowow_spellmechanic, aowow_spellrange, aowow_zones188 // TODO aowow_itemenchantmet, aowow_char_titles, aowow_factions, aowow_itemset, aowow_spelldispeltype, aowow_spellmechanic, aowow_spellrange, aowow_zones 186 189 187 $Database->SelectDatabase($Config['Database']['Database']);188 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']);190 $Database->SelectDatabase($Config['Database']['Database']); 191 $Database->SQLCommand('SET NAMES '.$Config['Database']['Charset']); 189 192 WriteLog('Plnění AoWoW databáze překladem', 4); 190 193 break; 191 case 'XMLCompressed':192 if(function_exists('gzcompress')) 193 { 194 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/';195 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true);194 case 'XMLCompressed': 195 if(function_exists('gzcompress')) 196 { 197 $TempDir = $Config['Web']['TempFolder'].$_SESSION['User'].'/'; 198 if(!file_exists($TempDir)) mkdir($TempDir, 0777, true); 196 199 $SaveFilename = $TempDir.'CzWoW_XML.zip'; 197 200 $SQLFilename = 'CzWoW_XML.sql'; … … 209 212 '<a href="'.$SaveFilename.'">CzWoW_SQL.zip</a><br />'. 210 213 '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.'); 211 214 break; 212 215 case 'XMLDirect': 213 216 echo('Vygenerované XML: <br /><pre class="SQLCode">');
Note:
See TracChangeset
for help on using the changeset viewer.