Changeset 196 for trunk/aktuality/rss.php
- Timestamp:
- Apr 27, 2009, 8:00:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/rss.php
r187 r196 1 1 <?php 2 2 3 Header( "Content-Type: text/xml");3 Header('Content-Type: text/xml'); 4 4 5 5 include_once('../global.php'); … … 28 28 // Get category names 29 29 $Categories = array(); 30 $DbResult = $Database->select(' news_category', '*');30 $DbResult = $Database->select('NewsCategory', '*'); 31 31 while($Category = $DbResult->fetch_array()) 32 32 { 33 $Categories[$Category[' id']] = $Category['caption'];33 $Categories[$Category['Id']] = $Category['Caption']; 34 34 } 35 35 … … 61 61 $Database->select_db('forum'); 62 62 } 63 $Database->select_db('is'); 63 64 */ 64 $Database->select_db('is');65 65 66 66 // Get news from database by selected categories 67 67 $UploadedFilesFolder = 'uploads/'; 68 $DbResult = $Database->query('SELECT enclosure,category,title,content,UNIX_TIMESTAMP(date),author FROM news WHERE '.$Where.' ORDER BY date DESC LIMIT 0,'.$NewsCount);69 while($Row = $DbResult->fetch_a rray())68 $DbResult = $Database->query('SELECT *, UNIX_TIMESTAMP(Date) FROM News LEFT JOIN `User` ON `User`.`Id`=`News`.`User` WHERE '.$Where.' ORDER BY News.Date DESC LIMIT 0,'.$NewsCount); 69 while($Row = $DbResult->fetch_assoc()) 70 70 { 71 71 $EnclosuresText = ''; 72 if($Row[' enclosure'] != '')72 if($Row['Enclosure'] != '') 73 73 { 74 74 $EnclosuresText .= '<br />Přílohy: '; 75 $Enclosures = explode(';', $Row[' enclosure']);75 $Enclosures = explode(';', $Row['Enclosure']); 76 76 foreach($Enclosures as $Enclosure) 77 77 { … … 79 79 } 80 80 } 81 if($Row['Name'] == '') $Author = $Row['Author']; 82 else $Author = $Row['Name']; 81 83 $Items[] = array( 82 'Title' => $Categories[$Row[' category']].' - '.$Row['title'],83 'Link' => 'http://centrala.zdechov.net/aktuality/index.php?category='.$Row[' category'],84 'Description' => $Row[' content']." (".$Row['author'].")".$EnclosuresText,85 'Time' => $Row['UNIX_TIMESTAMP( date)'],84 'Title' => $Categories[$Row['Category']].' - '.$Row['Title'], 85 'Link' => 'http://centrala.zdechov.net/aktuality/index.php?category='.$Row['Category'], 86 'Description' => $Row['Content'].' ('.$Author.')'.$EnclosuresText, 87 'Time' => $Row['UNIX_TIMESTAMP(Date)'], 86 88 ); 87 89 } … … 93 95 'WebmasterEmail' => $Config['Web']['AdminEmail'], 94 96 'Items' => $Items))); 97 95 98 ?>
Note:
See TracChangeset
for help on using the changeset viewer.