diff options
author | Alessandro Cosentino <cosenal@gmail.com> | 2012-05-08 19:23:00 -0400 |
---|---|---|
committer | Alessandro Cosentino <cosenal@gmail.com> | 2012-05-08 19:23:00 -0400 |
commit | 2ad605cb3a80546695b7d9cac3306a045f0bbae6 (patch) | |
tree | b461aab52c8d2d60089764fd656f7464b1969160 /templates/main.php | |
parent | bb29f28e99a499475258afec3008f9bd94e973d7 (diff) |
the OC_News_Item class now extends the SimplePie item class
Diffstat (limited to 'templates/main.php')
-rw-r--r-- | templates/main.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/templates/main.php b/templates/main.php index 986b46748..499483875 100644 --- a/templates/main.php +++ b/templates/main.php @@ -1,12 +1,13 @@ <?php -$feed = new SimplePie_Core(); +$feed = new SimplePie_Core(); +$feed->set_item_class('OC_News_Item'); $feed->set_feed_url( 'http://algorithmsforthekitchen.com/blog/?feed=rss2' ); $feed->enable_cache( false ); $feed->init(); $feed->handle_content_type(); -$item = new OC_News_Item($feed->get_item(1)); +$item = $feed->get_item(1); if ($item->isRead()) echo $l->t('Read'); @@ -17,10 +18,11 @@ $item->setRead(); $item->setUnread(); $item->setRead(); -echo "<br>"; +echo "<br>" . $item->get_title() . "<br>"; -if ($item->isRead()) +if ($item->isRead()) { echo $l->t('Read'); +} else echo $l->t('Unread'); |