Commit e8caebb0 authored by Antoine Beaupré's avatar Antoine Beaupré

add trivial code to display an RSS feed on the home page of users, feed can be...

add trivial code to display an RSS feed on the home page of users, feed can be changed in the variables panel
parent 2fc23618
......@@ -46,6 +46,25 @@ if ($mem->user["lastfail"]) {
$mem->resetlast();
# use MagpieRSS to syndicate content from another site if available
# this should work, since the debian package installs it in
# /usr/share/php, which is in the include path
if (include_once('magpierss/rss_fetch.inc')) {
$rss = fetch_rss( variable_get('rss_feed') );
if ($rss) {
echo "<h2>" . _("Latest news") . "</h2>";
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
echo "<h3><a href=$href>$title</a></h3>";
echo $item['summary'];
}
echo "</ul>";
}
}
if($admin->enabled) {
$expiring = $admin->renew_get_expiring_accounts();
......
......@@ -419,6 +419,9 @@ the domain "username.example.com".
If this is set to 0 or a "false" string, it will be ignored.');
INSERT IGNORE INTO `variable` (name, value, comment) VALUES ('rss_feed', 0,
'This is an RSS feed that will be displayed on the users homepages when
they log in. Set this to 0 or a "false" string to ignore.');
--
-- Table structure for table `dbusers`
--
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment