' . elgg_echo('simplepie:notfind') . '
';
- }
+if (!class_exists('SimplePie')) {
+ require_once $CONFIG->pluginspath . '/simplepie/simplepie.inc';
+}
+
+$allow_tags = '
- ';
+$feed_url = $vars['entity']->feed_url;
+if ($feed_url) {
+
+ // get widget settings
+ $excerpt = $vars['entity']->excerpt;
+ $num_items = $vars['entity']->num_items;
+ $post_date = $vars['entity']->post_date;
+
+ $cache_loc = $CONFIG->pluginspath . '/simplepie/cache';
+
+ $feed = new SimplePie($feed_url, $cache_loc);
+
+ // doubles timeout if going through a proxy
+ //$feed->set_timeout(20);
+
+ $num_posts_in_feed = $feed->get_item_quantity();
+
+ // only display errors to profile owner
+ if (get_loggedin_userid() == page_owner()) {
+ if (!$num_posts_in_feed) {
+ echo '
' . elgg_echo('simplepie:notfind') . '
';
+ }
+ }
?>
-
+
$num_posts_in_feed)
- $num_items = $num_posts_in_feed;
-
- foreach ($feed->get_items(0,$num_items) as $item):
-?>
-
-
-
- ' . strip_tags($item->get_description(true),$blog_tags) . '
';
- }
+ // don't display more feed items than user requested
+ if ($num_items > $num_posts_in_feed) {
+ $num_items = $num_posts_in_feed;
+ }
- if ($post_date)
- {
- ?>
- Posted on get_date('j F Y | g:i a'); ?>
-
+ foreach ($feed->get_items(0, $num_items) as $item):
+?>
+
+
-
+' . strip_tags($item->get_description(true), $allow_tags) . '
';
+ }
+
+ if ($post_date) {
+?>
+ Posted on get_date('j F Y | g:i a'); ?>
+
+