-
Notifications
You must be signed in to change notification settings - Fork 5
/
rssincoming.php
98 lines (82 loc) · 3.18 KB
/
rssincoming.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of Nevertable .
# Copyright (c) 2004 Francois Guillet and contributors. All rights
# reserved.
#
# Nevertable is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Nevertable is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Nevertable; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# ***** END LICENSE BLOCK *****
define('ROOT_PATH', "./");
define('NVRTBL', 1);
define('NVRTBL_PATH', "http://www.nevercorner.net/table/");
define('LEVEL', 30);
include_once ROOT_PATH ."config.inc.php";
include_once ROOT_PATH ."includes/common.php";
include_once ROOT_PATH ."includes/classes.php";
$table = new Nvrtbl();
$ts = $table->GetEarlierDate();
$items = $seq = '';
$Records = $table->GetLastRecords(LEVEL, "incoming");
if (!empty($Records))
{
for ($i=0; $i<$Records['total']; $i++)
{
$URL = NVRTBL_PATH . "index.php?link=".$Records[$i]['id'];
$seq .= "<rdf:li rdf:resource=\"".$URL."\" />\n";
$content = "That's a ".$Records[$i]['type']." on ".$Records[$i]['level']." ~ time: ".$Records[$i]['time']." ~ coins: ".$Records[$i]['coins'];
$itemappend =
"<item rdf:about=\"".$URL."\">\n".
" <title>".$Records[$i]['title']."</title>\n".
" <link>".$URL."</link>\n".
" <dc:date>".$Records[$i]['date']."</dc:date>\n".
" <dc:creator>".$Records[$i]['pseudo']."</dc:creator>\n".
" <dc:subject>".$Records[$i]['title']."</dc:subject>\n".
" <content:encoded><![CDATA[".$content."]]></content:encoded>\n".
"</item>\n";
$items .= $itemappend;
}
}
$table->Close();
header('Content-Type: text/xml; charset=iso-8859-1');
echo '<?xml version="1.0" encoding="iso-8859-1" ?>'."\n";
?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:admin="http://webns.net/mvcb/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns="http://purl.org/rss/1.0/">
<channel rdf:about="http://www.nevercorner.net/table/">
<title>Nevertable - Neverball Hall of Fame RSS feed - incoming</title>
<description>List of incoming record in the table for (moderators)</description>
<link>http://www.nevercorner.net/table/</link>
<dc:language>fr</dc:language>
<dc:creator></dc:creator>
<dc:rights></dc:rights>
<dc:date><?php echo getIsoDate($ts); ?></dc:date>
<admin:generatorAgent rdf:resource="http://www.nevercorner.net/table/" />
<sy:updatePeriod>daily</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase><?php echo getIsoDate($ts); ?></sy:updateBase>
<items>
<rdf:Seq>
<?php echo $seq; ?>
</rdf:Seq>
</items>
</channel>
<?php echo $items; ?>
</rdf:RDF>