Ignore:
Timestamp:
Jan 27, 2014, 10:42:38 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Allow ThreadId in forum and client version in game version only as number.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Forum/Forum.php

    r765 r767  
    7070        }
    7171 
    72   function Edit() {
     72  function Edit()
     73  {
    7374    $Output = '';
    7475
     
    142143                $Output .= $PageList['Output'];
    143144                $Output .= '<div class="shoutbox">';
    144                 $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread`  WHERE 1 ORDER BY `ID` DESC '.$PageList['SQLLimit']);
     145                $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE 1 ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    145146                while($Line = $DbResult->fetch_assoc())
    146147                        $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>';
     
    165166                } else $SearchQuery = '';                       
    166167
    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                {
    168171                $Thread = $DbResult->fetch_assoc();
    169172    $Output .= '<h3>'.$Thread['Text'].'</h3>';
    170173
    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);
    172175                $DbRow = $DbResult->fetch_row();
    173176                $PageList = GetPageList($DbRow[0]);     
     
    176179                $Output .= '<div class="shoutbox">';
    177180                $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']);
    179182                while($Line = $DbResult->fetch_assoc()) {
    180183                        if ($this->System->User->Id == $Line['User'])
     
    185188    }
    186189                $Output .= '</div>'.$PageList['Output'];
     190                } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    187191                return($Output);
    188192        }
     
    230234                $Output = '';
    231235                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)
    232239                {
    233240                        if(array_key_exists('text', $_POST))
     
    263270                        } else $Output .= ShowMessage('Nezadán text pro novou zprávu.', MESSAGE_CRITICAL);                             
    264271                        $Output .= '<br/>';
     272                } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    265273                } else $Output .= ShowMessage('Pro vkládaní zpráv musíte byt registrováni.', MESSAGE_CRITICAL);
    266274                return($Output);
Note: See TracChangeset for help on using the changeset viewer.