| 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 |
|