Changeset 850 for trunk/Modules/Forum
- Timestamp:
- Jan 17, 2016, 8:15:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Forum/Forum.php
r846 r850 35 35 'Icon' => '', 36 36 ), 17); 37 } 38 39 function ShowBox() 40 { 41 $Parser = new HTML_BBCodeParser2(array('filters' => array('Basic', 'Extended', 42 'Images', 'Links', 'Lists', 'Email'))); 43 $Count = 20; 44 $Output = '<strong><a href="'.$this->System->Link('/forum/').'">'.T('Last forum posts').':</a></strong>'; 45 46 $Query = 'SELECT `ForumText`.`Text`, `ForumText`.`Date`, `User`.`Name` AS `UserName`, '. 47 '`User`.`Id` AS `UserId`, `ForumText`.`Thread` '. 48 'FROM `ForumText` '. 49 'JOIN `User` ON `User`.`Id` = `ForumText`.`User` '. 50 'ORDER BY `Date` DESC LIMIT '.$Count; 51 $DbResult = $this->Database->query($Query); 52 $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('User').'</th><th>'.T('Post').'</th></tr>'; 53 while($DbRow = $DbResult->fetch_assoc()) 54 { 55 $Output .= '<tr>'. 56 '<td><a href="'.$this->System->Link('/forum/?Thread='.$DbRow['Thread']).'">'.HumanDate($DbRow['Date']).'</a></td>'. 57 '<td><a href="'.$this->System->Link('/user/?user='.$DbRow['UserId']).'">'.$DbRow['UserName'].'</a></td>'. 58 '<td>'.$Parser->qparse($DbRow['Text']).'</td>'. 59 '</tr>'; 60 } 61 $Output .= '</table>'; 62 return($Output); 37 63 } 38 64 } … … 73 99 { 74 100 $Output = ''; 75 76 101 $Text = $_POST['text']; 77 78 102 $DbResult = $this->System->Database->query('UPDATE `ForumText` SET `Text`="'.$_POST['text'].'" WHERE `User` = '.$this->System->User->Id.' AND `ID` = '.$_GET['Edit']); 79 80 103 $Output .= ShowMessage(T('Text edited.')); 81 82 83 104 return ($Output); 84 105 } … … 178 199 $Output .= $PageList['Output']; 179 200 $Output .= '<div class="shoutbox">'; 180 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` 201 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '. 181 202 ($_GET['Thread']*1).' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 182 203 while($Line = $DbResult->fetch_assoc()) { 183 204 if ($this->System->User->Id == $Line['User']) 184 $edit = '<a href="?Edit='.$Line['ID'].'"> editovat</a>';205 $edit = '<a href="?Edit='.$Line['ID'].'">'.T('edit').'</a>'; 185 206 else $edit = ''; 186 207 $Output .= '<div><span style="float:right;">'.$edit.' ('.HumanDate($Line['Date']). … … 197 218 if($this->System->User->Licence(LICENCE_USER)) 198 219 { 199 200 201 202 220 $Output .= '<form action="?Thread='.$_GET['Thread'].'" method="post">'. 221 '<fieldset><legend>'.T('New Forum Message').'</legend>'. 222 T('User').': '; 223 if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />'; 203 224 else $Output .= '<input type="text" name="user" /><br />'; 204 205 '<textarea onkeydown="ResizeTextArea(this)" name="text" cols="80"></textarea> <br/>'.206 '<input type="hidden" name="a" value="add2"/>'.207 '<input type="submit" value="'.T('Send').'" /><br /></fieldset>'.208 '</form>';225 $Output .= T('Message text').': ('.T('You can use').' <a href="http://www.bbcode.org/reference.php">'.T('BB code').'</a>)<br/>'. 226 '<textarea onkeydown="ResizeTextArea(this)" name="text" cols="80"></textarea> <br/>'. 227 '<input type="hidden" name="a" value="add2"/>'. 228 '<input type="submit" value="'.T('Send').'" /><br /></fieldset>'. 229 '</form>'; 209 230 } else $Output .= ShowMessage(T('You have to be registered for adding message.'), MESSAGE_CRITICAL); 210 231 return($Output);
Note:
See TracChangeset
for help on using the changeset viewer.