Changeset 189 for trunk/aktuality/index.php
- Timestamp:
- Apr 12, 2009, 5:40:08 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/index.php
r183 r189 31 31 { 32 32 if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1; 33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id);33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `news`.`id`='.$Id); 34 34 if($DbResult->num_rows > 0) 35 35 { 36 36 $Row = $DbResult->fetch_array(); 37 if($Row['N ick'] == '') $Author = $Row['author'];38 else $Author = $Row['N ick'];37 if($Row['Name'] == '') $Author = $Row['author']; 38 else $Author = $Row['Name']; 39 39 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['title'].' ('.HumanDate($Row['date']).', '.$Author.')</strong>'; 40 40 if($this->System->Modules['User']->User['Id'] == $Row['User']) … … 105 105 106 106 $_POST['content'] = str_replace("\n",'<br />',$_POST['content']); 107 $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, 'author' => $this->System->Modules['User']->User['N ick'], 'User' => $this->System->Modules['User']->User['Id']));107 $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, 'author' => $this->System->Modules['User']->User['Name'], 'User' => $this->System->Modules['User']->User['Id'])); 108 108 $Output .= 'Aktualita přidána!<br />Pokud budete chtít vaši aktualitu smazat, klikněte na odkaz Smazat v seznamu všech aktualit v kategorii.<br /><br />'; 109 109 $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>'; … … 173 173 174 174 //echo(GetRemoteAddress().','.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br />'); 175 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);175 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage); 176 176 while($Row = $DbResult->fetch_array()) 177 177 { 178 if($Row['N ick'] == '') $Author = $Row['author'];179 else $Author = $Row['N ick'];178 if($Row['Name'] == '') $Author = $Row['author']; 179 else $Author = $Row['Name']; 180 180 $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Author.')</strong>'; 181 181 if($this->System->Modules['User']->User['Id'] == $Row['User'])
Note:
See TracChangeset
for help on using the changeset viewer.