Changeset 443
- Timestamp:
- Apr 11, 2010, 11:48:39 AM (15 years ago)
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dbc_export/DBCExport.pas
r414 r443 11 11 12 12 type 13 13 14 { TDBCExport } 14 15 TDBCExport = class(TCustomApplication) … … 121 122 WriteLn(' -f --file Source DBC file name'); 122 123 WriteLn(' -n --newfile New created DBC file name'); 123 WriteLn(' -c --coltypedef DBC column type definition string (u - uint32, s - string)'); 124 WriteLn(' -c --coltypedef DBC column type definition string (usage index1:type1, index2:type2,...)'); 125 WriteLn(' where 0 - uint32, 1 - sint32, 2 - float, 3 - string, 4 - byte)'); 124 126 WriteLn(' -d --display Display DBC data'); 125 127 WriteLn(' -q --sql_query SQL select when entry is ID first column in dbc file and text1,text2... is texts columns'); -
tools/dbc_export/UDBC.pas
r415 r443 13 13 14 14 type 15 TDBCColumnType = (ct Int32, ctString, ctFloat);15 TDBCColumnType = (ctUInt32, ctSInt32, ctSingle, ctString, ctByte); 16 16 17 17 { TDBC } … … 26 26 public 27 27 Cells: array of array of Variant; 28 ColumnFormat: array of TColumnType; 28 29 function DetectColumnType(Column: Integer): TDBCColumnType; 29 30 procedure LoadFromFile(FileName: string); -
trunk/TranslationList.php
r437 r443 249 249 function ShowGroupTypeList() 250 250 { 251 global $Database ;251 global $Database, $User; 252 252 253 253 $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Group`'); … … 260 260 $TableColumns = array( 261 261 array('Name' => 'Name', 'Title' => 'Jméno'), 262 array('Name' => 'MangosTable', 'Title' => 'Tabulka MaNGOSu'), 263 array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'), 264 array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'), 262 array('Name' => 'SourceType', 'Title' => 'Typ zdroje'), 263 array('Name' => '', 'Title' => 'Zdroje'), 265 264 array('Name' => 'LastImport', 'Title' => 'Datum posledního importu'), 266 265 array('Name' => 'LastVersion', 'Title' => 'Verze posledního importu'), … … 273 272 while($Group = mysql_fetch_assoc($ID)) 274 273 { 275 echo('<tr><td><a href="?group='.$Group['Id'].'&action=filter">'.$Group['Name'].'</a></td><td>'.$Group['MangosTable'].'</td><td>'.$Group['DBCFileName'].'</td><td>'.$Group['LuaFileName'].'</td><td><a title="Změny po posledním importu u vybrané překladové skupiny" href="log.php?group='.$Group['Id'].'&type=11">'.HumanDate($Group['LastImport']).'</a></td><td>'.GetVersionWOW($Group['LastVersion']).'</td></tr>'); 274 echo('<tr><td><a href="?group='.$Group['Id'].'&action=filter">'.$Group['Name'].'</a></td><td>'.$Group['SourceType'].'</td><td>'); 275 if($Group['MangosTable'] != '') echo($Group['MangosTable'].'.sql '); 276 if($Group['DBCFileName'] != '') echo($Group['DBCFileName'].'.dbc '); 277 if($Group['LuaFileName'] != '') echo($Group['LuaFileName'].'.lua '); 278 echo('</td><td><a title="Změny po posledním importu u vybrané překladové skupiny" href="log.php?group='.$Group['Id'].'&type=11">'.HumanDate($Group['LastImport']).'</a></td><td>'.GetVersionWOW($Group['LastVersion']).'</td></tr>'); 276 279 } 277 280 echo('</table>'); 278 echo('<br /><a title="Záznam změn po importu" href="log.php?type=11">Záznam změn v textech při importu</a>'); 281 echo('<br /><a title="Záznam změn po importu" href="log.php?type=11">Záznam změn v textech při importu</a><br/>'); 282 //if($User->Licence(LICENCE_ADMIN)) echo('<a href="?action=groupadd">Přidat překladovou skupinu</a>'); 279 283 } 280 284 … … 321 325 } 322 326 327 function ShowGroupAdd() 328 { 329 global $User; 330 331 if($User->Licence(LICENCE_ADMIN)) 332 { 333 echo('<h3>Vložení nové skupiny</h3>'); 334 echo('<form action="?action=groupadd" method="post">'. 335 'Jméno: <input type="text" name="Name"/><br/>'. 336 'Název tabulky: <input type="text" name="TablePrefix"/><br/>'. 337 '</form>'); 338 } else echo('Nemáte oprávnění'); 339 } 340 323 341 ShowPage(); 324 342 … … 326 344 if($Action == 'filter') ShowMenu(); 327 345 else if($Action == 'grouplist') ShowGroupTypeList(); 346 else if($Action == 'groupadd') ShowGroupAdd(); 328 347 else 329 348 { -
trunk/export/export.php
r417 r443 247 247 if(file_exists('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) 248 248 { 249 $I = 1; 250 $Columns = ''; 251 foreach($TranslationTree[$Group['Id']]['Items'] as $Column) 252 { 253 $Columns .= '`T`.`'.$Column['Column'].'` AS `Text'.$I.'`, '; 254 $I = $I + 1; 249 // Load string column index list 250 $DbResult = $this->Database->query('SELECT * FROM `GroupItem` JOIN `GroupItemDBC` ON `GroupItem`.`Id` = `GroupItemDBC`.`GroupItem` AND `GroupItemDBC`.`ClientVersion` = '.$this->ClientVersion['Id'].' WHERE `GroupItem`.`Group` = '.$Group['Id']); 251 $ColumnIndexes = array(); 252 $ColumnFormat = array(); 253 while($DbRow = $DbResult->fetch_assoc()) 254 { 255 $ColumnFormat[$DbRow['ColumnIndex']] = FORMAT_STRING; 256 $ColumnIndexes[$DbRow['GroupItem']] = $DbRow['ColumnIndex']; 255 257 } 256 258 257 $Query = $this->BuildQuery($Group, $Columns); 258 $Query = str_replace('`', '\`', $Query); 259 $Query = '"'.str_replace(' ', '\ ', $Query).'"'; 259 // Load all data into lookup table 260 $LookupTable = array(); 261 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 262 while($DbRow = $DbResult2->fetch_assoc()) 263 $LookupTable[$DbRow['Entry']] = $DbRow; 260 264 261 $Params = '-u '.$Config['Database']['User'].' -p '.$Config['Database']['Password'].' -f ../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc -n '.$this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc -c '.GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName']).' -q '.$Query; 262 263 exec('./DBCExport '.$Params); 264 265 // Open original DBC file 266 $SourceDBCFile = new DBCFile(); 267 $SourceDBCFile->OpenFile('../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat); 268 269 // Create new DBC file 270 if(!file_exists($this->TempDir.'dbc/')) mkdir ($this->TempDir.'dbc/', 0777, true); 271 $NewDBCFile = new DBCFile(); 272 $NewDBCFile->CreateFile($this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat); 273 $NewDBCFile->SetRecordCount($SourceDBCFile->GetRecordCount()); 274 $NewDBCFile->SetFieldCount($SourceDBCFile->GetFieldCount()); 275 $NewDBCFile->Commit(); 276 277 // Replace translated strings 278 $OldProgress = -1; 279 echo("\n\r"); 280 $RowCount = $SourceDBCFile->GetRecordCount(); 281 $FieldCount = $SourceDBCFile->GetFieldCount(); 282 for($Row = 0; $Row < $RowCount; $Row++) 283 { 284 $Line = $SourceDBCFile->GetLine($Row); 285 /*foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem) 286 { 287 if(array_key_exists($GroupItem['Id'], $ColumnIndexes) and array_key_exists($Row, $LookupTable)) 288 $Line[$ColumnIndexes[$GroupItem['Id']]] = $LookupTable[$Row][$GroupItem['Column']]; 289 } 290 */ 291 $NewDBCFile->SetLine($Row, $Line); 292 293 // Show completion progress 294 $Progress = round($Row / $RowCount * 100); 295 if($Progress != $OldProgress) 296 { 297 echo($Progress."%\r"); 298 $OldProgress = $Progress; 299 } 300 } 301 $NewDBCFile->Commit(); 265 302 } else echo('Zdrojový soubor '.'../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n"); 266 303 } -
trunk/form.php
r437 r443 44 44 45 45 if(($Line['Language'] <> 0) and ($LineUser['Name'] <> '')) 46 echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> <br />');46 echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> dne '.HumanDate($Line['ModifyTime']).'<br />'); 47 47 if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID'])) 48 48 { -
trunk/import/import.php
r392 r443 9 9 function SetVersion($Version) 10 10 { 11 global $ Database;11 global $System; 12 12 13 $DbResult = $ Database->SQLCommand('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$Version.'"');14 $this->Version = mysql_fetch_assoc($DbResult);13 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'); 14 $this->Version = $DbResult->fetch_assoc(); 15 15 } 16 16 … … 199 199 function ImportDBC() 200 200 { 201 global $ Database, $TranslationTree, $Config;201 global $System, $TranslationTree, $Config; 202 202 203 203 echo('Načítání textů z DBC souboru...'); … … 205 205 { 206 206 echo('<br />'.$this->Group['Name'].'<br />'); 207 208 // Load string column index list 209 $DbResult = $System->Database->query('SELECT * FROM `GroupItem` JOIN `GroupItemDBC` ON `GroupItem`.`Id` = `GroupItemDBC`.`GroupItem` AND `GroupItemDBC`.`ClientVersion` = '.$this->Version['Id'].' WHERE `GroupItem`.`Group` = '.$this->Group['Id']); 210 $ColumnIndexes = array(); 211 $ColumnFormat = array(); 212 while($DbRow = $DbResult->fetch_assoc()) 213 { 214 $ColumnFormat[$DbRow['ColumnIndex']] = FORMAT_STRING; 215 $ColumnIndexes[$DbRow['GroupItem']] = $DbRow['ColumnIndex']; 216 } 217 207 218 $DBCFile = new DBCFile(); 208 $DBCFile->OpenFile('../source/'.$this->Version['Version'].'/dbc/'.$this->Group['DBCFileName'].'.dbc', GetDBCColumns($this->Version['Version'], $this->Group['DBCFileName']));219 $DBCFile->OpenFile('../source/'.$this->Version['Version'].'/dbc/'.$this->Group['DBCFileName'].'.dbc', $ColumnFormat); 209 220 $ItemCount = $DBCFile->GetRecordCount(); 210 221 $this->NewItemCount = 0; 211 $Count = 0; 212 for($i = 0; $i < $ItemCount; $i++) 222 $Count = 0; 223 224 for($I = 0; $I < $ItemCount; $I++) 213 225 { 214 226 foreach($this->Group['Items'] as $GroupItem) 215 227 { 216 $Value[$GroupItem['Column']] = addslashes($DBCFile->GetString($ i, GetDBCColumnIndex($this->Version['Version'], $this->Group['DBCFileName'], $GroupItem['Column'])));228 $Value[$GroupItem['Column']] = addslashes($DBCFile->GetString($I, $ColumnIndexes[$GroupItem['Id']])); 217 229 } 218 $Value['Entry'] = $DBCFile->GetUint($ i, 0);230 $Value['Entry'] = $DBCFile->GetUint($I, 0); 219 231 $this->InsertItem($Value); 220 232 $Count++; 221 233 } 222 234 echo('<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />'); 223 $ Database->SQLCommand('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']);235 $System->Database->query('UPDATE `Group` SET `LastVersion` = "'.$this->Version['BuildNumber'].'", `LastImport` = NOW() WHERE `Id`='.$this->Group['Id']); 224 236 } 225 237 echo('<strong>Dokončeno.</strong>'); -
trunk/import/index.php
r388 r443 78 78 echo($Order['Output']); 79 79 80 $ID = $Database->SQLCommand('SELECT * , CONCAT(`MangosDatabase`, ".", `MangosTable`, ", ", `DBCFileName`, ".dbc, ", `LuaMPQFolder`, "/", `LuaFileName`, ".lua" ) AS `SourceName`FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);80 $ID = $Database->SQLCommand('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']); 81 81 while($Group = mysql_fetch_assoc($ID)) 82 82 { 83 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['SourceType'].'</td><td>'.$Group['SourceName'].'</td><td><a title="Změny po posledním importu u vybrané překladové skupiny" href="log.php?group='.$Group['Id'].'&type=11">'.HumanDate($Group['LastImport']).'</a></td><td>'.GetVersionWOW($Group['LastVersion']).'</td><td><a href="?action=importgroup&id='.$Group['Id'].'">Importovat</a></td></tr>'); 83 echo('<tr><td>'.$Group['Name'].'</td><td>'.$Group['SourceType'].'</td><td>'); 84 if($Group['MangosTable'] != '') echo($Group['MangosTable'].'.sql '); 85 if($Group['DBCFileName'] != '') echo($Group['DBCFileName'].'.dbc '); 86 if($Group['LuaFileName'] != '') echo($Group['LuaFileName'].'.lua '); 87 echo('</td><td><a title="Změny po posledním importu u vybrané překladové skupiny" href="log.php?group='.$Group['Id'].'&type=11">'.HumanDate($Group['LastImport']).'</a></td><td>'.GetVersionWOW($Group['LastVersion']).'</td><td><a href="?action=importgroup&id='.$Group['Id'].'">Importovat</a></td></tr>'); 84 88 } 85 89 echo('</table>'); -
trunk/includes/dbc.php
r297 r443 4 4 5 5 define('NOT_DBC_FILE', 'Není DBC soubor.'); 6 define('FIELD_COUNT_NOT_MATCH', 'Počet sloupců neodpovídá délce formátu.');7 6 define('RECORD_SIZE_NOT_MATCH', 'Velikost řádku neodpovídá zadanému formátu.'); 8 7 8 define('DBC_SIGNATURE', 0x43424457); 9 10 define('FORMAT_UINT32', 0); 11 define('FORMAT_SINT32', 1); 12 define('FORMAT_SINGLE', 2); 13 define('FORMAT_STRING', 3); 14 define('FORMAT_BYTE', 4); 15 9 16 class DBCFile extends FileStream 10 17 { … … 14 21 private $StringList = array(); 15 22 private $StringListOffset = array(); 16 private $Format; 23 private $ColumnFormat; // Array (Index => Type) 24 private $EndOffset; // Calculated RecordSize according columns type 17 25 18 26 private $RecordSize; … … 21 29 private $FieldCount; 22 30 23 public function OpenFile($FileName, $ Format)31 public function OpenFile($FileName, $ColumnFormat = array()) 24 32 { 25 33 parent::OpenFile($FileName); 26 34 27 $this-> Format = $Format;28 if($this->ReadUint() != 0x43424457) die(NOT_DBC_FILE);35 $this->ColumnFormat = $ColumnFormat; 36 if($this->ReadUint() != DBC_SIGNATURE) die(NOT_DBC_FILE); 29 37 30 38 $this->RecordCount = $this->ReadUint(); … … 33 41 $this->StringBlockSize = $this->ReadUint(); 34 42 35 if(strlen($this->Format) != $this->FieldCount) 36 die(FIELD_COUNT_NOT_MATCH.' Počet v souboru:'.$this->FieldCount.' Počet v struktuře: '.strlen($Format)); 37 38 $this->GenerateOffsetTable($Format); 39 if($this->Offsets[count($this->Offsets) - 1] != $this->RecordSize) 40 die(RECORD_SIZE_NOT_MATCH.$this->Offsets[count($this->Offsets) - 1].' <> '.$this->RecordSize); 41 } 42 43 public function CreateFile($FileName, $Format) 43 $this->GenerateOffsetTable(); 44 if($this->EndOffset != $this->RecordSize) 45 die(RECORD_SIZE_NOT_MATCH.$this->EndOffset.' <> '.$this->RecordSize); 46 } 47 48 public function CreateFile($FileName, $ColumnFormat = array()) 44 49 { 45 50 parent::CreateFile($FileName); 46 51 47 $this->WriteUint( 0x43424457);52 $this->WriteUint(DBC_SIGNATURE); 48 53 49 54 $this->StringList = array(); 50 55 $this->StringOffset = 1; 51 $this-> Format = $Format;52 $this-> GenerateOffsetTable($Format);53 $this-> FieldCount = strlen($Format);56 $this->ColumnFormat = $ColumnFormat; 57 $this->FieldCount = 0; 58 $this->GenerateOffsetTable(); 54 59 $this->RecordCount = 0; 55 $this->RecordSize = $this-> Offsets[count($this->Offsets) - 1];60 $this->RecordSize = $this->EndOffset; 56 61 $this->StringBlockSize = 0; 57 62 … … 62 67 } 63 68 64 private function GenerateOffsetTable($Format) 65 { 66 $this->Offsets = array(); 67 $this->Offsets[0] = 0; 68 for($I = 0; $I < strlen($Format); $I++) 69 { 70 $this->Offsets[$I + 1] = $this->Offsets[$I]; 71 switch($Format[$I]) 69 private function GenerateOffsetTable() 70 { 71 // Preallocate array 72 if($this->FieldCount > 0) $this->Offsets = array_fill(0, $this->FieldCount, 0); 73 else $this->Offsets = array(); 74 75 $Offset = 0; 76 $I = 0; 77 while($I < $this->FieldCount) 78 { 79 $this->Offsets[$I] = $Offset; 80 if(array_key_exists($I, $this->ColumnFormat)) $Format = $this->ColumnFormat[$I]; 81 else $Format = FORMAT_UINT32; 82 switch($Format) 72 83 { 73 case "b": 74 case "X": 75 $this->Offsets[$I + 1] += 1; 76 break; 77 case "x": 78 case "u": 79 case "i": 80 case "f": 81 case "s": 82 $this->Offsets[$I + 1] += 4; 84 case FORMAT_BYTE: 85 $Offset += 1; 86 break; 87 case FORMAT_UINT32: 88 case FORMAT_SINT32: 89 case FORMAT_SINGLE: 90 case FORMAT_STRING: 91 $Offset += 4; 83 92 break; 84 93 } 94 $I++; 85 95 } 96 $this->EndOffset = $Offset; 86 97 } 87 98 … … 98 109 } 99 110 100 public function GetU int($Row, $Column)111 public function GetUInt($Row, $Column) 101 112 { 102 113 $this->SeekPosi($Row, $Column); … … 142 153 public function GetString($Row, $Column) 143 154 { 144 $Offset = $this->GetUint($Row, $Column);155 $Offset = $this->GetUint($Row, $Column); 145 156 146 157 $Position = $this->HeaderSize + $this->RecordCount * $this->RecordSize + $Offset; … … 172 183 public function Commit() 173 184 { 185 $this->SetSize($this->HeaderSize + $this->RecordSize * $this->RecordCount); // Preallocate file 174 186 $this->Seek(0); 175 $this->WriteUint( 0x43424457);187 $this->WriteUint(DBC_SIGNATURE); 176 188 $this->WriteUint($this->RecordCount); 177 189 $this->WriteUint($this->FieldCount); … … 188 200 public function GetLine($Row) 189 201 { 190 $Line = array(); 202 // Preallocate array 203 if($this->FieldCount > 0) $Line = array_fill(0, $this->FieldCount, 0); 204 else $Line = array(); 191 205 for($I = 0; $I < $this->FieldCount; $I++) 192 206 { 193 switch($this->Format[$I]) 207 if(array_key_exists($I, $this->ColumnFormat)) $Format = $this->ColumnFormat[$I]; 208 else $Format = FORMAT_UINT32; 209 switch($Format) 194 210 { 195 case 'b':211 case FORMAT_BYTE: 196 212 $Line[$I] = $this->GetByte($Row, $I); 197 213 break; 198 case 'u':199 $Line[$I] = $this->GetU int($Row, $I);200 break; 201 case 'i':214 case FORMAT_UINT32: 215 $Line[$I] = $this->GetUInt($Row, $I); 216 break; 217 case FORMAT_SINT32: 202 218 $Line[$I] = $this->GetInt($Row, $I); 203 219 break; 204 case 'f':220 case FORMAT_SINGLE: 205 221 $Line[$i] = $this->GetFloat($Row, $I); 206 222 break; 207 case 's':223 case FORMAT_STRING: 208 224 $Line[$I] = $this->GetString($Row, $I); 209 225 break; 210 case 'x':211 case 'X':212 226 default: 213 227 break; … … 221 235 for($I = 0; $I < $this->FieldCount; $I++) 222 236 { 223 switch($this->Format[$I]) 237 if(array_key_exists($I, $this->ColumnFormat)) $Format = $this->ColumnFormat[$I]; 238 else $Format = FORMAT_UINT32; 239 switch($Format) 224 240 { 225 case 'b':241 case FORMAT_BYTE: 226 242 $this->SetByte($Row, $I, $Line[$I]); 227 243 break; 228 case 'u':244 case FORMAT_UINT32: 229 245 $this->SetUint($Row, $I, $Line[$I]); 230 246 break; 231 case 'i':247 case FORMAT_SINT32: 232 248 $this->SetInt($Row, $I, $Line[$I]); 233 249 break; 234 case 'f':250 case FORMAT_SINGLE: 235 251 $this->SetFloat($Row, $I, $Line[$i]); 236 252 break; 237 case 's':253 case FORMAT_STRING: 238 254 $this->SetString($Row, $I, $Line[$I]); 239 255 break; 240 case 'x':241 case 'X':242 256 default: 243 257 break; … … 249 263 public function GetLineCols($Row, $Columns) 250 264 { 251 $Line = array(); 265 // Preallocate array 266 if(count($Columns) > 0) $Line = array_fill(0, count($Columns), 0); 267 else $Line = array(); 252 268 for($I = 0; $I < count($Columns); $I++) 253 269 { 254 switch($this->Format[$Columns[$I]]) 270 if(array_key_exists($I, $this->ColumnFormat)) $Format = $this->ColumnFormat[$I]; 271 else $Format = FORMAT_UINT32; 272 switch($Format) 255 273 { 256 case 'b':274 case FORMAT_BYTE: 257 275 $Line[$I] = $this->GetByte($Row, $Columns[$I]); 258 276 break; 259 case 'u':277 case FORMAT_UINT32: 260 278 $Line[$I] = $this->GetUint($Row, $Columns[$I]); 261 279 break; 262 case 'i':280 case FORMAT_SINT32: 263 281 $Line[$I] = $this->GetInt($Row, $Columns[$I]); 264 282 break; 265 case 'f':283 case FORMAT_SINGLE: 266 284 $Line[$i] = $this->GetFloat($Row, $Columns[$I]); 267 285 break; 268 case 's':286 case FORMAT_STRING: 269 287 $Line[$I] = $this->GetString($Row, $Columns[$I]); 270 288 break; 271 case 'x':272 case 'X':273 289 default: 274 290 break; … … 285 301 public function SetRecordCount($Value) 286 302 { 287 $this->RecordCount = $Value;303 $this->RecordCount = $Value; 288 304 } 289 305 … … 292 308 return($this->FieldCount); 293 309 } 310 311 public function SetFieldCount($Value) 312 { 313 $this->FieldCount = $Value; 314 $this->GenerateOffsetTable(); 315 $this->RecordSize = $this->EndOffset; 316 } 294 317 } 295 318 -
trunk/includes/error.php
r357 r443 2 2 3 3 include_once('global_function.php'); 4 5 function EmptyErrorHandler($Number, $Message, $Filename, $LineNumber, $Variables) 6 { 7 } 4 8 5 9 function CustomErrorHandler($Number, $Message, $Filename, $LineNumber, $Variables) … … 7 11 global $Config; 8 12 13 set_error_handler('EmptyErrorHandler'); 14 9 15 $Date = date('Y-m-d H:i:s'); // časové razítko položky 10 16 $ErrorType = array … … 75 81 if((E_ERROR | E_PARSE) & $Number) die(); 76 82 } 83 set_error_handler('CustomErrorHandler'); 77 84 } 78 85 -
trunk/includes/global_function.php
r436 r443 238 238 $Result[$DbRow['Id']] = $DbRow; 239 239 } 240 $DbResult = $Database->SQLCommand('SELECT * FROM `GroupItem` ORDER BY ` DBCColumnIndex`');240 $DbResult = $Database->SQLCommand('SELECT * FROM `GroupItem` ORDER BY `Group`, `Sequence`'); 241 241 while($DbRow = mysql_fetch_assoc($DbResult)) 242 242 { … … 316 316 } 317 317 return($VersionsWOW[$BuildNumber]); 318 }319 320 function GetDBCColumns($Version, $DBCFileName)321 {322 global $Database, $DBCColumns;323 324 if(isset($DBCColumns[$Version][$DBCFileName]) == false)325 {326 $sql = 'SELECT `DBCColumns_'.$DBCFileName.'` AS `DBCColumns` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"';327 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql));328 $DBCColumns[$Version][$DBCFileName] = $DbRow['DBCColumns'];329 }330 return($DBCColumns[$Version][$DBCFileName]);331 }332 333 function GetDBCColumnIndex($Version, $DBCFileName, $Column)334 {335 global $Database, $DBCColumnIndex;336 337 if(isset($DBCColumnIndex[$Version][$DBCFileName][$Column]) == false)338 {339 $sql = 'SELECT `'.$DBCFileName.'_'.$Column.'` AS `DBCColumns` FROM `ClientVersion` WHERE `Version` = "'.$Version.'"';340 $DbRow = mysql_fetch_assoc($Database->SQLCommand($sql));341 $DBCColumnIndex[$Version][$DBCFileName][$Column] = $DbRow['DBCColumns'];342 }343 return($DBCColumnIndex[$Version][$DBCFileName][$Column]);344 318 } 345 319 -
trunk/includes/stream.php
r384 r443 125 125 } 126 126 127 public function SetSize($Size) 128 { 129 return(ftruncate($this->Handle, $Size)); 130 } 131 127 132 public function EOF() 128 133 { -
trunk/sql/text_table_init_structure.sql
r376 r443 1 1 CREATE TABLE IF NOT EXISTS `Text` ( 2 `ID` int(11) unsigned NOT NULL auto_increment,2 `ID` int(11) unsigned NOT NULL AUTO_INCREMENT, 3 3 `Entry` int(11) NOT NULL, 4 `Language` int(11) NOT NULL default'0',4 `Language` int(11) NOT NULL DEFAULT '0', 5 5 `User` int(11) NOT NULL, 6 6 `Complete` int(11) NOT NULL, 7 `CompleteParts` int(11) NOT NULL, 7 8 `Take` int(11) NOT NULL, 8 9 `VersionStart` int(11) NOT NULL DEFAULT '8606', 9 10 `VersionEnd` int(11) NOT NULL DEFAULT '8606', 10 PRIMARY KEY (`ID`), 11 `ModifyTime` datetime NOT NULL, 12 PRIMARY KEY (`ID`), 11 13 KEY `Entry` (`Entry`), 12 14 KEY `User` (`User`), 13 15 KEY `Take` (`Take`), 14 KEY `Language` ( `Language`),15 KEY `Complete` ( `Complete` )16 KEY `Language` (`Language`), 17 KEY `Complete` (`Complete`), 16 18 KEY `VersionStart` (`VersionStart`), 17 KEY `VersionEnd` (`VersionEnd`) 19 KEY `VersionEnd` (`VersionEnd`), 20 KEY `ModifyTime` (`ModifyTime`) 18 21 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Note:
See TracChangeset
for help on using the changeset viewer.