Changeset 470 for trunk/action.php
- Timestamp:
- Apr 22, 2010, 8:44:59 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r468 r470 66 66 echo('</form><br />'); 67 67 68 if(array_key_exists('Type', $_POST))68 if(array_key_exists('Type', $_POST)) 69 69 { 70 70 $sql = 'DELETE FROM `Log` WHERE `Type` = '.$_POST['Type']; … … 152 152 echo ('Začínám opravovat Take: <br />'); 153 153 154 $Tables = array ('global_strings', 'glue_strings');154 $Tables = array('TextGlobalString', 'TextGlueString'); 155 155 156 156 foreach($Tables as $Table) … … 174 174 } 175 175 } 176 } 176 } else ShowMessage('Nemáte oprávnění.', MESSAGE_CRITICAL); 177 177 } 178 178 … … 212 212 { 213 213 $Text = $_POST['text']; 214 // Protection against mutiple post of same message 215 $DbResult = $System->Database->query('SELECT `Text` FROM `ShoutBox` WHERE (`User` = "'.$User->Name.'") AND (`Text` = "'.$Text.'") ORDER BY `Date` DESC LIMIT 1'); 216 if($DbResult->num_rows > 0) ShowMessage('Nelze vložit stejnou zprávu vícekrát za sebou.', MESSAGE_WARNING); 217 else 218 { 219 $System->Database->query('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` ) '. 220 ' VALUES ("'.$User->Name.'", "'.$Text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")'); 221 ShowMessage('Zpráva vložena.'); 214 if(trim($Text) == '') ShowMessage('Nelze vložit prázdnou zprávu.', MESSAGE_WARNING); 215 else 216 { 217 // Protection against mutiple post of same message 218 $DbResult = $System->Database->query('SELECT `Text` FROM `ShoutBox` WHERE (`User` = "'.$User->Id.'") ORDER BY `Date` DESC LIMIT 1'); 219 if($DbResult->num_rows > 0) 220 { 221 $DbRow = $DbResult->fetch_assoc(); 222 } else $DbRow['Text'] = ''; 223 224 if($DbRow['Text'] == $Text) ShowMessage('Nelze vložit stejnou zprávu vícekrát za sebou.', MESSAGE_WARNING); 225 else 226 { 227 $System->Database->query('INSERT INTO `ShoutBox` ( `User`, `UserName` , `Text` , `Date` , `IP` ) '. 228 ' VALUES ('.$User->Id.', "'.$User->Name.'", "'.$Text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")'); 229 ShowMessage('Zpráva vložena.'); 230 } 222 231 } 223 232 } else ShowMessage('Nezadán text pro novou zprávu.', MESSAGE_CRITICAL); … … 242 251 $DbResult = $System->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']); 243 252 while($Line = $DbResult->fetch_assoc()) 244 echo('<div><strong>'.$Line['User '].'</strong>: '.MakeActiveLinks($Line['Text']).'</div>');253 echo('<div><strong>'.$Line['UserName'].'</strong>: '.MakeActiveLinks($Line['Text']).'</div>'); 245 254 echo('</div>'); 246 255 echo($PageList['Output']);
Note:
See TracChangeset
for help on using the changeset viewer.