This repository has been archived on 2020-06-13. You can view files and clone it, but cannot push or open issues/pull-requests.
penguincoder.org-horde/rss.php

34 lines
1.2 KiB
PHP
Raw Permalink Normal View History

2020-02-18 10:47:46 -05:00
<?php
@define('PENGUINCODER_BASE', dirname(__FILE__));
require PENGUINCODER_BASE . '/lib/base.php';
require_once 'Horde/Template.php';
$template = &new Horde_Template();
global $pdata;
$entries = $pdata->getNewestJournals();
if (is_a($entries, 'PEAR_Error')) {
exit("There was a problem fetching the entries: " . $entries->getMessage());
}
$template->set('charset', NLS::getCharset());
$template->set('channel_name', _("Penguin Coder"), NLS::getCharset());
$template->set('channel_desc', _("The ramblings of a computer geek..."),
NLS::getCharset());
$template->set('channel_updated', @htmlspecialchars(date('r',
($entries[0]['time_modified'] > 0 ? $entries[0]['time_modified'] :
$entries[0]['time_created']))), NLS::getCharset());
$template->set('channel_url', Horde::applicationUrl('index.php', true));
$baseUrl = Util::addParameter(Horde::applicationUrl('journal.php', true),
'actionId', 'show');
foreach ($entries as $key => $entry) {
$entries[$key]['link'] = Util::addParameter($baseUrl, 'id', $entry['id']);
}
$template->set('entries', $entries);
header('Content-Type: text/xml');
echo $template->fetch(PENGUINCODER_TEMPLATES . '/journal/rss.xml');