Changeset 767 for trunk/Modules/Forum
- Timestamp:
- Jan 27, 2014, 10:42:38 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Forum/Forum.php
r765 r767 70 70 } 71 71 72 function Edit() { 72 function Edit() 73 { 73 74 $Output = ''; 74 75 … … 142 143 $Output .= $PageList['Output']; 143 144 $Output .= '<div class="shoutbox">'; 144 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` 145 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE 1 ORDER BY `ID` DESC '.$PageList['SQLLimit']); 145 146 while($Line = $DbResult->fetch_assoc()) 146 147 $Output .= '<div><span style="float:right;"><strong>'.$Line['UserName'].'</strong> - ('.HumanDate($Line['Date']).')</span> <a href="?Thread='.$Line['ID'].'">'.str_replace("\n", '',$Line['Text']).'</a> </div>'; … … 165 166 } else $SearchQuery = ''; 166 167 167 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE ID='.$_GET['Thread'].' LIMIT 1'); 168 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE ID='.($_GET['Thread']*1).' LIMIT 1'); 169 if($DbResult->num_rows > 0) 170 { 168 171 $Thread = $DbResult->fetch_assoc(); 169 172 $Output .= '<h3>'.$Thread['Text'].'</h3>'; 170 173 171 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ForumText` WHERE `Thread` = '. $_GET['Thread'].' '.$SearchQuery);174 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `ForumText` WHERE `Thread` = '.($_GET['Thread']*1).' '.$SearchQuery); 172 175 $DbRow = $DbResult->fetch_row(); 173 176 $PageList = GetPageList($DbRow[0]); … … 176 179 $Output .= '<div class="shoutbox">'; 177 180 $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '. 178 $_GET['Thread'].' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']);181 ($_GET['Thread']*1).' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']); 179 182 while($Line = $DbResult->fetch_assoc()) { 180 183 if ($this->System->User->Id == $Line['User']) … … 185 188 } 186 189 $Output .= '</div>'.$PageList['Output']; 190 } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 187 191 return($Output); 188 192 } … … 230 234 $Output = ''; 231 235 if($this->System->User->Licence(LICENCE_USER)) 236 { 237 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE ID='.($_GET['Thread']*1).' LIMIT 1'); 238 if($DbResult->num_rows > 0) 232 239 { 233 240 if(array_key_exists('text', $_POST)) … … 263 270 } else $Output .= ShowMessage('Nezadán text pro novou zprávu.', MESSAGE_CRITICAL); 264 271 $Output .= '<br/>'; 272 } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 265 273 } else $Output .= ShowMessage('Pro vkládaní zpráv musíte byt registrováni.', MESSAGE_CRITICAL); 266 274 return($Output);
Note:
See TracChangeset
for help on using the changeset viewer.