| 1 |
<?php |
| 2 |
/** |
| 3 |
* File functions: |
| 4 |
* RSS Channel |
| 5 |
* |
| 6 |
* @name : rss.php |
| 7 |
* @copyright : (C) 2004,2005,2006 Vallheru Team based on Gamers-Fusion ver 2.5 |
| 8 |
* @author : thindil <thindil@users.sourceforge.net> |
| 9 |
* @version : 1.1 |
| 10 |
* @since : 23.06.2006 |
| 11 |
* |
| 12 |
*/ |
| 13 |
|
| 14 |
// |
| 15 |
// |
| 16 |
// This program is free software; you can redistribute it and/or modify |
| 17 |
// it under the terms of the GNU General Public License as published by |
| 18 |
// the Free Software Foundation; either version 2 of the License, or |
| 19 |
// (at your option) any later version. |
| 20 |
// |
| 21 |
// This program is distributed in the hope that it will be useful, |
| 22 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 23 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 24 |
// GNU General Public License for more details. |
| 25 |
// |
| 26 |
// You should have received a copy of the GNU General Public License |
| 27 |
// along with this program; if not, write to the Free Software |
| 28 |
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 29 |
// |
| 30 |
// |
| 31 |
|
| 32 |
header("Content-Type: text/xml; charset=utf-8"); |
| 33 |
|
| 34 |
require_once('includes/config.php'); |
| 35 |
|
| 36 |
$objUpdate = $db -> SelectLimit("SELECT * FROM updates WHERE lang='pl' ORDER BY id DESC", 5); |
| 37 |
$strNews = ''; |
| 38 |
while (!$objUpdate -> EOF) |
| 39 |
{ |
| 40 |
$arrTime = explode("-", $objUpdate -> fields['time']); |
| 41 |
$strTime = mktime(0, 0, 0, $arrTime[1], $arrTime[2], $arrTime[0]); |
| 42 |
$strText = htmlspecialchars($objUpdate -> fields['updates']); |
| 43 |
$strNews = $strNews."<item>\n<title>".$objUpdate -> fields['title']."</title>\n<dc:creator>".$objUpdate -> fields['starter']."</dc:creator>\n"."<description>".$strText."</description>\n<pubDate>".date("r", $strTime)."</pubDate>\n</item>\n"; |
| 44 |
$objUpdate -> MoveNext(); |
| 45 |
} |
| 46 |
$objUpdate -> Close(); |
| 47 |
|
| 48 |
// start the RSS output |
| 49 |
print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n"; |
| 50 |
print "<rss version=\"2.0\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">"; |
| 51 |
print "<channel>\n"; |
| 52 |
print "<title>".$gamename."</title>\n"; |
| 53 |
print "<link>".$gameadress."</link>\n"; |
| 54 |
print "<description>Najnowsze wieści z ".$gamename."</description>\n"; |
| 55 |
print "<language>pl</language>\n"; |
| 56 |
print "<webMaster>".$adminmail."</webMaster>\n"; |
| 57 |
print "<copyright>2004,2005,2006 Vallheru Team. Released under GNU/GPL license</copyright>\n"; |
| 58 |
print "<pubDate>".date("r")."</pubDate>"; |
| 59 |
print $strNews; |
| 60 |
print "</channel>\n"; |
| 61 |
print "</rss>\n"; |
| 62 |
|
| 63 |
?> |