Changeset 510


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
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/action.php

    r507 r510  
    271271  if($User->Licence(LICENCE_ADMIN)) $Output .= ' <a href="admin/?action=addnew">Vložit</a>';
    272272  $Output .= '<div class="shoutbox">';
    273   $DbResult = $System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);
     273  $DbResult = $System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '.
     274        '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);
    274275  while($Line = $DbResult->fetch_assoc())
    275     $Output .= '<div><strong>'.HumanDate($Line['Time']).'</strong> '.$Line['Text'].' ('.$Line['User'].')</div>';
     276    $Output .= '<div><strong>'.$Line['Title'].' ('.HumanDate($Line['Time']).')</strong> '.$Line['Text'].' ('.$Line['User'].')</div>';
    276277  $Output .= '</div>'.$PageList['Output'];
    277278  return($Output);
  • 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
  • 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.');
  • 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';
  • trunk/includes/Page.php

    r507 r510  
    11<?php
    2 
    3 $RSSChannels = array(
    4   array('Title' => 'Změny systému', 'Channel' => 'news'),
    5   array('Title' => 'Poslední překlady', 'Channel' => 'translation'),
    6   array('Title' => 'Shoutbox', 'Channel' => 'shoutbox'),
    7 );
    82
    93function ShowShoutbox()
  • trunk/includes/global.php

    r507 r510  
    2525  date_default_timezone_set($Config['Web']['Timezone']);
    2626 
    27   $Revision = 506; // Subversion revision
     27  $Revision = 510; // Subversion revision
    2828  $ReleaseTime = '2013-02-15'; 
    2929 
  • trunk/index.php

    r507 r510  
    88
    99  $Output = '<strong>Změny systému:</strong><div class="NewsBox">';
    10   $DbResult = $System->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
     10  $DbResult = $System->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text`,`News`.`Title`'.
     11    ' FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    1112  while($DbRow = $DbResult->fetch_assoc())
    12     $Output .= '<div><strong>'.$DbRow['Name'].' ('.HumanDate($DbRow['Time']).')</strong> <br />'.$DbRow['Text'].'</div>'; 
     13    $Output .= '<div><strong>'.$DbRow['Title'].' ('.HumanDate($DbRow['Time']).')</strong> <br />'.$DbRow['Text'].'</div>'; 
    1314  $Output .= '<a href="action.php?action=news">Všechny zprávy</a>';
    1415  $Output .= '</div>';
  • trunk/rss.php

    r505 r510  
    66  if($_GET['channel'] == 'news')
    77  {
    8     $DbResult = $System->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, `News`.`Time`, `User`.`Name`, `News`.`Text` FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
     8    $DbResult = $System->Database->query('SELECT UNIX_TIMESTAMP(`News`.`Time`) AS `UnixTime`, '.
     9      '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text` '.
     10      'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    911    while($DbRow = $DbResult->fetch_assoc())
    1012    {
    1113      $Items[] = array
    1214    (
    13         'Title' => $DbRow['Name'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',
     15        'Title' => $DbRow['Title'],
    1416        'Link' =>  'http://'.$Config['Web']['Host'].$System->Link('/'),
    15         'Description' => $DbRow['Text'],
     17        'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')',
    1618        'Time' => $DbRow['UnixTime'],
    1719      );
Note: See TracChangeset for help on using the changeset viewer.