Ignore:
Timestamp:
Jan 27, 2014, 10:01:33 PM (11 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/Forum/Forum.php

    r762 r765  
    130130                $Output .= '</div>'.$PageList['Output'];
    131131                return($Output);
    132 
    133         return($Output);
    134132  }
    135133
     
    177175                $Output .= $PageList['Output'];
    178176                $Output .= '<div class="shoutbox">';
    179                 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText`  WHERE `Thread` = '.$_GET['Thread'].' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']);
     177                $DbResult = $this->System->Database->query('SELECT * FROM `ForumText`  WHERE `Thread` = '.
     178                  $_GET['Thread'].' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    180179                while($Line = $DbResult->fetch_assoc()) {
    181180                        if ($this->System->User->Id == $Line['User'])
    182181        $edit = '<a href="?Edit='.$Line['ID'].'">editovat</a>';
    183182      else $edit = '';
    184       $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']).')</span><strong>'.$Line['UserName'].'</strong>: '.str_replace("\n", '<br />',$parser->qparse($Line['Text'])).'  </div> ';
     183      $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']).
     184        ')</span><strong>'.$Line['UserName'].'</strong>: '.str_replace("\n", '<br />',$parser->qparse($Line['Text'])).'  </div> ';
    185185    }
    186186                $Output .= '</div>'.$PageList['Output'];
     
    269269        function ShowRSS()
    270270        {
     271    $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));
     272
     273    $Items = array();
    271274          $TitleLength = 50;
    272275          mb_internal_encoding('utf-8');
    273           $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `UserName`, `Text`, ( SELECT `Text`  FROM `ForumThread` WHERE  `ID` = `ForumText`.`Thread`) as `Thread`  FROM `ForumText`  ORDER BY `ID` DESC LIMIT 20');
     276          $DbResult = $this->Database->query('SELECT `ID`, UNIX_TIMESTAMP(`Date`) AS `UnixDate`, '.
     277      '`User`, `UserName`, `Text`, ( SELECT `Text` FROM `ForumThread` '.
     278      'WHERE `ID` = `ForumText`.`Thread`) AS `Thread` FROM `ForumText` ORDER BY `ID` DESC LIMIT 20');
    274279          while($DbRow = $DbResult->fetch_assoc())
    275280          {
     
    278283            $Items[] = array
    279284            (
    280                 'Title' =>  $DbRow['Thread'].' - '.$DbRow['UserName'].': ',
    281                 'Link' =>  'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),
    282                 'Description' => $DbRow['Text'],
    283                 'Time' => $DbRow['UnixDate'],
     285              'Title' =>  $DbRow['Thread'].' - '.$DbRow['UserName'].': ',
     286              'Link' =>  'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/forum/?Thread='.$DbRow['ID']),
     287              'Description' => $parser->qparse($DbRow['Text']),
     288              'Time' => $DbRow['UnixDate'],
    284289            );
    285290          }
    286291          $Output = GenerateRSS(array
    287               (
    288                   'Title' => 'WoW překlad - Fórum',
    289                   'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),
    290                   'Description' => 'Překlad textů WoW',
    291                   'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],
    292                   'Items' => $Items,
    293               ));
    294            return($Output);
     292          (
     293            'Title' => $this->System->Config['Web']['Title'].' - '.T('Forum'),
     294            'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/forum/'),
     295            'Description' => $this->System->Config['Web']['Description'],
     296      'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],
     297      'Items' => $Items,
     298    ));
     299    return($Output);
    295300        }
    296301}
Note: See TracChangeset for help on using the changeset viewer.