Changeset 510 for trunk/admin/index.php


Ignore:
Timestamp:
Feb 15, 2013, 11:02:13 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: Novinky na webu nyní mají titulek. U starých novinek se nastaví jako titulek jméno uživatele, jako to bylo dříve.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/index.php

    r504 r510  
    3131 
    3232  $Output = '<form action="?action=addnew" method="POST">'.
    33   'Uživatel: '.$User->Name.'('.$User->Id.')<br/> '.
     33  'Uživatel: '.$User->Name.'('.$User->Id.')<br/> '. 
     34  'Nadpis: <input type="text" name="title" size="40"/><br/>'.
     35  'Obsah: <textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="Text" name="text"></textarea><br/>'.
    3436  '<input type="submit" value="Uložit"/><br/>'.
    35   '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="Text" name="text"></textarea>'.
    3637  '</form>';
    3738  return($Output);
     
    4243  global $System, $Config, $User;
    4344 
    44   if(array_key_exists('text', $_POST))
     45  if(array_key_exists('text', $_POST) and array_key_exists('title', $_POST))
    4546  {
    46     $querty = 'INSERT INTO `News` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$User->Id.', "'.$_POST['text'].'")';
     47    $querty = 'INSERT INTO `News` (`Title`, `Time` ,`User` ,`Text`) VALUES ( "'.$_POST['title'].'", NOW( ) , '.
     48      $User->Id.', "'.$_POST['text'].'")';
    4749    $System->Database->query($querty);
    4850    $Output = ShowMessage('Aktualita uložena.');
Note: See TracChangeset for help on using the changeset viewer.