Changeset 716 for trunk/Modules/Download


Ignore:
Timestamp:
Jan 5, 2014, 5:10:40 PM (11 years ago)
Author:
maron
Message:
  • Added: Featured export by Database
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Download/Download.php

    r706 r716  
    7878       
    7979        function ShowDownload() {
    80          
     80          global $System;
    8181    $Output = '<h3>Stažení češtiny</h3><br />';
    8282   
     
    9090                $Output .= '<table class="BaseTable">';
    9191                $Output .= '<tr><th>Stáhnout</th><th>Název</th><th>Datum vytvoření</th><th>Popis</th></tr>';
    92       foreach ($this->System->Config['Web']['RecommendedExport'] as $ExportId) {
    93                 $DbRows = $this->System->Database->query('SELECT *, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion` FROM `Export` WHERE `Id`='.$ExportId);
    94                     $DbExport = $DbRows->fetch_assoc();
     92                $DbRows = $this->System->Database->query('SELECT *, (SELECT Version FROM `ClientVersion` WHERE `ClientVersion`.`Id`=`Export`.`ClientVersion`) AS `ClientVersion` FROM `Export` WHERE `Featured`=1');
     93      while ($DbExport = $DbRows->fetch_assoc()) {
     94     
     95        $ExportId = $DbExport['Id'];
    9596                   
    96         $Export = new Export($this->System);
    97         $Export->Id = $ExportId;
    98         $Export->Init();
    99         $Export->LoadFilters();
    100 
     97                    $filename = $System->Config['Web']['TempFolder'].'Export/'.$ExportId.'/'.'Instalace_CzechWoW_'.$DbExport['ClientVersion'].'.exe';
     98                           
    10199                          if ($DbExport['OutputType'] == 10)
    102           $Output .= '<tr><td><a href="'.$this->System->Link('/'.$Export->TempDirRelative.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe').'">CzechWoW_'.$Export->ClientVersion['Version'].'.exe</a><br /> <a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
     100          $Output .= '<tr><td><a href="'.$System->Link('/'.$filename).'">CzechWoW_'.$DbExport['ClientVersion'].'.exe</a><br /> <a href="'.$System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
    103101        else
    104           $Output .= '<tr><td><a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId.'&amp;Tab=7').'">Exportovat</a><br /> <a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
     102          $Output .= '<tr><td><a href="'.$System->Link('/export/?Action=View&amp;ExportId='.$ExportId.'&amp;Tab=7').'">Exportovat</a><br /> <a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$ExportId).'">Export '.$ExportId.'</a></td>';
    105103                               
    106104        $Output .= '<td>'.$DbExport['Title'].'</td>'; //.'<td>'.$DbExport['ClientVersion'].'</td>';
    107105                               
    108                           if (($DbExport['OutputType'] == 10) and (file_exists($Export->TempDir.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe')))
    109           $Output .= '<td>'.date('d.m.y H:i',filemtime($Export->TempDir.'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe')).'</td>';
     106                          if (($DbExport['OutputType'] == 10) and (file_exists($filename)))
     107          $Output .= '<td>'.date('d.m.y H:i',filemtime($filename)).'</td>';
    110108        else
    111109          $Output .= '<td></td>';
Note: See TracChangeset for help on using the changeset viewer.