Changeset 196 for trunk/aktuality/news.php
- Timestamp:
- Apr 27, 2009, 8:00:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/news.php
r189 r196 19 19 $ItemCount = abs($ItemCount); 20 20 $DaysAgo = abs($DaysAgo); 21 $DbResult = $Database->select(' news_category', '*', 'id='.$Category);21 $DbResult = $Database->select('NewsCategory', '*', 'Id='.$Category); 22 22 $Row = $DbResult->fetch_array(); 23 23 $Output = '<table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-size: small; padding-bottom: 5px;"><tr>'; 24 $Output .= '<td>'.$Row[' caption'].'</td><td align="right">';24 $Output .= '<td>'.$Row['Caption'].'</td><td align="right">'; 25 25 $Output .= '<a href="aktuality/index.php?category='.$Category.'">Zobrazit všechny aktuality</a> '; 26 26 if($this->System->Modules['User']->CheckPermission('News', 'Insert', 'Group', $Category)) 27 27 $Output .= '<a href="aktuality/index.php?action=add&category='.$Category.'">Přidat aktualitu</a> '; 28 28 $Output .= '</td></tr><tr><td colspan="2">'; 29 $DbResult = $Database->query('SELECT ` news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);29 $DbResult = $Database->query('SELECT `News`.*, `User`.`Name` FROM `News` LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE (`News`.`Category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `News`.`Date`) ORDER BY `News`.`Date` DESC LIMIT 0,'.$ItemCount); 30 30 //echo($Database->error.'<br />'); 31 31 //echo($Database->LastQuery.'<br />'); … … 38 38 while($Row = $DbResult->fetch_array()) 39 39 { 40 if($Row['Name'] == '') $Author = $Row[' author'];40 if($Row['Name'] == '') $Author = $Row['Author']; 41 41 else $Author = $Row['Name']; 42 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&id='.$Row[' id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['date']).')</td></tr></table>';43 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row[' content'];42 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&id='.$Row['Id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['Title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['Date']).')</td></tr></table>'; 43 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['Content']; 44 44 45 if($Row[' enclosure'] != '')45 if($Row['Enclosure'] != '') 46 46 { 47 47 $Output .= '<br />Přílohy: '; 48 $Enclosures = explode(';', $Row[' enclosure']);48 $Enclosures = explode(';', $Row['Enclosure']); 49 49 foreach($Enclosures as $Enclosure) 50 50 { … … 67 67 $this->NewsSetting = array(); 68 68 $I = 1; 69 $DbResult = $this->Database->select(' news_category', '*');69 $DbResult = $this->Database->select('NewsCategory', '*'); 70 70 while($NewsCategory = $DbResult->fetch_array()) 71 71 { 72 $this->NewsSetting[] = array('CategoryId' => $NewsCategory[' id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo']);72 $this->NewsSetting[] = array('CategoryId' => $NewsCategory['Id'], 'Index' => $I, 'Enabled' => 1, 'ItemCount' => $this->System->Config['Web']['News']['Count'], 'DaysAgo' => $this->System->Config['Web']['News']['DaysAgo']); 73 73 $I++; 74 74 } … … 118 118 foreach($this->NewsSetting as $SettingItem) 119 119 { 120 $DbResult = $this->Database->select(' news_category', '*', 'id='.$SettingItem['CategoryId']);120 $DbResult = $this->Database->select('NewsCategory', '*', 'Id='.$SettingItem['CategoryId']); 121 121 $NewsCategory = $DbResult->fetch_array(); 122 $Output .= '<tr><td>'.$NewsCategory[' caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"';122 $Output .= '<tr><td>'.$NewsCategory['Caption'].'</td><td align="center"><input type="text" size="2" name="NewsCategoryIndex'.$I.'" value="'.$SettingItem['Index'].'" /></td><td align="center"><input type="checkbox" name="NewsCategoryEnabled'.$I.'"'; 123 123 if($SettingItem['Enabled'] == 1) $Output .= ' checked="checked"'; 124 124 $Output .= ' /></td>'. … … 156 156 setcookie('NewsSetting', $_COOKIE['NewsSetting'], time() + 60 * 60 * 24 * 365); 157 157 } 158 159 158 } 160 159 161 162 160 ?>
Note:
See TracChangeset
for help on using the changeset viewer.