aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/default/settings/simplepie/edit.php15
-rw-r--r--views/default/widgets/feed_reader/edit.php4
-rw-r--r--views/default/widgets/feed_reader/view.php31
3 files changed, 50 insertions, 0 deletions
diff --git a/views/default/settings/simplepie/edit.php b/views/default/settings/simplepie/edit.php
new file mode 100644
index 000000000..ae6cbf9de
--- /dev/null
+++ b/views/default/settings/simplepie/edit.php
@@ -0,0 +1,15 @@
+<?php
+ global $CONFIG;
+
+ $compat_url = $CONFIG->wwwroot . 'mod/simplepie/sp_compatibility_test.php';
+ $permit_url = $CONFIG->wwwroot . 'mod/simplepie/permissions.php';
+
+?>
+
+<p>
+<a href="<?php echo $compat_url; ?>">Compatibility Test</a>
+</p>
+
+<p>
+<a href="<?php echo $permit_url; ?>">Permissions Test for Cache</a>
+</p>
diff --git a/views/default/widgets/feed_reader/edit.php b/views/default/widgets/feed_reader/edit.php
new file mode 100644
index 000000000..3b14dcc97
--- /dev/null
+++ b/views/default/widgets/feed_reader/edit.php
@@ -0,0 +1,4 @@
+ <p>
+ <?php echo elgg_echo("simplepie:feed_url"); ?>
+ <input type="text" name="params[feed_url]" value="<?php echo htmlentities($vars['entity']->feed_url); ?>" />
+ </p>
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>';
+ }
+?>