source: branches/old/rss.php

Last change on this file was 448, checked in by george, 16 years ago
  • Přesunuto: Obsah kořenové složky byl přesunut do složky trunk a beta web přesunut do branches/beta.
File size: 897 bytes
Line 
1<?php
2
3header("Content-Type: text/xml");
4
5include_once('global.php');
6include_once('rss_generator.php');
7
8$NewsCount = 10;
9$Items = array();
10
11$DbResult = $Database->query('SELECT UNIX_TIMESTAMP(news.time), news.title, news.short_text, user.User FROM news JOIN user ON user.ID=news.user ORDER BY time DESC LIMIT '.$NewsCount);
12while($Row = $DbResult->fetch_array())
13{
14 $Items[] = array(
15 'Title' => $Row['title'],
16 'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'],
17 'Description' => $Row['short_text']." (".$Row['User'].")",
18 'Time' => $Row['UNIX_TIMESTAMP(news.time)'],
19 );
20}
21
22echo(GenerateRSS(array(
23 'Title' => $Config['Web']['Title'],
24 'Link' => $Config['Web']['BaseURL'],
25 'Description' => $Config['Web']['Description'],
26 'WebmasterEmail' => $Config['Web']['AdminEmail'],
27 'Items' => $Items), $Config['Web']['Charset']));
28?>
Note: See TracBrowser for help on using the repository browser.