-
Notifications
You must be signed in to change notification settings - Fork 6
/
rss.php
43 lines (39 loc) · 1.22 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
<?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><?php echo $title; ?></title>
<guid><?php echo $guid; ?></guid>
<author><?php echo $author; ?></author>
<description><?php echo $description; ?></description>
<pubDate><?php echo $pubDate; ?></pubDate>
</item><?php
}
?>
</channel>
</rss>