PluginProbe
Redirection / 2.2.12
Redirection v2.2.12
5.10.0 5.9.0 5.8.1 5.8.0 3.7.2 3.7.3 4.0 4.0.1 4.1 4.1.1 4.2 4.2.1 4.2.2 4.2.3 4.3 4.3.1 4.3.2 4.3.3 4.4 4.4.1 4.4.2 4.5 4.5.1 4.6.2 4.7.1 All 130 releases
redirection / fileio / rss.php

rss.php in Redirection 2.2.12, at fileio/rss.php

55 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 class Red_Rss_File extends Red_FileIO
4 {
5 var $title;
6
7 function collect ($module)
8 {
9 $pager = new RE_Pager ($_GET, admin_url( 'redirection.php' ), 'created', 'DESC', 'log');
10 $pager->per_page = 100;
11
12 $this->name = $module->name;
13 $this->items = RE_Log::get_by_module ($pager, $module->id);
14 }
15
16 function feed ()
17 {
18 $title = sprintf ('%s log', $this->name);
19
20 header ('Content-type: text/xml; charset='.get_option ('blog_charset'), true);
21 echo '<?xml version="1.0" encoding="'.get_option ('blog_charset').'"?'.">\r\n";
22 ?>
23 <rss version="2.0"
24 xmlns:content="http://purl.org/rss/1.0/modules/content/"
25 xmlns:wfw="http://wellformedweb.org/CommentAPI/"
26 xmlns:dc="http://purl.org/dc/elements/1.1/">
27 <channel>
28 <title><?php echo $title.' - '; bloginfo_rss ('name'); ?></title>
29 <link><?php bloginfo_rss('url') ?></link>
30 <description><?php bloginfo_rss("description") ?></description>
31 <pubDate><?php echo htmlspecialchars (mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false)); ?></pubDate>
32 <generator><?php echo htmlspecialchars ('http://wordpress.org/?v='); bloginfo_rss ('version'); ?></generator>
33 <language><?php echo get_option ('rss_language'); ?></language>
34 <?php
35 if (count ($this->items) > 0)
36 {
37 foreach ($this->items as $log) : ?>
38 <item>
39 <title><![CDATA[<?php echo $log->url; ?>]]></title>
40 <link><![CDATA[<?php bloginfo ('home'); echo $log->url; ?>]]></link>
41 <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', $log->created_at, false); ?></pubDate>
42 <guid isPermaLink="false"><?php print($log->id); ?></guid>
43 <description><![CDATA[<?php echo $log->url; ?>]]></description>
44 <content:encoded><![CDATA[<?php if ($log->referrer) echo 'Referred by '.$log->referrer; ?>]]></content:encoded>
45 </item>
46 <?php endforeach; } ?>
47 </channel>
48 </rss>
49 <?php
50 die();
51 }
52 }
53
54 ?>
55