Ignore:
Timestamp:
Apr 27, 2009, 8:00:50 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Názvy tabulek a sloupců aktualit pozměněny na názvy se slovy začínající velkými písmeny.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/news.php

    r189 r196  
    1919    $ItemCount = abs($ItemCount);
    2020    $DaysAgo = abs($DaysAgo);
    21     $DbResult = $Database->select('news_category', '*', 'id='.$Category);
     21    $DbResult = $Database->select('NewsCategory', '*', 'Id='.$Category);
    2222    $Row = $DbResult->fetch_array();
    2323    $Output = '<table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-size: small; padding-bottom: 5px;"><tr>';
    24     $Output .= '<td>'.$Row['caption'].'</td><td align="right">';
     24    $Output .= '<td>'.$Row['Caption'].'</td><td align="right">';
    2525    $Output .= '<a href="aktuality/index.php?category='.$Category.'">Zobrazit všechny aktuality</a>&nbsp;';
    2626    if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $Category))
    2727      $Output .= '<a href="aktuality/index.php?action=add&amp;category='.$Category.'">Přidat aktualitu</a>&nbsp;';
    2828    $Output .= '</td></tr><tr><td colspan="2">';
    29     $DbResult = $Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);
     29    $DbResult = $Database->query('SELECT `News`.*, `User`.`Name` FROM `News` LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE (`News`.`Category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `News`.`Date`) ORDER BY `News`.`Date` DESC LIMIT 0,'.$ItemCount);
    3030    //echo($Database->error.'<br />');
    3131    //echo($Database->LastQuery.'<br />');
     
    3838      while($Row = $DbResult->fetch_array())
    3939      {
    40         if($Row['Name'] == '') $Author = $Row['author'];
     40        if($Row['Name'] == '') $Author = $Row['Author'];
    4141          else $Author = $Row['Name'];
    42         $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&amp;id='.$Row['id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['date']).')</td></tr></table>';
    43         $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content'];
     42        $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&amp;id='.$Row['Id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['Title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['Date']).')</td></tr></table>';
     43        $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['Content'];
    4444
    45         if($Row['enclosure'] != '')
     45        if($Row['Enclosure'] != '')
    4646        {
    4747          $Output .= '<br />Přílohy: ';
    48           $Enclosures = explode(';', $Row['enclosure']);
     48          $Enclosures = explode(';', $Row['Enclosure']);
    4949                foreach($Enclosures as $Enclosure)
    5050                {
     
    6767    $this->NewsSetting = array();
    6868    $I = 1;
    69     $DbResult = $this->Database->select('news_category', '*');
     69    $DbResult = $this->Database->select('NewsCategory', '*');
    7070    while($NewsCategory = $DbResult->fetch_array())
    7171    {
    72       $this->NewsSetting[] = array('CategoryId' => $NewsCategory['id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo']);
     72      $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo']);
    7373      $I++;
    7474    }
     
    118118    foreach($this->NewsSetting as $SettingItem)
    119119    {
    120       $DbResult = $this->Database->select('news_category', '*', 'id='.$SettingItem['CategoryId']);
     120      $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$SettingItem['CategoryId']);
    121121      $NewsCategory = $DbResult->fetch_array();
    122       $Output .= '<tr><td>'.$NewsCategory['caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"';
     122      $Output .= '<tr><td>'.$NewsCategory['Caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"';
    123123      if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"';
    124124      $Output .= ' /></td>'.
     
    156156    setcookie('NewsSetting', $_COOKIE['NewsSetting'], time() + 60 * 60 * 24 * 365);
    157157  }
    158 
    159158}
    160159
    161 
    162160?>
Note: See TracChangeset for help on using the changeset viewer.