Changeset 880 for trunk/Modules/Export/ProcessAoWoWExport.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/ProcessAoWoWExport.php
r848 r880 14 14 $Output = ''; 15 15 16 if (defined('STDIN') == false)16 if (defined('STDIN') == false) 17 17 { 18 18 $Output = T('Access denied'); … … 20 20 } 21 21 22 foreach ($_SERVER['argv'] as $parameter)22 foreach ($_SERVER['argv'] as $parameter) 23 23 { 24 if (strpos($parameter, '=') !== false)24 if (strpos($parameter, '=') !== false) 25 25 { 26 26 $index = substr($parameter, 0, strpos($parameter, '=')); … … 33 33 echo 'Generuji Export:'; 34 34 $Export = new Export($System); 35 if (!array_key_exists('AoWoWExportId', $Config)) {35 if (!array_key_exists('AoWoWExportId', $Config)) { 36 36 $Export->Id = $Config['AoWoWExportId']; 37 37 } else $Export->Id = 37; … … 45 45 $UserSelection = array(); 46 46 $DbResult = $System->Database->query('SELECT `ID`, `XP` FROM `User`'); 47 while ($DbRow = $DbResult->fetch_assoc())47 while ($DbRow = $DbResult->fetch_assoc()) 48 48 { 49 49 $UserSelection[$DbRow['ID']] = $DbRow['XP']; … … 53 53 // Update export user selection sequence 54 54 $Sequence = 1; 55 foreach ($UserSelection as $ID => $XP)55 foreach ($UserSelection as $ID => $XP) 56 56 { 57 57 $DbResult = $System->Database->query('SELECT `Id` FROM `ExportUser` WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID); 58 if ($DbResult->num_rows > 0)58 if ($DbResult->num_rows > 0) 59 59 $Query = 'UPDATE `ExportUser` SET `Sequence` = '.$Sequence.' WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID; 60 60 else $Query = 'INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$Config['AoWoWExportId'].', '.$ID.', '.$Sequence.')'; … … 70 70 $Database2->query('SET NAMES '.$Config['Database']['Charset']); 71 71 $Database2->select_db($Config['Database']['DatabaseAoWoW']); 72 foreach ($SQL as $Line)72 foreach ($SQL as $Line) 73 73 { 74 74 //echo '.'; 75 75 //echo($Line."\n"); 76 if (trim($Line) != '') $Database2->query($Line);76 if (trim($Line) != '') $Database2->query($Line); 77 77 } 78 78 echo 'Hotovo … … 83 83 // Delete temporary cache files 84 84 $Files = scandir(dirname(__FILE__).'/../../aowow/cache/mangos'); 85 foreach ($Files as $File)85 foreach ($Files as $File) 86 86 { 87 87 $End = substr($File, strlen($File) - 3); 88 if ($End == 'aww') unlink(dirname(__FILE__).'/../../aowow/cache/mangos/'.$File);88 if ($End == 'aww') unlink(dirname(__FILE__).'/../../aowow/cache/mangos/'.$File); 89 89 } 90 90 $Files = scandir(dirname(__FILE__).'/../../aowow/cache/templates/wowhead'); 91 foreach ($Files as $File)91 foreach ($Files as $File) 92 92 { 93 93 $End = substr($File, strlen($File) - 3); 94 if ($End == 'php') unlink(dirname(__FILE__).'/../../aowow/cache/templates/wowhead/'.$File);94 if ($End == 'php') unlink(dirname(__FILE__).'/../../aowow/cache/templates/wowhead/'.$File); 95 95 } 96 96 echo 'Hotovo
Note:
See TracChangeset
for help on using the changeset viewer.