Changeset 297
- Timestamp:
- Dec 28, 2009, 2:32:52 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/export/create_addon.php
r291 r297 97 97 98 98 $CreatedFileList[] = $Column['AddonFileName'].'_'.$FileIndex; 99 $FileName = $this->TempDir.$Column['AddonFileName'].'_'.$FileIndex.'.lua'; 99 $FileName = $this->TempDir.'CzWoW/'.$Column['AddonFileName'].'_'.$FileIndex.'.lua'; 100 if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true); 100 101 echo($Column['AddonFileName'].': '); 101 102 $i = 0; … … 129 130 $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n"; 130 131 $Buffer .= '</Ui>'; 131 file_put_contents($this->TempDir.' Translates.xml', $Buffer);132 file_put_contents($this->TempDir.'CzWoW/Translates.xml', $Buffer); 132 133 } 133 134 … … 168 169 $Buffer .= 'f("'.addslashes($Line['ShortCut']).'", "'.$Original.'", "'.$Translated.'");'."\n"; 169 170 } 170 file_put_contents($this->TempDir.' LocalizationStrings.lua', $Buffer);171 file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer); 171 172 } 172 173 -
trunk/export/export.php
r293 r297 36 36 // Filter selected users 37 37 $this->SelectedUsers = ''; 38 $DbResult = $this->Database->query('SELECT * FROM `ExportUser` WHERE Export='.$this->Id.' ORDER BY Sequence'); 38 $this->UserNames = ''; 39 $DbResult = $this->Database->query('SELECT ExportUser.*, user.user FROM `ExportUser` LEFT JOIN user ON user.ID=ExportUser.User WHERE ExportUser.Export='.$this->Id.' ORDER BY ExportUser.Sequence'); 39 40 while($User = $DbResult->fetch_assoc()) 41 { 40 42 $this->SelectedUsers .= ','.$User['User']; 43 $this->UserNames .= ','.$User['user']; 44 } 41 45 $this->SelectedUsers = substr($this->SelectedUsers, 1); 42 43 if($this->SelectedUsers == '') $Where = 0; 44 else $Where = 'ID IN ('.$this->SelectedUsers.')'; 45 46 $this->UserNames = ''; 47 $DbResult = $this->Database->query('SELECT user FROM `user` WHERE '.$Where); 48 while($DbRow = $DbResult->fetch_assoc()) 49 $this->UserNames .= ','.$DbRow['user']; 50 $this->UserNames = substr($this->UserNames, 1); 46 $this->UserNames = substr($this->UserNames, 1); 51 47 52 48 if($this->SelectedUsers == '') 53 49 { 54 $this->WhereUsers = 1;50 $this->WhereUsers = 0; 55 51 $this->OrderByUserList = ''; 56 52 } else … … 60 56 } 61 57 58 // Load logged user 62 59 if(isset($_SESSION) and ($_SESSION['UserID'] != '')) 63 60 { … … 101 98 if($Group['MangosTable'] != '') 102 99 { 103 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers. ' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';100 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T GROUP BY T.entry'; 104 101 //echo($Query); 105 102 $Buffer .= "\n\n-- ".$Group['Name']."\n\n"; … … 129 126 130 127 $Buffer = $this->ExportToMangosSQL(); 131 132 $this->LoadFilters(); 133 128 134 129 // Data to aowow 135 130 … … 137 132 $Database2->query('SET NAMES '.$this->Config['Database']['Charset']); 138 133 $Database2->select_db($AoWoWconf['mangos']['db']); 139 $AoWoWTables = array('aowow_resistances' => 'Id', 'aowow_spelldispeltype' => 'Id', 'aowow_skill' => 'skillID'); 134 $AoWoWTables = array( 135 'aowow_resistances' => 'Id', 136 'aowow_spelldispeltype' => 'Id', 137 'aowow_skill' => 'skillID', 138 ); 140 139 foreach($AoWoWTables as $AoWoWTable => $IndexColum) 141 140 { … … 147 146 { 148 147 $Ori_text = $Line['name']; 149 $DbResult2 = $Dat base2->query('SELECT text as en,148 $DbResult2 = $Database2->query('SELECT text as en, 150 149 (SELECT text FROM '.$Config['Database']['Database'].'.global_strings as tabletran 151 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$ WhereLang.'152 AND '.$ WhereUsers.' ORDER BY FIELD(User, '.$SelectedUsers.')LIMIT 1) as tran150 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$this->WhereLang.' 151 AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) as tran 153 152 FROM '.$Config['Database']['Database'].'.global_strings as tableen WHERE 154 153 text = "'.addslashes($Ori_text).'" LIMIT 1'); … … 160 159 (SELECT OptionText FROM '.$this->Config['Database']['Database'].'.npc_option as tabletran 161 160 WHERE tableen.entry = tabletran.entry AND (Complete = 1) AND '.$this->WhereLang.' 162 AND '.$this->WhereUsers. ' ORDER BY FIELD(User, '.$this->SelectedUsers.')LIMIT 1) as tran161 AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) as tran 163 162 FROM '.$this->Config['Database']['Database'].'.npc_option as tableen WHERE 164 163 OptionText = "'.addslashes($Ori_text).'" LIMIT 1'); … … 205 204 $Group['MangosTableIndex'] = 'entry'; 206 205 } 207 $Query = 'SELECT *,(SELECT user FROM user WHERE user.ID=T.User) as UserName FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';208 //echo($Query);206 $Query = 'SELECT *,(SELECT user FROM user WHERE user.ID=T.User) as UserName FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND (VersionStart <= '.$this->ClientVersion['BuildNumber'].') AND (VersionEnd >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T GROUP BY T.entry'; 207 echo($Query); 209 208 $Buffer .= ' <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n"; 210 209 $DbResult2 = $this->Database->query($Query); … … 239 238 { 240 239 echo($Group['Name'].'... '); 240 if(file_exists('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) 241 { 241 242 $DBCFile = new DBCFile(); 242 $DBCFile->OpenFile('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($ Setting['Version'], $Group['DBCFileName']));243 $DBCFile->OpenFile('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName'])); 243 244 $DBCFile2 = new DBCFile(); 244 $DBCFile2->CreateFile($this->TempDir.$Group['DBCFileName'].'.dbc', GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName'])); 245 if(!file_exists($this->TempDir.'dbc/')) mkdir($this->TempDir.'dbc/', 0777, true); 246 $DBCFile2->CreateFile($this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName'])); 245 247 $Count = $DBCFile->GetRecordCount(); 246 248 //if($Group['DBCFileName'] == 'Spell') $Count = 1000; … … 267 269 $DBCFile2->Commit(); 268 270 echo('Hotovo <br />'); 271 } else echo('Zdrojový soubor '.'../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n"); 269 272 } 270 273 } … … 283 286 $File->OpenFile('../source/'.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua'); 284 287 $File2 = new FileStream(); 285 $File2->CreateFile($this->TempDir.''.$Group['LuaFileName'].'.lua'); 288 if(!file_exists($this->TempDir.'lua/')) mkdir($this->TempDir.'lua/', 0777, true); 289 $File2->CreateFile($this->TempDir.'lua/'.$Group['LuaFileName'].'.lua'); 286 290 287 291 while(!$File->EOF()) … … 296 300 $Value['Comment'] = addslashes(substr(trim($LineParts[1]), 3)); 297 301 298 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' ORDER BY FIELD(User, '.$this->SelectedUsers.')) AS T GROUP BY T.entry';302 $Query = 'SELECT * FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (ShortCut="'.$Value['ShortCut'].'") AND (VersionStart <= '.$this->ClientVersion['BuildNumber'].') AND (VersionEnd >= '.$this->ClientVersion['BuildNumber'].')'.$this->OrderByUserList.') AS T GROUP BY T.entry'; 299 303 //echo($Query); 300 304 $DbResult2 = $this->Database->query($Query); -
trunk/export/export_output.php
r292 r297 39 39 file_put_contents($SaveFilename, $Buffer); 40 40 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 41 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.42 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.43 '</script>');41 //echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 42 // 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'. 43 // '</script>'); 44 44 45 45 echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '. … … 111 111 112 112 echo('Generování addonu...<br />'); 113 $SaveFilename = $ Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Addon-'.$Addon->ClientVersion['Version'].'.zip';113 $SaveFilename = $Addon->TempDir.'CzWoW_Addon-'.$Addon->ClientVersion['Version'].'.zip'; 114 114 $Zip = new zipfile(); 115 115 CreateZipFromDir($Zip, $Addon->TempDir, 'CzWoW/'); … … 124 124 echo('Hotovo<br /><br />'); 125 125 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 126 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.127 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.128 '</script>');129 130 echo(' Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '.126 //echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 127 // 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'. 128 // '</script>'); 129 130 echo('Soubor ke stažení: '. 131 131 '<a href="'.$SaveFilename.'">CzWoW_Addon-'.$Addon->ClientVersion['Version'].'.zip</a><br />'. 132 132 '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.'); … … 151 151 file_put_contents($SaveFilename, $Buffer); 152 152 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 153 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'.154 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'.155 '</script>');153 //echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 154 // 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'. 155 // '</script>'); 156 156 157 157 echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '. … … 174 174 function OutputDBCToFile($ExportId) 175 175 { 176 global $Database ;176 global $Database, $System; 177 177 178 178 echo('<form action="?Action=View&Tab=6&ExportId='.$ExportId.'" method="post"><input type="submit" name="Regenerate" value="Přegenerovat"/></form><br />'); 179 echo('U DBC souborů export textů funguje jinak, protože generování je náročné na výpočet provádí se přes noc, kdy je server nejmíň vytížen. Nyní jste zadali úlohu, která se provede v noci. Zítra si můžete stáhnout vygenerovaný soubor v sekci <a href="../download.php">Stahování</a>.<br /><br />DBC soubory je nutné zabalit do souboru patch-enGB-5.MPQ uvnitř složky "DBFilesClient" a hru spouštět přes wowme.exe. Zabalit to můžete pomocí programu <a href="../download/mpqediten32.zip">Ladik\'s MPQ Editor</a>. Stav vygenerování můžete sledovat na této stránce, kde si také můžete zítra soubor stáhnout.<br /><br />');179 echo('U DBC souborů export textů funguje jinak, protože generování je náročné, jsou požadavky zařazovány do fronty a postupně zpracovávány.<br />DBC soubory je nutné zabalit do souboru patch-enGB-5.MPQ uvnitř složky "DBFilesClient" a hru spouštět přes program wowme.exe (WoW Model Edit). Zabalit je můžete pomocí programu <a href="../download/mpqediten32.zip">Ladik\'s MPQ Editor</a>. Stav vygenerování můžete sledovat na této stránce.<br /><br />'); 180 180 181 181 $DbResult = $Database->SQLCommand('SELECT * FROM ExportTask WHERE Export = '.$ExportId); … … 195 195 if($ExportTask['TimeFinish'] > $ExportTask['TimeStart']) 196 196 { 197 echo('<strong>Soubor ke stažení: <a href="../tmp/Export/'.$ExportTask['Export'].'/CzWoW_DBC.zip">CzWoW_DBC.zip</a></strong><br/>'); 197 echo('<strong>Souhrný balík: <a href="../tmp/Export/'.$ExportTask['Export'].'/CzWoW_DBC.zip">CzWoW_DBC.zip</a></strong><br/>'); 198 $Export = new Export($System); 199 $Export->Id = $ExportId; 200 $Export->Init(); 201 $DbResult = $System->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `group`.`DBCFileName` != ""'); 202 while($Group = $DbResult->fetch_assoc()) 203 { 204 if(file_exists($Export->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc')) echo('<a href="'.$Export->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc">'.$Group['DBCFileName'].'.dbc</a><br/>'); 205 } 198 206 } else echo('<strong>Soubor čeká na zpracování ve frontě.</strong><br/>'); 199 207 } … … 210 218 { 211 219 echo('Generování lua souborů...<br />'); 212 $Export->ExportToL UA();213 $SaveFilename = $ Config['Web']['TempFolder'].$_SESSION['User'].'/CzWoW_Lua.zip';214 $Zip = new zipfile();215 CreateZipFromDir($Zip , $Export->TempDir, '');216 $Buffer = $Zip ->file();220 $Export->ExportToLua(); 221 $SaveFilename = $Export->TempDir.'CzWoW_Lua.zip'; 222 $ZipFile = new zipfile(); 223 CreateZipFromDir($ZipFile, $Export->TempDir.'lua/', ''); 224 $Buffer = $ZipFile->file(); 217 225 file_put_contents($SaveFilename, $Buffer); 218 226 echo('Hotovo<br /><br />'); 219 227 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 220 echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 221 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'. 222 '</script>'); 223 224 echo('Pokud nezačalo stahování, soubor by mělo jít stáhnout pomocí tohoto odkazu: '. 225 '<a href="'.$SaveFilename.'">CzWoW_Lua.zip</a><br />'. 226 '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.'); 228 //echo('<script type="text/javascript" language="JavaScript" charset="utf-8">'. 229 // 'setTimeout("parent.location.href=\''.$SaveFilename.'\'", 3000)'. 230 // '</script>'); 231 232 echo('<strong>Soubory:</strong><br/>'. 233 'Souhrný archív <a href="'.$SaveFilename.'">CzWoW_Lua.zip</a><br />'); 234 $DbResult = $System->Database->query('SELECT `group`.* FROM `ExportGroup` JOIN `group` ON `group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `group`.`LuaFileName` != ""'); 235 while($Group = $DbResult->fetch_assoc()) 236 { 237 echo('<a href="'.$Export->TempDir.'lua/'.$Group['LuaFileName'].'.lua">'.$Group['LuaFileName'].'.lua</a><br/>'); 238 } 227 239 echo('<br /><br /><strong>Použití ve hře</strong><br />Ze souborů vytvořte MPQ archív a nahrajte ho do hry do podsložky Data/enUS jako patch-enUS-5.MPQ. Hru spusťte pomocí programu WoWMe.exe (WoW Model Editor Fix).'); 228 240 } -
trunk/export/index.php
r295 r297 1 1 <?php 2 3 session_start();4 2 5 3 include_once('../includes/global.php'); … … 34 32 array('Name' => 'TimeCreate', 'Title' => 'Čas vytvoření'), 35 33 array('Name' => 'UserName', 'Title' => 'Překladatel'), 36 array('Name' => 'Title', 'Title' => ' Popis'),34 array('Name' => 'Title', 'Title' => 'Označení'), 37 35 array('Name' => 'UsedCount', 'Title' => 'Prohlédnutí výstupu'), 38 array('Name' => 'UserCount', 'Title' => ' Překladatelů'),36 array('Name' => 'UserCount', 'Title' => 'Vybraných překladatelů'), 39 37 array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'), 40 38 array('Name' => '', 'Title' => 'Akce'), … … 59 57 function ExportCreate() 60 58 { 59 global $Database, $Config; 60 61 61 if(Licence(LICENCE_USER)) 62 62 { 63 echo('<form action="?Action=CreateFinish" method="post">'. 63 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM Export WHERE User='.$_SESSION['UserID']); 64 $DbRow = mysql_fetch_row($DbResult); 65 if($DbRow[0] < $Config['MaxExportPerUser']) 66 { 67 echo('<form action="?Action=CreateFinish" method="post">'. 64 68 '<fieldset><legend>Vytvoření nového exportu</legend>'. 65 '<table><tr><td>Titulek:</td><td><input type="text" name="Title" /></td></tr>'. 69 '<table><tr><td>Označení:</td><td><input type="text" name="Title" /></td></tr>'. 70 '<tr><td>Popis:</td><td><textarea name="Description" cols="54" rows="10"></textarea></td></tr>'. 66 71 '<tr><td colspan="2"><input type="submit" value="Vytvořit" /></td></tr>'. 67 72 '</table></fieldset></form>'); 73 } else echo('Nemůžete vytvářet další export. Max. počet na uživatele je '.$Config['MaxExportPerUser'].'.'); 68 74 } else echo('Nemáte oprávnění'); 69 75 } … … 71 77 function ExportCreateFinish() 72 78 { 73 global $Database ;79 global $Database, $Config; 74 80 75 81 if(Licence(LICENCE_USER)) 76 82 { 77 if(array_key_exists('Title', $_POST)) 78 { 79 $Database->SQLCommand('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`) VALUES ("'.$_POST['Title'].'", '.$_SESSION['UserID'].', NOW())'); 80 $ExportId = mysql_insert_id(); 81 echo('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&ExportId='.$ExportId.'">zde</a><br/><br/>'); 82 $_GET['Filter'] = 'my'; 83 ExportList(); 83 if(array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST)) 84 { 85 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Export` WHERE `User`='.$_SESSION['UserID']); 86 $DbRow = mysql_fetch_row($DbResult); 87 if($DbRow[0] < $Config['MaxExportPerUser']) 88 { 89 $Database->SQLCommand('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$_SESSION['UserID'].', NOW(), 1, "'.$_POST['Description'].'")'); 90 $ExportId = mysql_insert_id(); 91 echo('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&ExportId='.$ExportId.'">zde</a><br/><br/>'); 92 $_GET['Filter'] = 'my'; 93 ExportList(); 94 } else echo('Nemůžete vytvářet další export. Max. počet na uživatele je '.$Config['MaxExportPerUser'].'.'); 84 95 } else echo('Chybí údaje formuláře'); 85 96 } else echo('Nemáte oprávnění'); -
trunk/export/process_task.php
r292 r297 17 17 if($DbRow['ExportId'] != '') 18 18 { 19 $Export = new Export($System); 20 $Export->Id = $DbRow['Export']; 21 $Export->Init(); 19 try 20 { 21 $Export = new Export($System); 22 $Export->Id = $DbRow['Export']; 23 $Export->Init(); 22 24 23 if(function_exists('gzcompress')) 25 if(function_exists('gzcompress')) 26 { 27 echo('Generování DBC souborů pro export '.$Export->Id.'.. '."\n"); 28 $Export->ExportToDBC(); 29 $SaveFilename = $Export->TempDir.'/CzWoW_DBC.zip'; 30 $Zip = new zipfile(); 31 CreateZipFromDir($Zip, $Export->TempDir.'dbc/', 'DBFilesClient/'); 32 $Buffer = $Zip->file(); 33 file_put_contents($SaveFilename, $Buffer); 34 echo('Hotovo'); 35 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 36 $Database->SQLCommand('UPDATE ExportTask SET TimeFinish=NOW() WHERE Export='.$Export->Id); 37 } catch (Exception $e) 24 38 { 25 echo('Generování DBC souborů pro export '.$Export->Id.'.. '."\n"); 26 $Export->ExportToDBC(); 27 $SaveFilename = $Config['Web']['TempFolder'].'Export/'.$Export->Id.'/CzWoW_DBC.zip'; 28 $Zip = new zipfile(); 29 CreateZipFromDir($Zip, $Export->TempDir, 'DBFilesClient/'); 30 $Buffer = $Zip->file(); 31 file_put_contents($SaveFilename, $Buffer); 32 echo('Hotovo'); 33 } else echo('Funkce pro tvorbu Zip souboru není podporována!'); 34 $Database->SQLCommand('UPDATE ExportTask SET TimeFinish=NOW() WHERE Export='.$Export->Id); 39 echo 'Caught exception: ', $e->getMessage(), "\n"; 40 } 35 41 } else echo('Export '.$DbRow['Export'].' nenalezen'."\n"); 36 42 } -
trunk/includes/config.sample.php
r292 r297 26 26 ), 27 27 'ExportTashProcessPeriod' => 10, 28 'MaxExportPerUser' => 10, 28 29 ); 29 30 -
trunk/includes/dbc.php
r234 r297 38 38 $this->GenerateOffsetTable($Format); 39 39 if($this->Offsets[count($this->Offsets) - 1] != $this->RecordSize) 40 40 die(RECORD_SIZE_NOT_MATCH.$this->Offsets[count($this->Offsets) - 1].' <> '.$this->RecordSize); 41 41 } 42 42 … … 47 47 $this->WriteUint(0x43424457); 48 48 49 50 49 $this->StringList = array(); 50 $this->StringOffset = 1; 51 51 $this->Format = $Format; 52 52 $this->GenerateOffsetTable($Format); 53 54 55 56 53 $this->FieldCount = strlen($Format); 54 $this->RecordCount = 0; 55 $this->RecordSize = $this->Offsets[count($this->Offsets) - 1]; 56 $this->StringBlockSize = 0; 57 57 58 58 $this->WriteUint($this->RecordCount); … … 65 65 { 66 66 $this->Offsets = array(); 67 67 $this->Offsets[0] = 0; 68 68 for($I = 0; $I < strlen($Format); $I++) 69 69 { … … 72 72 { 73 73 case "b": 74 75 $this->Offsets[$I + 1] += 1; 76 74 case "X": 75 $this->Offsets[$I + 1] += 1; 76 break; 77 77 case "x": 78 79 80 81 82 $this->Offsets[$I + 1] += 4; 83 78 case "u": 79 case "i": 80 case "f": 81 case "s": 82 $this->Offsets[$I + 1] += 4; 83 break; 84 84 } 85 85 } … … 142 142 public function GetString($Row, $Column) 143 143 { 144 144 $Offset = $this->GetUint($Row, $Column); 145 145 146 146 $Position = $this->HeaderSize + $this->RecordCount * $this->RecordSize + $Offset; 147 147 if($Position >= $this->GetSize()) return(''); 148 148 $this->Seek($Position); 149 149 … … 158 158 public function SetString($Row, $Column, $Value) 159 159 { 160 161 162 163 164 165 166 167 168 169 160 if(in_array($Value, $this->StringList)) 161 { 162 $this->SetUint($Row, $Column, $this->StringListOffset[array_search($Value, $this->StringList)]); 163 } else 164 { 165 $this->SetUint($Row, $Column, $this->StringOffset); 166 $this->StringList[] = $Value; 167 $this->StringListOffset[] = $this->StringOffset; 168 $this->StringOffset += strlen($Value) + 1; 169 } 170 170 } 171 171 172 172 public function Commit() 173 173 { 174 174 $this->Seek(0); 175 175 $this->WriteUint(0x43424457); 176 176 $this->WriteUint($this->RecordCount); … … 178 178 $this->WriteUint($this->RecordSize); 179 179 $this->WriteUint($this->StringOffset); 180 181 182 183 { 180 $this->Seek($this->HeaderSize + $this->RecordCount * $this->RecordSize); 181 $this->WriteByte(0); 182 foreach($this->StringList as $Index => $Item) 183 { 184 184 $this->WriteString($Item); 185 185 } 186 186 } 187 187 … … 194 194 { 195 195 case 'b': 196 197 196 $Line[$I] = $this->GetByte($Row, $I); 197 break; 198 198 case 'u': 199 200 199 $Line[$I] = $this->GetUint($Row, $I); 200 break; 201 201 case 'i': 202 203 202 $Line[$I] = $this->GetInt($Row, $I); 203 break; 204 204 case 'f': 205 206 205 $Line[$i] = $this->GetFloat($Row, $I); 206 break; 207 207 case 's': 208 209 208 $Line[$I] = $this->GetString($Row, $I); 209 break; 210 210 case 'x': 211 212 213 211 case 'X': 212 default: 213 break; 214 214 } 215 215 } … … 224 224 { 225 225 case 'b': 226 227 226 $this->SetByte($Row, $I, $Line[$I]); 227 break; 228 228 case 'u': 229 230 229 $this->SetUint($Row, $I, $Line[$I]); 230 break; 231 231 case 'i': 232 233 232 $this->SetInt($Row, $I, $Line[$I]); 233 break; 234 234 case 'f': 235 236 235 $this->SetFloat($Row, $I, $Line[$i]); 236 break; 237 237 case 's': 238 239 238 $this->SetString($Row, $I, $Line[$I]); 239 break; 240 240 case 'x': 241 242 243 241 case 'X': 242 default: 243 break; 244 244 } 245 245 } … … 255 255 { 256 256 case 'b': 257 258 257 $Line[$I] = $this->GetByte($Row, $Columns[$I]); 258 break; 259 259 case 'u': 260 261 260 $Line[$I] = $this->GetUint($Row, $Columns[$I]); 261 break; 262 262 case 'i': 263 264 263 $Line[$I] = $this->GetInt($Row, $Columns[$I]); 264 break; 265 265 case 'f': 266 267 266 $Line[$i] = $this->GetFloat($Row, $Columns[$I]); 267 break; 268 268 case 's': 269 270 269 $Line[$I] = $this->GetString($Row, $Columns[$I]); 270 break; 271 271 case 'x': 272 273 274 272 case 'X': 273 default: 274 break; 275 275 } 276 276 } … … 280 280 public function GetRecordCount() 281 281 { 282 282 return($this->RecordCount); 283 283 } 284 284 285 285 public function SetRecordCount($Value) 286 286 { 287 287 $this->RecordCount = $Value; 288 288 } 289 289 290 290 public function GetFieldCount() 291 291 { 292 292 return($this->FieldCount); 293 293 } 294 294 } -
trunk/includes/global.php
r296 r297 14 14 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 15 15 16 include ('config.php');17 include ('error.php');18 include ('databaseconection.php');19 include ('global_function.php');20 include ('rss.php');16 include_once('config.php'); 17 include_once('error.php'); 18 include_once('databaseconection.php'); 19 include_once('global_function.php'); 20 include_once('rss.php'); 21 21 include_once('system.php'); 22 22 -
trunk/index.php
r294 r297 1 1 <?php 2 2 3 include ('includes/global.php');3 include_once('includes/global.php'); 4 4 5 5 function ShowNews() … … 10 10 $DbResult = $Database->SQLCommand('SELECT news.Time, user.user, news.Text FROM news JOIN user ON user.ID = news.User ORDER BY Time DESC LIMIT 10'); 11 11 while($DbRow = mysql_fetch_assoc($DbResult)) 12 $Output .= '<div><strong>'.$DbRow['user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>';12 $Output .= '<div><strong>'.$DbRow['user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')</strong> <br />'.$DbRow['Text'].'</div>'; 13 13 $Output .= '</div>'; 14 14 return($Output); … … 22 22 $DbResult = $Database->SQLCommand('SELECT date,user.user,text FROM log JOIN user ON user.ID = log.User WHERE type = 1 ORDER BY date DESC LIMIT 20'); 23 23 while($DbRow = mysql_fetch_assoc($DbResult)) 24 $Output .= '<strong>'.$DbRow['user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['date'])).')</strong>24 $Output .= '<strong>'.$DbRow['user'].' ('.date('d.m.Y', MysqlDateTimeToTime($DbRow['date'])).')</strong> 25 25 '.$DbRow['text'].' <br />'; 26 26 $Output .= '</div>'; -
trunk/readme.txt
r292 r297 47 47 Číslo id ve sloupci entry je však přiděleno dynamicky a pro různé verze mangosu by byly čísla generovány jinak. Proto je nutno při aktualizacích čísla přebrat synchronizovat vůči starým verzím. 48 48 49 8) Při startu systému je potřeba spustit skript export/process_task.php pro zpracování delé trvajících úloh exportů. 49 50 8) Při startu systému je potřeba spustit skript export/process_task.php pro zpracování delé trvajících úloh exportů. Proces musí být spuštěn pod uživatelem stejným jako web server (apache), kvůli správnému nastavování oprávnění. 50 51 51 52
Note:
See TracChangeset
for help on using the changeset viewer.