Database; $NewsCount = 10; $Items = array(); if(array_key_exists('category', $_GET)) { if($_GET['category'] == 'articles') { $Config['Web']['Title'] .= ' - články'; $DbResult = $db->query('SELECT UNIX_TIMESTAMP(Time), Article.* FROM Article ORDER BY Time DESC LIMIT '.$NewsCount); while($Row = $DbResult->fetch_assoc()) { $Items[] = array( 'Title' => $Row['Title'], 'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'], 'Description' => $Row['Content'].' ('.$Row['Author'].')', 'Time' => $Row['UNIX_TIMESTAMP(Time)'], ); } } else if($_GET['category'] == 'tickets') { $Config['Web']['Title'] .= ' - žádosti hráčů'; $db->select_db($Config['Mangos']['DatabaseCharacters']); $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`'); while($Row = $DbResult->fetch_assoc()) { $Items[] = array( 'Title' => $Row['name'].': '.$Row['text'], 'Link' => '', 'Description' => $Row['name'].': '.$Row['text'], 'Time' => 0, ); } } if($_GET['category'] == 'finance') { $OperationType = array('consumption' => 'Spotřeba', 'contribution' => 'Příspěvek', 'buy' => 'Nákup', 'sell' => 'Prodej', 'internet' => 'Internet', 'hosting' => 'Hosting'); $Config['Web']['Title'] .= ' - finanční příspěvky'; $DbResult = $db->query('SELECT UNIX_TIMESTAMP(Time), Operation, Description, Money FROM Finance ORDER BY Time DESC LIMIT '.$NewsCount); while($Row = $DbResult->fetch_assoc()) { $Items[] = array ( 'Title' => $OperationType[$Row['Operation']].' '.$Row['Description'].' ('.$Row['Money'].' Kč)', 'Link' => 'http://'.$_SERVER['SERVER_NAME'].$Config['Web']['BaseURL'].'finance/', 'Description' => $OperationType[$Row['Operation']].' '.$Row['Description'].'
'.$Row['Money'].' Kč', 'Time' => $Row['UNIX_TIMESTAMP(Time)'], ); } } } echo(GenerateRSS(array( 'Title' => $Config['Web']['Title'], 'Link' => $Config['Web']['BaseURL'], 'Description' => $Config['Web']['Description'], 'WebmasterEmail' => $Config['Web']['AdminEmail'], 'Items' => $Items), $Config['Web']['Charset'])); ?>