forked from kvirc/kvirc-www
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rss.php
42 lines (38 loc) · 1.18 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
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>KVIrc News</title>
<link>http://www.kvirc.net</link>
<description>The K-visual IRC client</description>
<language>en</language>
<?php
require('conf/functions.php');
function cleanText($intext)
{
return utf8_encode(htmlspecialchars(stripslashes($intext)));
}
$latestnews = array();
news_scan_dir('news/latest', $latestnews);
$cnt = count($latestnews);
for($i = 0; $i < $cnt; $i++):
// Get data
$x['dummy'] = '';
news_read_entry($latestnews[$i], $x);
// Set variables
$title = substr(cleanText($x['title']), 1);
$description = substr(cleanText($x['short']), 1);
$author = substr(cleanText($x['author']), 1);
$news = basename($latestnews[$i]);
$guid = "http://www.kvirc.net/?id=news&story=$news&dir=latest&lang=$lang";
$pubDate = date('r', mktime($x['hour'], $x['minute'], 0, $x['month'], $x['day'], $x['year']));
?>
<item>
<title><?=$title?></title>
<guid><?=$guid?></guid>
<author><?=$author?></author>
<description><?=$description?></description>
<pubDate><?=$pubDate?></pubDate>
</item>
<?php endfor; ?>
</channel>
</rss>