added funcionality to get news and forum posts from RSS-feeds

This commit is contained in:
Nils Bohrs
2012-09-26 22:21:15 +02:00
parent b2022b9cf3
commit f6d0f92d58
4 changed files with 107 additions and 5 deletions

View File

@@ -33,9 +33,16 @@
}
else
{
$url = $opt['news']['include'];
$url = str_replace('{style}', $opt['template']['style'], $url);
$newscontent = read_file($url, $opt['news']['maxsize']);
/*
* changed by bohrsty to fix error in displaying news from blog
* requires $opt['news']['count'] in settings for number of blog-items
* $opt['news']['include'] needs to be the RSS-URL of the blog
*
$url = $opt['news']['include'];
$url = str_replace('{style}', $opt['template']['style'], $url);
$newscontent = read_file($url, $opt['news']['maxsize']);
*/
$newscontent = RSSParser::parse($opt['news']['count'],$opt['news']['include']);
$tpl->assign('news', $newscontent);
$tpl->assign('extern_news', true);
@@ -46,6 +53,15 @@
require_once($opt['rootpath'] . 'cache2/phpbb.inc.php');
else
*/
/*
* changed by bohrsty to add lastest forum-entries using RSS-feed
* requires $opt['forum']['count'] in settings for number of lastest forum-posts
* requires $opt['forum']['url'] in settings: RSS-feed-URL of the forum
*/
$forumcontent = RSSParser::parse($opt['forum']['count'],$opt['forum']['url']);
$tpl->assign('forum',$forumcontent);
$phpbb_topics = array();
$tpl->assign('phpbb_topics', $phpbb_topics);
$tpl->assign('phpbb_enabled', ($opt['cron']['phpbbtopics']['url'] != ''));