Changeset 891 for trunk/Modules/Forum
- Timestamp:
- Jan 13, 2023, 12:40:34 AM (23 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Forum/Forum.php
r888 r891 40 40 function ShowBox() 41 41 { 42 $Parser = new HTML_BBCodeParser2(array('filters' => array('Basic', 'Extended',43 'Images', 'Links', 'Lists', 'Email')));44 42 $Count = 20; 45 43 $Output = '<strong><a href="'.$this->System->Link('/forum/').'">'.T('Last forum posts').':</a></strong>'; … … 58 56 '<td><a href="'.$this->System->Link('/forum/?Thread='.$DbRow['Thread']).'">'.HumanDate($DbRow['Date']).'</a></td>'. 59 57 '<td><a href="'.$this->System->Link('/user/?user='.$DbRow['UserId']).'">'.$DbRow['UserName'].'</a></td>'. 60 '<td>'. $Parser->qparse(htmlspecialchars($DbRow['Text'])).'</td>'.58 '<td>'.ShowBBcodes(htmlspecialchars($DbRow['Text'])).'</td>'. 61 59 '</tr>'; 62 60 } … … 74 72 if (array_key_exists('a', $_POST)) $Action = $_POST['a']; 75 73 else if (array_key_exists('a', $_GET)) $Action = $_GET['a']; 76 74 else $Action = ''; 77 75 if (array_key_exists('Edit', $_GET)) { 78 76 if (array_key_exists('text', $_POST)) 79 77 $Output .= $this->Edit(); 80 78 $Output .= $this->ShowEditForm(); 81 82 79 } else 83 80 if (array_key_exists('search', $_GET)) … … 101 98 { 102 99 $Output = ''; 103 $Text = $_POST['text']; 104 $DbResult = $this->System->Database->query('UPDATE `ForumText` SET `Text`="'.$_POST['text'].'" WHERE `User` = '.$this->System->User->Id.' AND `ID` = '.$_GET['Edit']); 100 $this->System->Database->query('UPDATE `ForumText` SET `Text`="'.$_POST['text'].'" WHERE `User` = '.$this->System->User->Id.' AND `ID` = '.$_GET['Edit']); 105 101 $Output .= ShowMessage(T('Text edited.')); 106 102 return $Output; … … 132 128 function ShowSearchForum() 133 129 { 134 $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));135 $Count = 20;136 130 $Output = ''; 137 131 … … 153 147 $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'. 154 148 htmlspecialchars($Line['ThreadName']).'</a><br /><strong>'.$Line['UserName']. 155 '</strong> ('.HumanDate($Line['Date']).'): '. $parser->qparse(htmlspecialchars($Line['Text'])).'</div> ';149 '</strong> ('.HumanDate($Line['Date']).'): '.ShowBBcodes(htmlspecialchars($Line['Text'])).'</div> '; 156 150 $Output .= '</div>'.$PageList['Output']; 157 151 return $Output; … … 181 175 $Output = ''; 182 176 183 $Parser = new HTML_BBCodeParser2(array('filters' => array('Basic', 'Extended', 'Images', 'Links', 'Lists', 'Email')));184 185 177 if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search']; 186 178 else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = ''; … … 212 204 $edit = '<a href="?Edit='.$Line['ID'].'">'.T('edit').'</a>'; 213 205 } else $edit = ''; 214 $Text = str_replace("\n", '<br />', $Parser->qparse(htmlspecialchars($Line['Text'])));206 $Text = str_replace("\n", '<br />', ShowBBcodes(htmlspecialchars($Line['Text']))); 215 207 $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']). 216 208 ')</span><strong>'.$Line['UserName'].'</strong>: '.$Text.' </div> '; … … 306 298 function ShowRSS() 307 299 { 308 $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));309 310 300 $Items = array(); 311 301 $TitleLength = 50; … … 322 312 'Title' => htmlspecialchars($DbRow['ThreadText']).' - '.$DbRow['UserName'].': ', 323 313 'Link' => 'http://'.$this->System->Config['Web']['Host'].$this->System->Link('/forum/?Thread='.$DbRow['Thread']), 324 'Description' => $parser->qparse(htmlspecialchars($DbRow['Text'])),314 'Description' => ShowBBcodes(htmlspecialchars($DbRow['Text'])), 325 315 'Time' => $DbRow['UnixDate'], 326 316 );
Note:
See TracChangeset
for help on using the changeset viewer.