Changeset 888 for trunk/Modules/Forum
- Timestamp:
- Dec 27, 2022, 7:50:23 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Forum/Forum.php
r880 r888 1 1 <?php 2 2 3 class ModuleForum extends AppModule3 class ModuleForum extends Module 4 4 { 5 5 function __construct(System $System) … … 14 14 } 15 15 16 function DoStart() 17 { 18 $this->System->RegisterPage( 'forum', 'PageForum');16 function DoStart(): void 17 { 18 $this->System->RegisterPage(['forum'], 'PageForum'); 19 19 $this->System->ModuleManager->Modules['News']->RegisterRSS(array( 20 20 'Title' => T('Forum'), 'Channel' => 'forum', 'Callback' => array('PageForum', 'ShowRSS'), … … 29 29 $this->System->Link('/forum/?search=')); 30 30 31 $this->System->RegisterMenuItem(array(31 Core::Cast($this->System)->RegisterMenuItem(array( 32 32 'Title' => T('Forum'), 33 33 'Hint' => T('Forum about translation wow'), … … 68 68 class PageForum extends Page 69 69 { 70 function Show() 70 function Show(): string 71 71 { 72 72 $Output = ''; … … 181 181 $Output = ''; 182 182 183 $ parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));183 $Parser = new HTML_BBCodeParser2(array('filters' => array('Basic', 'Extended', 'Images', 'Links', 'Lists', 'Email'))); 184 184 185 185 if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; … … 205 205 $Output .= '<div class="shoutbox">'; 206 206 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '. 207 ($_GET['Thread']*1).' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 208 while ($Line = $DbResult->fetch_assoc()) { 207 ($_GET['Thread'] * 1).' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 208 while ($Line = $DbResult->fetch_assoc()) 209 { 209 210 if ($this->System->User->Id == $Line['User']) 211 { 210 212 $edit = '<a href="?Edit='.$Line['ID'].'">'.T('edit').'</a>'; 211 else $edit = ''; 213 } else $edit = ''; 214 $Text = str_replace("\n", '<br />', $Parser->qparse(htmlspecialchars($Line['Text']))); 212 215 $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']). 213 ')</span><strong>'.$Line['UserName'].'</strong>: '.str_replace("\n", '<br />', 214 $parser->qparse(htmlspecialchars($Line['Text']))).' </div> '; 216 ')</span><strong>'.$Line['UserName'].'</strong>: '.$Text.' </div> '; 215 217 } 216 218 $Output .= '</div>'.$PageList['Output']; … … 243 245 if ($this->System->User->Licence(LICENCE_USER)) 244 246 { 245 $Output .= '<form action="?" method="post">'. 246 '<fieldset><legend>'.T('New thread').'</legend>'. 247 T('User').': '; 248 if ($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />'; 247 $Output .= '<form action="?" method="post">'. 248 '<fieldset><legend>'.T('New thread').'</legend>'.T('User').': '; 249 if ($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />'; 249 250 else $Output .= '<input type="text" name="user" /><br />'; 250 251 $Output .= T('Name of thread').': <br />'.
Note:
See TracChangeset
for help on using the changeset viewer.