- Timestamp:
- Aug 13, 2013, 11:45:33 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/FrontPage/FrontPage.php
r561 r562 11 11 $this->License = 'GNU/GPL'; 12 12 $this->Description = 'Main welcome page'; 13 $this->Dependencies = array( );13 $this->Dependencies = array('News', 'User', 'ShoutBox', 'Translation'); 14 14 } 15 15 … … 81 81 '</td></tr>'. 82 82 '<tr><td>'.$this->ShowLastTranslated().'</td>'. 83 '<td class="news-box">'.$this->S howNews().'</td>'.83 '<td class="news-box">'.$this->System->ModuleManager->Modules['News']->ShowBox().'</td>'. 84 84 '<td>'.$this->System->ModuleManager->Modules['ShoutBox']->ShowBox().'</td>'. 85 85 '</tr></table>'; 86 86 return($Output); 87 } 88 89 function ShowNews() 90 { 91 $Output = '<strong>Změny systému:</strong><div class="NewsBox">'; 92 $DbResult = $this->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text`,`News`.`Title`'. 93 ' FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10'); 94 while($DbRow = $DbResult->fetch_assoc()) 95 $Output .= '<div><strong>'.$DbRow['Title'].' ('.HumanDate($DbRow['Time']).')</strong> <br />'.$DbRow['Text'].' ('.$DbRow['Name'].')</div>'; 96 $Output .= '<a href="action.php?action=news">Všechny zprávy</a>'; 97 $Output .= '</div>'; 98 return($Output); 99 } 87 } 100 88 101 89 function ShowLastTranslated() -
trunk/action.php
r561 r562 184 184 } 185 185 186 function ShowNewsHistory()187 {188 global $System, $User;189 190 $DbResult = $System->Database->query('SELECT COUNT(*) FROM `News`');191 $DbRow = $DbResult->fetch_row();192 $PageList = GetPageList($DbRow[0]);193 194 $Output = '<h3>Novinky</h3>'.$PageList['Output'];195 if($User->Licence(LICENCE_ADMIN)) $Output .= ' <a href="admin/?action=addnew">Vložit</a>';196 $Output .= '<div class="shoutbox">';197 $DbResult = $System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '.198 '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);199 while($Line = $DbResult->fetch_assoc())200 $Output .= '<div><strong>'.$Line['Title'].' ('.HumanDate($Line['Time']).')</strong><br/> '.$Line['Text'].' ('.$Line['User'].')</div>';201 $Output .= '</div>'.$PageList['Output'];202 return($Output);203 }204 186 205 187 if(array_key_exists('group', $_GET)) $GroupId = LoadGroupIdParameter(); … … 209 191 if(array_key_exists('action', $_GET)) $Action = $_GET['action']; 210 192 211 if($Action == 'news') $Output = ShowNewsHistory();212 193 else if($Action == 'search') $Output = Search(); 213 194 else if($Action == 'dbkit') $Output = DatabaseKit(); -
trunk/admin/index.php
r539 r562 21 21 '<a href="'.$System->Link('/admin/?action=delerrlog').'">Vymázání chybových záznamů</a><br/>'. 22 22 '<small>Provede vymazání všech chybových záznamů v logu</small><br/><br/>'. 23 '<a href="'.$System->Link('/ admin/?action=addnew').'">Přidání aktuality</a><br/>'.23 '<a href="'.$System->Link('/news/?a=add').'">Přidání aktuality</a><br/>'. 24 24 '<small>Přidá aktulitu na hlavní stranu projektu</small><br/><br/>'. 25 25 '<a href="'.$System->Link('/admin/?action=testing').'">Testování</a><br/>'. 26 26 '<small>Testovací funkce</small><br/><br/>'; 27 return($Output);28 }29 30 function ShowNewForm()31 {32 global $User;33 34 $Output = '<form action="?action=addnew" method="POST">'.35 'Uživatel: '.$User->Name.'('.$User->Id.')<br/> '.36 'Nadpis: <input type="text" name="title" size="40"/><br/>'.37 'Obsah: <textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="Text" name="text"></textarea><br/>'.38 '<input type="submit" value="Uložit"/><br/>'.39 '</form>';40 return($Output);41 }42 43 function SaveNew()44 {45 global $System, $Config, $User;46 47 if(array_key_exists('text', $_POST) and array_key_exists('title', $_POST))48 {49 $querty = 'INSERT INTO `News` (`Title`, `Time` ,`User` ,`Text`) VALUES ( "'.$_POST['title'].'", NOW( ) , '.50 $User->Id.', "'.$_POST['text'].'")';51 $System->Database->query($querty);52 $Output = ShowMessage('Aktualita uložena.');53 WriteLog('Vložena nová aktualita', LOG_TYPE_ADMINISTRATION);54 } else $Output = ShowMessage('Nezadány údaje', MESSAGE_CRITICAL);55 27 return($Output); 56 28 } … … 117 89 else if($_GET['action'] == 'testing') $Output .= Testing(); 118 90 else if($_GET['action'] == 'phpinfo') $Output .= ShowPHPInfo(); 119 else if($_GET['action'] == 'addnew') 120 { 121 $Output .= SaveNew(); 122 $Output .= ShowNewForm(); 123 } else 124 $Output .= ShowMenu(); 91 else $Output .= ShowMenu(); 125 92 } else $Output .= ShowMenu(); 126 93 } else $Output .= ShowMessage('Nemáte oprávnění.', MESSAGE_CRITICAL); 127 94 128 95 ShowPage($Output); 129 130 ?> -
trunk/includes/Version.php
r561 r562 1 1 <?php 2 2 3 $Revision = 56 1; // Subversion revision3 $Revision = 562; // Subversion revision 4 4 $DatabaseRevision = 543; // Database structure revision 5 5 $ReleaseTime = '2013-08-13'; -
trunk/includes/global.php
r561 r562 25 25 include_once(dirname(__FILE__).'/../Modules/ClientVersion/ClientVersion.php'); 26 26 include_once(dirname(__FILE__).'/../Modules/ShoutBox/ShoutBox.php'); 27 include_once(dirname(__FILE__).'/../Modules/News/News.php'); 27 28 include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php'); 28 29 … … 80 81 $System->ModuleManager->RegisterModule(new ModuleClientVersion($System)); 81 82 $System->ModuleManager->RegisterModule(new ModuleShoutBox($System)); 83 $System->ModuleManager->RegisterModule(new ModuleNews($System)); 82 84 $System->ModuleManager->RegisterModule(new ModuleFrontPage($System)); 83 85 $System->ModuleManager->StartAll(); 84 86 } 85 86 $System->RegisterRSS(array('Title' => 'Změny systému', 'Channel' => 'news'));87 87 88 88 function GetMicrotime()
Note:
See TracChangeset
for help on using the changeset viewer.