-
Notifications
You must be signed in to change notification settings - Fork 4
/
\rss.php
54 lines (37 loc) · 1.31 KB
/
\rss.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
//GAMEURL, SERVERURL etc.
require_once ("currentRunningVersion.php");
require_once (GAMEPATH . "includes/db.inc.php");
header("Content-Type: application/rss+xml");
?>
<<?php ?>?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Syrnia news RSS feed</title>
<description>All news items from Syrnia, a free browserbased RPG game</description>
<link>http://www.syrnia.com</link>
<ttl>1440</ttl>
<?php
$resultaat = mysqli_query($mysqli, "SELECT ID, titel, date, mesage FROM news ORDER BY ID DESC LIMIT 10") or die('Error, query failed');
while ($record = mysqli_fetch_object($resultaat))
{
$ID=$record->ID;
$message=stripslashes($record->mesage);
$titel=stripslashes($record->titel);
$date=$record->date;
$message=str_replace("<br />", "", $message);
$message=str_replace("<br>", "", $message);
$message=htmlentities($message);
$unixTime = mktime(0, 0, 0, substr($date, 3, 2), substr($date, 0, 2), substr($date, 6, 4));
echo"<item>
<guid>".htmlentities("http://www.syrnia.com/index.php?page=news&ID=$ID")."</guid>
<title>".htmlentities($titel)."</title>
<description>".$message."</description>
<link>".htmlentities("http://www.syrnia.com/index.php?page=news&ID=$ID")."</link>
<pubDate>". date('r', $unixTime)."</pubDate>
</item>
";
}
?>
</channel>
</rss>