Changeset 510
- Timestamp:
- Feb 15, 2013, 11:02:13 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/action.php
r507 r510 271 271 if($User->Licence(LICENCE_ADMIN)) $Output .= ' <a href="admin/?action=addnew">Vložit</a>'; 272 272 $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']); 274 275 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>'; 276 277 $Output .= '</div>'.$PageList['Output']; 277 278 return($Output); -
trunk/admin/UpdateTrace.php
r508 r510 2395 2395 } 2396 2396 2397 function 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 2397 2405 $Updates = array( 2398 2406 498 => array('Revision' => 506, 'Function' => 'UpdateTo506'), 2407 506 => array('Revision' => 510, 'Function' => 'UpdateTo510'), 2399 2408 ); 2400 2409 -
trunk/admin/index.php
r504 r510 31 31 32 32 $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/>'. 34 36 '<input type="submit" value="Uložit"/><br/>'. 35 '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="Text" name="text"></textarea>'.36 37 '</form>'; 37 38 return($Output); … … 42 43 global $System, $Config, $User; 43 44 44 if(array_key_exists('text', $_POST) )45 if(array_key_exists('text', $_POST) and array_key_exists('title', $_POST)) 45 46 { 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'].'")'; 47 49 $System->Database->query($querty); 48 50 $Output = ShowMessage('Aktualita uložena.'); -
trunk/admin/install.php
r507 r510 3 3 $StopAfterUpdateManager = true; 4 4 include_once('../includes/global.php'); 5 include_once(' ../sql/UpdateTrace.php');5 include_once('UpdateTrace.php'); 6 6 $UpdateManager->Trace = $Updates; 7 7 $UpdateManager->InstallMethod = 'FullInstall'; -
trunk/includes/Page.php
r507 r510 1 1 <?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 );8 2 9 3 function ShowShoutbox() -
trunk/includes/global.php
r507 r510 25 25 date_default_timezone_set($Config['Web']['Timezone']); 26 26 27 $Revision = 5 06; // Subversion revision27 $Revision = 510; // Subversion revision 28 28 $ReleaseTime = '2013-02-15'; 29 29 -
trunk/index.php
r507 r510 8 8 9 9 $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'); 11 12 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>'; 13 14 $Output .= '<a href="action.php?action=news">Všechny zprávy</a>'; 14 15 $Output .= '</div>'; -
trunk/rss.php
r505 r510 6 6 if($_GET['channel'] == 'news') 7 7 { 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'); 9 11 while($DbRow = $DbResult->fetch_assoc()) 10 12 { 11 13 $Items[] = array 12 14 ( 13 'Title' => $DbRow[' Name'].'('.date('d.m.Y', MysqlDateTimeToTime($DbRow['Time'])).')',15 'Title' => $DbRow['Title'], 14 16 'Link' => 'http://'.$Config['Web']['Host'].$System->Link('/'), 15 'Description' => $DbRow['Text'] ,17 'Description' => $DbRow['Text'].' ('.$DbRow['Name'].')', 16 18 'Time' => $DbRow['UnixTime'], 17 19 );
Note:
See TracChangeset
for help on using the changeset viewer.