Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/ProcessAoWoWExport.php

    r848 r880  
    1414$Output = '';
    1515
    16 if(defined('STDIN') == false)
     16if (defined('STDIN') == false)
    1717{
    1818  $Output = T('Access denied');
     
    2020}
    2121
    22 foreach($_SERVER['argv'] as $parameter)
     22foreach ($_SERVER['argv'] as $parameter)
    2323{
    24   if(strpos($parameter, '=') !== false)
     24  if (strpos($parameter, '=') !== false)
    2525  {
    2626    $index = substr($parameter, 0, strpos($parameter, '='));
     
    3333echo 'Generuji Export:';
    3434  $Export = new Export($System);
    35 if(!array_key_exists('AoWoWExportId', $Config)) {
     35if (!array_key_exists('AoWoWExportId', $Config)) {
    3636  $Export->Id = $Config['AoWoWExportId'];
    3737} else $Export->Id = 37;
     
    4545$UserSelection = array();
    4646$DbResult = $System->Database->query('SELECT `ID`, `XP` FROM `User`');
    47 while($DbRow = $DbResult->fetch_assoc())
     47while ($DbRow = $DbResult->fetch_assoc())
    4848{
    4949  $UserSelection[$DbRow['ID']] = $DbRow['XP'];
     
    5353// Update export user selection sequence
    5454$Sequence = 1;
    55 foreach($UserSelection as $ID => $XP)
     55foreach ($UserSelection as $ID => $XP)
    5656{
    5757  $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)
    5959    $Query = 'UPDATE `ExportUser` SET `Sequence` = '.$Sequence.' WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID;
    6060    else $Query = 'INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$Config['AoWoWExportId'].', '.$ID.', '.$Sequence.')';
     
    7070$Database2->query('SET NAMES '.$Config['Database']['Charset']);
    7171$Database2->select_db($Config['Database']['DatabaseAoWoW']);
    72 foreach($SQL as $Line)
     72foreach ($SQL as $Line)
    7373{
    7474//echo '.';
    7575  //echo($Line."\n");
    76   if(trim($Line) != '') $Database2->query($Line);
     76  if (trim($Line) != '') $Database2->query($Line);
    7777}
    7878echo 'Hotovo
     
    8383// Delete temporary cache files
    8484$Files = scandir(dirname(__FILE__).'/../../aowow/cache/mangos');
    85 foreach($Files as $File)
     85foreach ($Files as $File)
    8686{
    8787  $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);
    8989}
    9090$Files = scandir(dirname(__FILE__).'/../../aowow/cache/templates/wowhead');
    91 foreach($Files as $File)
     91foreach ($Files as $File)
    9292{
    9393  $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);
    9595}
    9696echo 'Hotovo
Note: See TracChangeset for help on using the changeset viewer.