Changeset 765 for trunk/Modules/News/News.php
- Timestamp:
- Jan 27, 2014, 10:01:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/News/News.php
r637 r765 22 22 $this->System->RegisterPage('news', 'PageNews'); 23 23 $this->System->RegisterPage('rss', 'PageRSS'); 24 $this->RegisterRSS(array('Title' => T(' System changes'), 'Channel' => 'news',24 $this->RegisterRSS(array('Title' => T('News'), 'Channel' => 'news', 25 25 'Callback' => array('PageNews', 'ShowRSS'), 'Permission' => LICENCE_ANONYMOUS)); 26 26 } … … 127 127 function ShowRSS() 128 128 { 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 135 144 ( 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); 151 152 } 152 153 }
Note:
See TracChangeset
for help on using the changeset viewer.