Changeset 510 for trunk/admin


Ignore:
Timestamp:
Feb 15, 2013, 11:02:13 PM (12 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.
Location:
trunk/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/admin/UpdateTrace.php

    r508 r510  
    23952395}
    23962396
     2397function UpdateTo510($Manager)
     2398{     
     2399  global $System;
     2400 
     2401  $Manager->Execute('ALTER TABLE `News` ADD `Title` VARCHAR( 255 ) NOT NULL AFTER `Time`');
     2402  $Manager->Execute('UPDATE `News` SET `Title` = (SELECT `Name` FROM `User` AS `T` WHERE `T`.`ID` = `User`)');
     2403}
     2404
    23972405$Updates = array(
    23982406        498 => array('Revision' => 506, 'Function' => 'UpdateTo506'),
     2407        506 => array('Revision' => 510, 'Function' => 'UpdateTo510'),
    23992408);
    24002409
  • TabularUnified 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.');
  • TabularUnified trunk/admin/install.php

    r507 r510  
    33$StopAfterUpdateManager = true;
    44include_once('../includes/global.php');
    5 include_once('../sql/UpdateTrace.php');
     5include_once('UpdateTrace.php');
    66$UpdateManager->Trace = $Updates;
    77$UpdateManager->InstallMethod = 'FullInstall';
Note: See TracChangeset for help on using the changeset viewer.