Ignore:
Timestamp:
Jan 27, 2014, 10:01:33 PM (10 years ago)
Author:
chronos
Message:
  • Added: Config parameter Description which is used for general web description included in meta section of HTML page and usable by modules.
  • Fixed: Error in RSS channels if no items loaded.
  • Modified: Log real last URI instead on script name in online users list in database.
  • Fixed: Serialization error in Database class if exception was raised.
  • Modified: Items in RSS channel of forum links to exact forum topics.
File:
1 edited

Legend:

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

    r637 r765  
    2222        $this->System->RegisterPage('news', 'PageNews');
    2323        $this->System->RegisterPage('rss', 'PageRSS');
    24         $this->RegisterRSS(array('Title' => T('System changes'), 'Channel' => 'news',
     24        $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news',
    2525          'Callback' => array('PageNews', 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS));
    2626  }
     
    127127        function ShowRSS()
    128128        {
    129          $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, '.
    130            '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text` '.
    131            'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    132          while($DbRow = $DbResult->fetch_assoc())
    133          {
    134           $Items[] = array
     129                $Items = array();
     130    $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, '.
     131            '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text` '.
     132            'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
     133          while($DbRow = $DbResult->fetch_assoc())
     134          {
     135           $Items[] = array
     136           (
     137             'Title' => $DbRow['Title'],
     138             'Link' =>  'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/news/'),
     139             'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')',
     140             'Time' => $DbRow['UnixTime'],
     141           );
     142          }
     143          $Output = GenerateRSS(array
    135144          (
    136             'Title' => $DbRow['Title'],
    137             'Link' =>  'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),
    138             'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')',
    139             'Time' => $DbRow['UnixTime'],
    140           );
    141          }
    142          $Output = GenerateRSS(array
    143            (
    144              'Title' => 'WoW překlad - '.T('System changes'),
    145              'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),
    146              'Description' => 'Překlad textů WoW',
    147              'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],
    148              'Items' => $Items,
    149            ));
    150            return($Output);     
     145            'Title' => $this->System->Config['Web']['Title'].' - '.T('System changes'),
     146            'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/news/'),
     147            'Description' => $this->System->Config['Web']['Description'],
     148            'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],
     149            'Items' => $Items,
     150          ));
     151          return($Output);       
    151152        }
    152153}
Note: See TracChangeset for help on using the changeset viewer.