Changeset 305


Ignore:
Timestamp:
Jan 30, 2011, 12:13:45 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Aktuality zobrazovány nyní jako dva sloupce v jednom panelu.
Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/news.php

    r302 r305  
    9797    while($NewsCategory = $DbResult->fetch_array())
    9898    {
    99       $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo']);
     99      $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo'], 'Group' => $NewsCategory['Group']);
    100100      $I++;
    101101    }
     
    130130    $Output .= '<div onmouseout="skryj(predchozi)">';
    131131
    132     foreach($this->NewsSetting as $SettingItem)
    133       if($SettingItem['Enabled'] == 1) $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']);
     132    $ColumnCount = 2;
     133    $Output .= '<table style="width: 100%"><tr>';
     134    for($Column = 1; $Column <= $ColumnCount; $Column++)
     135    {
     136      $Output .= '<td style="vertical-align: top; width: '.round(100 / $ColumnCount).'%;">';
     137      foreach($this->NewsSetting as $SettingItem)
     138        if(($SettingItem['Enabled'] == 1) and ($SettingItem['Group'] == $Column))
     139          $Output .= $this->ShowNews($SettingItem['CategoryId'], $SettingItem['ItemCount'], $SettingItem['DaysAgo']);
     140      $Output .= '</td>';
     141    }
     142    $Output .= '</tr></table>';
    134143
    135144    $Output .= '<a href="aktuality/subscription.php"><img class="RSSIcon" src="images/rss20.png" alt="Aktuality přes RSS" /></a>  <a href="aktuality/subscription.php">Automatické sledování novinek</a>';
     
    142151    $Output = '<form action="?Action=CustomizeNewsSave" method="post">';
    143152    $Output .= '<table width="100%" cellspacing="0" border="1"><tr><td><table cellspacing="0" width="100%">';
    144     $Output .= '<tr><th>Kategorie</th><th>Pozice</th><th>Zobrazit</th><th>Max. počet</th><th>Posledních dnů</th></tr>';
     153    $Output .= '<tr><th>Kategorie</th><th>Pozice</th><th>Zobrazit</th><th>Max. počet</th><th>Posledních dnů</th><th>Sloupec</th></tr>';
    145154    $I = 0;
    146155    foreach($this->NewsSetting as $SettingItem)
     
    153162      '<td align="center"><input type="text" size="2" name="NewsCategoryCount'.$I.'" value="'.$SettingItem['ItemCount'].'" />'.
    154163      '<input type="hidden" name="NewsCategoryId'.$I.'" value="'.$SettingItem['CategoryId'].'" /></td>'.
    155     '<td align="center"><input type="text" size="3" name="NewsCategoryDaysAgo'.$I.'" value="'.$SettingItem['DaysAgo'].'" /></td></tr>';
     164      '<td align="center"><input type="text" size="3" name="NewsCategoryDaysAgo'.$I.'" value="'.$SettingItem['DaysAgo'].'" /></td>'.
     165      '<td><input type="text" size="3" name="NewsColumn'.$I.'" value="'.$SettingItem['Group'].'"/></td></tr>';
    156166      $I++;
    157167    }
     
    169179      if(($_POST['NewsCategoryDaysAgo'.$I] * 1) < 0) $_POST['NewsCategoryIndex'.$I] = 0;
    170180      if(($_POST['NewsCategoryCount'.$I] * 1) < 0) $_POST['NewsCategoryCount'.$I] = 0;
     181      if(($_POST['NewsColumn'.$I] * 1) < 1) $_POST['NewsColumn'.$I] = 1;
    171182      if(!array_key_exists('NewsCategoryEnabled'.$I, $_POST)) $_POST['NewsCategoryEnabled'.$I] = '';
    172       $Setting[] = array('CategoryId' => $_POST['NewsCategoryId'.$I], 'Enabled' => $Checkbox[$_POST['NewsCategoryEnabled'.$I]], 'ItemCount' => ($_POST['NewsCategoryCount'.$I]*1), 'DaysAgo' => ($_POST['NewsCategoryDaysAgo'.$I]*1), 'Index' => ($_POST['NewsCategoryIndex'.$I]*1));
     183      $Setting[] = array('CategoryId' => $_POST['NewsCategoryId'.$I], 'Enabled' => $Checkbox[$_POST['NewsCategoryEnabled'.$I]], 'ItemCount' => ($_POST['NewsCategoryCount'.$I]*1), 'DaysAgo' => ($_POST['NewsCategoryDaysAgo'.$I]*1), 'Index' => ($_POST['NewsCategoryIndex'.$I]*1),
     184      'Group' => $_POST['NewsColumn'.$I]);
    173185    }
    174186    // Sort indexes
  • trunk/index.php

    r304 r305  
    66{
    77  var $Dependencies = array('News');
    8   var $FullTitle = '<strong>ZděchovNET</strong> - komunitní počítačová síť';
    9   var $ShortTitle = 'Rozcestník';
     8  var $FullTitle = 'Zděchovský rozcestník';
     9  var $ShortTitle = '';
    1010 
    1111  function ShowLinks($GroupId)
     
    124124    return($Output);
    125125  }
    126 
    127   function GetServerUptime()
    128   {
    129     $Data = explode(' ', exec('uptime'));
    130     $Data = array_slice($Data, 3, -8);
    131     $Uptime = '';
    132     foreach($Data as $Item)
    133     {
    134       if(strpos($Item, ':')) $Uptime .= substr($Item, 0, -1).' hodin';
    135       else $Uptime .= $Item.' ';
    136     }
    137     $Uptime = str_replace('2 days,', '2 dny a', $Uptime);
    138     $Uptime = str_replace('3 days,', '3 dny a', $Uptime);
    139     $Uptime = str_replace('4 days,', '4 dny a', $Uptime);
    140     $Uptime = str_replace('days,', 'dní a', $Uptime);
    141     $Uptime = str_replace('day,', 'den a', $Uptime);
    142     $Uptime = str_replace('min,', 'minut', $Uptime);
    143     return($Uptime);
    144   }
    145  
     126   
    146127  function Panel($Title, $Content, $Menu = array())
    147128  {
  • trunk/network.php

    r265 r305  
    7373        $Output .= '<a href="network/dostupnost.php">Měření dostupnosti zařízení</a><br />';
    7474        $Output .= '<a href="network/subnet.php">Výpis registrovaných podsítí</a><br />';
    75         $Output .= '<a href="tkr.php">Kanály kabelové televize</a>';
     75        //$Output .= '<a href="tkr.php">Kanály kabelové televize</a>';
    7676    }
    7777    return($Output);
Note: See TracChangeset for help on using the changeset viewer.