add trivial code to display an RSS feed on the home page of users, feed can be changed in the variables panel
This commit is contained in:
parent
2fc2361877
commit
e8caebb01f
|
@ -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`
|
||||
--
|
||||
|
|
Loading…
Reference in New Issue