Changeset 581 for trunk/Modules/ShoutBox
- Timestamp:
- Sep 12, 2013, 9:14:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ShoutBox/ShoutBox.php
r561 r581 11 11 $this->License = 'GNU/GPL'; 12 12 $this->Description = 'Simple user chat system.'; 13 $this->Dependencies = array( );13 $this->Dependencies = array('News'); 14 14 } 15 15 … … 17 17 { 18 18 $this->System->RegisterPage('shoutbox', 'PageShoutBox'); 19 $this->System->RegisterRSS(array('Title' => 'Kecátko', 'Channel' => 'shoutbox')); 20 19 $this->System->ModuleManager->Modules['News']->RegisterRSS(array( 20 'Title' => 'Kecátko', 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'), 21 'Permission' => LICENCE_ANONYMOUS)); 21 22 } 22 23 … … 120 121 return($Output); 121 122 } 123 124 function ShowRSS() 125 { 126 $TitleLength = 50; 127 mb_internal_encoding('utf-8'); 128 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `UserName`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20'); 129 while($DbRow = $DbResult->fetch_assoc()) 130 { 131 $Title = mb_substr($DbRow['Text'], 0, $TitleLength); 132 if(mb_strlen($Title) == $TitleLength) $Title .= '...'; 133 $Items[] = array 134 ( 135 'Title' => $DbRow['UserName'].': '.$Title, 136 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 137 'Description' => $DbRow['Text'], 138 'Time' => $DbRow['UnixDate'], 139 ); 140 } 141 $Output = GenerateRSS(array 142 ( 143 'Title' => 'WoW překlad - Shoutbox', 144 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/'), 145 'Description' => 'Překlad textů WoW', 146 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'], 147 'Items' => $Items, 148 )); 149 return($Output); 150 } 122 151 }
Note:
See TracChangeset
for help on using the changeset viewer.