summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-05-10 15:43:56 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-05-10 15:43:56 -0400
commit14115e04e3f9dd6fe794810f9be403408fa81912 (patch)
tree798954ad3094aeaec7baa6eef84aa820579c0fe6 /templates
parentc29f6774ca657d8e8658fe8acb8365882dad710a (diff)
added a rudimantal feed class (+ trying to save on DB)
Diffstat (limited to 'templates')
-rw-r--r--templates/main.php29
1 files changed, 8 insertions, 21 deletions
diff --git a/templates/main.php b/templates/main.php
index 499483875..771d83b3e 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -1,18 +1,16 @@
<?php
-$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();
+$feed = new OC_News_Feed( 'http://algorithmsforthekitchen.com/blog/?feed=rss2' );
+$feed->saveToDB();
$item = $feed->get_item(1);
-if ($item->isRead())
+if ($item->isRead()) {
echo $l->t('Read');
-else
+}
+else {
echo $l->t('Unread');
+}
$item->setRead();
$item->setUnread();
@@ -23,17 +21,6 @@ echo "<br>" . $item->get_title() . "<br>";
if ($item->isRead()) {
echo $l->t('Read');
}
-else
+else {
echo $l->t('Unread');
-
-?>
-
-<?php /* this is from apptemplate
-
-<h1>This is an example app template</h1>
-
-<?php echo $l->t('Some Setting');?>
-:"
-<?php echo $_['somesetting']; ?>
-"
-*/ ?> \ No newline at end of file
+}