1 | <?php
|
---|
2 |
|
---|
3 | Header('Content-Type: text/xml');
|
---|
4 |
|
---|
5 | include('inc/config.php');
|
---|
6 | include('inc/database.php');
|
---|
7 | include('inc/system.php');
|
---|
8 | include('inc/rss_generator.php');
|
---|
9 |
|
---|
10 | $System = new System($Config);
|
---|
11 | $db = $System->Database;
|
---|
12 | $NewsCount = 10;
|
---|
13 | $Items = array();
|
---|
14 |
|
---|
15 | if(array_key_exists('category', $_GET))
|
---|
16 | {
|
---|
17 | if($_GET['category'] == 'articles')
|
---|
18 | {
|
---|
19 | $Config['Web']['Title'] .= ' - články';
|
---|
20 | $DbResult = $db->query('SELECT UNIX_TIMESTAMP(Time), Article.* FROM Article ORDER BY Time DESC LIMIT '.$NewsCount);
|
---|
21 | while($Row = $DbResult->fetch_assoc())
|
---|
22 | {
|
---|
23 | $Items[] = array(
|
---|
24 | 'Title' => $Row['Title'],
|
---|
25 | 'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'],
|
---|
26 | 'Description' => $Row['Content'].' ('.$Row['Author'].')',
|
---|
27 | 'Time' => $Row['UNIX_TIMESTAMP(Time)'],
|
---|
28 | );
|
---|
29 | }
|
---|
30 | } else
|
---|
31 | if($_GET['category'] == 'tickets')
|
---|
32 | {
|
---|
33 | $Config['Web']['Title'] .= ' - žádosti hráčů';
|
---|
34 | $db->select_db($Config['Mangos']['DatabaseCharacters']);
|
---|
35 | $DbResult = $db->query('SELECT `character_ticket`.`ticket_text` AS `text`, `characters`.`name` AS `name` FROM `character_ticket` JOIN `characters` ON `characters`.`guid` = `character_ticket`.`guid`');
|
---|
36 | while($Row = $DbResult->fetch_assoc())
|
---|
37 | {
|
---|
38 | $Items[] = array(
|
---|
39 | 'Title' => $Row['name'].': '.$Row['text'],
|
---|
40 | 'Link' => '',
|
---|
41 | 'Description' => $Row['name'].': '.$Row['text'],
|
---|
42 | 'Time' => 0,
|
---|
43 | );
|
---|
44 | }
|
---|
45 | }
|
---|
46 | if($_GET['category'] == 'finance')
|
---|
47 | {
|
---|
48 | $OperationType = array('consumption' => 'Spotřeba', 'contribution' => 'Příspěvek', 'buy' => 'Nákup', 'sell' => 'Prodej', 'internet' => 'Internet', 'hosting' => 'Hosting');
|
---|
49 | $Config['Web']['Title'] .= ' - finanční příspěvky';
|
---|
50 | $DbResult = $db->query('SELECT UNIX_TIMESTAMP(Time), Operation, Description, Money FROM Finance ORDER BY Time DESC LIMIT '.$NewsCount);
|
---|
51 | while($Row = $DbResult->fetch_assoc())
|
---|
52 | {
|
---|
53 | $Items[] = array
|
---|
54 | (
|
---|
55 | 'Title' => $OperationType[$Row['Operation']].' '.$Row['Description'].' ('.$Row['Money'].' Kč)',
|
---|
56 | 'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'].'finance/',
|
---|
57 | 'Description' => $OperationType[$Row['Operation']].' '.$Row['Description'].'<br />'.$Row['Money'].' Kč',
|
---|
58 | 'Time' => $Row['UNIX_TIMESTAMP(Time)'],
|
---|
59 | );
|
---|
60 | }
|
---|
61 | }
|
---|
62 | }
|
---|
63 |
|
---|
64 | echo(GenerateRSS(array(
|
---|
65 | 'Title' => $Config['Web']['Title'],
|
---|
66 | 'Link' => $Config['Web']['BaseURL'],
|
---|
67 | 'Description' => $Config['Web']['Description'],
|
---|
68 | 'WebmasterEmail' => $Config['Web']['AdminEmail'],
|
---|
69 | 'Items' => $Items), $Config['Web']['Charset']));
|
---|
70 |
|
---|
71 | ?>
|
---|