From 2c494ce0492c9b0b38c3fc989105ad7bac9c8580 Mon Sep 17 00:00:00 2001 From: Pascal Chevrel Date: Sat, 5 May 2012 22:39:34 +0200 Subject: Issue 42: create atom.php at root, delete old 'atom10' template, update all internal links to point to the new location, put a redirect in place so as that moonmoon installs don't loose their users upon upgrading to a newer moonmoon --- atom.php | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 atom.php (limited to 'atom.php') diff --git a/atom.php b/atom.php new file mode 100644 index 0000000..035d049 --- /dev/null +++ b/atom.php @@ -0,0 +1,66 @@ +' . _g('You might want to install moonmoon.') . '

'; + exit; +} + +//Load from cache +$items = Array(); +if (0 < $Planet->loadOpml(dirname(__FILE__).'/custom/people.opml')) { + $Planet->loadFeeds(); + $items = $Planet->getItems(); +} + +//Prepare output cache +Cache::$enabled = false; +$cache_key = (count($items)) ? $items[0]->get_id() : ''; +$last_modified = (count($items)) ? $items[0]->get_date() : ''; +$cache_duration = $PlanetConfig->getOutputTimeout()*60; + +Cache::setStore(dirname(__FILE__) . '/' . $conf['cachedir'] . '/'); +//Go display +if (!isset($_GET['type']) || + !is_file(dirname(__FILE__).'/custom/views/'.$_GET['type'].'/index.tpl.php') || + strpos($_GET['type'], DIRECTORY_SEPARATOR)){ + $_GET['type'] = 'default'; +} + +if (!OutputCache::Start($_GET['type'], $cache_key, $cache_duration)) { + include_once(dirname(__FILE__).'/custom/views/'.$_GET['type'].'/index.tpl.php'); + OutputCache::End(); +} + +var_dump($PlanetConfig, $Planet); +$limit = $PlanetConfig->getMaxDisplay(); +$count = 0; + +header('Content-Type: application/atom+xml; charset=UTF-8'); +echo ''; +?> + <?php echo htmlspecialchars($PlanetConfig->getName()); ?> + getName()); ?> + getUrl(); ?> + + + + Author + + + + + <?php echo htmlspecialchars($item->get_feed()->getName()); ?> : <?php echo htmlspecialchars($item->get_title());?> + get_permalink());?> + + get_date('Y-m-d\\TH:i:s+00:00'); ?> + get_date('Y-m-d\\TH:i:s+00:00'); ?> + get_author()? $item->get_author()->get_name() : 'anonymous'); ?> + + get_content();?>]]> + + + + -- cgit v1.2.1