Changeset 881 for trunk/Modules
- Timestamp:
- Apr 7, 2020, 11:58:08 PM (5 years ago)
- Location:
- trunk/Modules
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/Export.php
r880 r881 24 24 } 25 25 26 function SaveAllUsers() { 26 function SaveAllUsers() 27 { 27 28 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$this->Id); 28 29 $Export = $DbResult->fetch_assoc(); 29 if ($Export['AllUsers']) { 30 if ($Export['AllUsers']) 31 { 30 32 $DbResult2 = $this->System->Database->query('SELECT ID FROM `User` WHERE `ID` NOT IN(SELECT `User` FROM `ExportUser` WHERE `Export`='.$this->Id.')'); 31 33 while ($UserLine = $DbResult2->fetch_assoc()) 32 34 { 33 34 35 36 37 38 39 40 41 35 $Condition = ' WHERE `Export`='.$this->Id.' AND `User`='.$UserLine['ID']; 36 $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition); //,MAX(`Sequence`) as MaxSequence 37 if ($DbResult->num_rows > 0) 38 { 39 // $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition); 40 } else 41 { 42 $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$this->Id.', '.$UserLine['ID'].', 0)'); 43 } 42 44 } 43 45 … … 88 90 // Build selected columns 89 91 $Columns = ''; 90 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 92 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 93 { 91 94 if (!isset($GroupItems[$Column['Id']])) $Columns .= ' `T`.`'.$Column['Column'].'` AS `'.$Column['Column'].'`, '; 92 95 } 93 96 // $Columns = substr($Columns, 0, -2); 94 95 97 96 98 $Query = 'SELECT * FROM (SELECT ANY_VALUE(`TT`.`ID`) AS `TTID` FROM (SELECT '.$Columns.' T.`ID`,T.`Language`,T.`User`,T.`Entry`,T.`VersionEnd`,T.`VersionStart`, `User`.`Name` AS `UserName` FROM `'.$Group['TablePrefix'].'` AS `T`'. … … 104 106 // Build columns for english texts 105 107 $OriginalColumns = ''; 106 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 108 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 109 { 107 110 $OriginalColumns .= ' `T3`.`'.$Column['Column'].'` AS `En'.$Column['Column'].'`, '; 108 111 if (isset($GroupItems[$Column['Id']])) … … 130 133 $date = date('Y-m-d H:i',(filemtime($file))); 131 134 else return true; 132 // echo $file;133 135 134 136 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. … … 144 146 ' '; 145 147 146 $DbResult2 = $this->Database->query($Query); 147 if ($DbResult2->num_rows > 0) { 148 $result = true; 149 } 148 $DbResult2 = $this->Database->query($Query); 149 if ($DbResult2->num_rows > 0) 150 { 151 $result = true; 152 } 150 153 } 151 154 return $result; … … 283 286 function HaveVarible($String1, $String2, $StartChar = '$') 284 287 { 285 if (strpos($String1,$StartChar) !== false) { 286 287 while ( strpos($String1,$StartChar) !== false) { 288 $pos = strpos($String1,$StartChar); 289 $String1 = substr($String1,$pos+1); 290 $varible = $String1; 291 if (strpos($varible,' ')) $varible = substr($varible,0,strpos($varible,' ')); 292 if (strpos($varible,'.')) $varible = substr($varible,0,strpos($varible,'.')); 293 if (strpos($varible,',')) $varible = substr($varible,0,strpos($varible,',')); 294 if (strpos($varible,'%')) $varible = substr($varible,0,strpos($varible,'%')); 295 if (strpos($varible,chr(10))) $varible = substr($varible,0,strpos($varible,chr(10))); 296 // echo $pos.'-'.$varible.'-'.$String1.'-' .$String2.' 297 // '; 298 299 if (false === strpos($String2,$varible)) { 300 // echo $varible; 301 return false; 302 } 288 if (strpos($String1, $StartChar) !== false) 289 { 290 while (strpos($String1, $StartChar) !== false) 291 { 292 $pos = strpos($String1, $StartChar); 293 $String1 = substr($String1, $pos + 1); 294 $varible = $String1; 295 if (strpos($varible, ' ')) $varible = substr($varible, 0, strpos($varible, ' ')); 296 if (strpos($varible, '.')) $varible = substr($varible, 0, strpos($varible, '.')); 297 if (strpos($varible, ',')) $varible = substr($varible, 0, strpos($varible, ',')); 298 if (strpos($varible, '%')) $varible = substr($varible, 0, strpos($varible, '%')); 299 if (strpos($varible, chr(10))) $varible = substr($varible, 0, strpos($varible, chr(10))); 300 301 if (false === strpos($String2, $varible)) 302 { 303 return false; 304 } 303 305 } 304 306 } … … 306 308 } 307 309 308 function AddProgress($add = 1) {309 310 function AddProgress($add = 1) 311 { 310 312 $DbResult = $this->System->Database->query('SELECT Progress FROM `ExportTask` WHERE `Export`='.$this->Id); 311 313 $Task = $DbResult->fetch_assoc(); … … 344 346 $LookupTable = array(); 345 347 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 346 while ($DbRow = $DbResult2->fetch_assoc()) { 348 while ($DbRow = $DbResult2->fetch_assoc()) 349 { 347 350 //Export only if translate have same varible % 348 351 $CanExport = true; 349 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 352 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 353 { 350 354 $DbRow[$Column['Column']] = str_replace ( '$ ','$',$DbRow[$Column['Column']]); 351 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) { 355 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) 356 { 352 357 $CanExport = false; 353 358 $Output .= ', NE='.$DbRow['ID']; 354 359 } 355 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) { 360 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) 361 { 356 362 $CanExport = false; 357 363 $Output .= ', NE='.$DbRow['ID']; … … 361 367 if ($CanExport) 362 368 $LookupTable[$DbRow[$Group['PrimaryKeyItem']]] = $DbRow; 363 364 369 } 365 370 … … 369 374 370 375 // Create new DBC file 371 if (!file_exists($this->TempDir.'dbc/')) mkdir 376 if (!file_exists($this->TempDir.'dbc/')) mkdir($this->TempDir.'dbc/', 0777, true); 372 377 $NewDBCFile = new DBCFile(); 373 378 $NewDBCFile->CreateFile($this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat); … … 448 453 $LookupTable = array(); 449 454 $DbResult2 = $this->Database->query($this->BuildQuery($Group)); 450 while ($DbRow = $DbResult2->fetch_assoc()) { 455 while ($DbRow = $DbResult2->fetch_assoc()) 456 { 451 457 $CanExport = true; 452 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 458 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 459 { 453 460 // if (strpos($DbRow[$Column['Column']],'\\')) 454 461 // $CanExport = false; … … 456 463 // $DbRow[$Column['Column']] = $DbRow['En'.$Column['Column']]; 457 464 458 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) { 459 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 460 $CanExport = false; 461 } 462 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) { 463 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 464 $CanExport = false; 465 } 466 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'%')) { 467 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 468 $CanExport = false; 469 } 470 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'%')) { 471 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 472 $CanExport = false; 473 } 474 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'\\')) { 475 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 476 $CanExport = false; 477 } 478 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'\\')) { 479 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 480 $CanExport = false; 481 } 482 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'|')) { 483 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 484 $CanExport = false; 485 } 486 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'|')) { 487 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 488 $CanExport = false; 489 } 490 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],chr(10))) { 491 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 492 $CanExport = false; 493 } 494 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],chr(10))) { 465 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) 466 { 467 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 468 $CanExport = false; 469 } 470 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']])) 471 { 472 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 473 $CanExport = false; 474 } 475 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'%')) 476 { 477 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 478 $CanExport = false; 479 } 480 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'%')) 481 { 482 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 483 $CanExport = false; 484 } 485 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'\\')) 486 { 487 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 488 $CanExport = false; 489 } 490 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'\\')) 491 { 492 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 493 $CanExport = false; 494 } 495 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],'|')) 496 { 497 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 498 $CanExport = false; 499 } 500 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],'|')) 501 { 502 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 503 $CanExport = false; 504 } 505 if (!$this->HaveVarible($DbRow[$Column['Column']],$DbRow['En'.$Column['Column']],chr(10))) 506 { 507 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 508 $CanExport = false; 509 } 510 if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']],chr(10))) 511 { 495 512 if ($CanExport) $Output .= ', NE='.$DbRow['ID']; 496 513 $CanExport = false; … … 499 516 500 517 if ($CanExport) 501 518 $LookupTable[$DbRow['ShortCut']] = $DbRow; 502 519 } 503 520 … … 516 533 $Line = substr($Line, 1); // Skip start qoute 517 534 $TempLine = str_replace('\"', ' ', $Line); // Temporary remove slashed quotes 518 if (strpos($TempLine, '"')) { 535 if (strpos($TempLine, '"')) 536 { 519 537 $Value['Text'] = substr($Line, 0, strpos($TempLine, '"')); 520 538 } else { … … 558 576 } 559 577 560 function GetReadme() { 578 function GetReadme() 579 { 561 580 $_GET['ExportId'] = $this->Id; 562 581 $PageExport = new PageExport($this->System); … … 631 650 Ne úplně, protože se vystavujete riziku zablokování vašeho účtu z důvodu použití upravené hry. Na oficiálním serveru lze využít pouze Addon s češtinou CzWoW. Instalační soubor určený pro oficiální servery je už takto přizpůsoben.</p>'. 632 651 633 '</td><td>'; 634 635 $Output .= $PageExport->ExportViewStat(' WHERE `DBCFileName` !=\'\' OR `LuaFileName` !=\'\' OR `Group`.`Id` = 1 OR `Group`.`Id` = 2 OR `Group`.`Id` = 3 OR `Group`.`Id` = 16'); 636 637 $Output .= '</td></tr></table>'. 638 639 640 '</body></html>'; 641 return $Output; 642 } 652 '</td><td>'; 653 654 $Output .= $PageExport->ExportViewStat(' WHERE `DBCFileName` !=\'\' OR `LuaFileName` !=\'\' OR `Group`.`Id` = 1 OR `Group`.`Id` = 2 OR `Group`.`Id` = 3 OR `Group`.`Id` = 16'); 655 656 $Output .= '</td></tr></table>'. 657 '</body></html>'; 658 return $Output; 659 } 643 660 644 661 function ExportToXML() -
trunk/Modules/Log/Log.php
r880 r881 125 125 $this->Title = T('System log'); 126 126 $Output = ''; 127 if (array_key_exists('type', $_GET) ) $_SESSION['type'] = $_GET['type'] * 1;127 if (array_key_exists('type', $_GET) and (is_numeric($_GET['type']))) $_SESSION['type'] = $_GET['type'] * 1; 128 128 else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = ''; 129 129
Note:
See TracChangeset
for help on using the changeset viewer.