aboutsummaryrefslogtreecommitdiff
path: root/views/default/widgets/feed_reader/view.php
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2009-01-18 19:50:11 +0000
committercash <cash.costello@gmail.com>2009-01-18 19:50:11 +0000
commitf343959dc964caa05d4763aabe230bb790f62757 (patch)
tree7d4994ce1ff0127749a151f5b620c619918260e8 /views/default/widgets/feed_reader/view.php
downloadelgg-f343959dc964caa05d4763aabe230bb790f62757.tar.gz
elgg-f343959dc964caa05d4763aabe230bb790f62757.tar.bz2
Diffstat (limited to 'views/default/widgets/feed_reader/view.php')
-rw-r--r--views/default/widgets/feed_reader/view.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/views/default/widgets/feed_reader/view.php b/views/default/widgets/feed_reader/view.php
new file mode 100644
index 000000000..6635ecf88
--- /dev/null
+++ b/views/default/widgets/feed_reader/view.php
@@ -0,0 +1,31 @@
+<?php
+
+ $feed_url = $vars['entity']->feed_url;
+ if($feed_url){
+
+ $feed = new SimplePie($feed_url);
+ $feed->handle_content_type();
+
+
+?>
+<h1><a href="<?php echo $feed->get_permalink(); ?>"><?php echo $feed->get_title(); ?></a></h1>
+ <?php
+ /*
+ Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
+ */
+ foreach ($feed->get_items() as $item):
+ ?>
+
+ <div class="item">
+ <h2><a href="<?php echo $item->get_permalink(); ?>"><?php echo $item->get_title(); ?></a></h2>
+ <p><?php echo $item->get_description(); ?></p>
+ <p><small>Posted on <?php echo $item->get_date('j F Y | g:i a'); ?></small></p>
+ </div>
+
+ <?php endforeach; ?>
+<?php
+ } else {
+
+ echo '<p>' . elgg_echo('simplepie:notset') . '</p>';
+ }
+?>