minor changes to new rss-inclusion

This commit is contained in:
Oliver 2012-10-07 22:16:45 +02:00
parent b0ce657556
commit 557f3f7b9c
3 changed files with 27 additions and 8 deletions

View File

@ -386,6 +386,7 @@
* You can use '{style}' as placeholder for the current style-name
*/
$opt['news']['include'] = '';
$opt['news']['count'] = 3;
// redirect news.php to the following url
$opt['news']['redirect'] = '';
@ -399,6 +400,13 @@
// show news block in start page
$opt['news']['onstart'] = true;
/* current forum topcis on start page
* requires url to be a vaild rss feed
* -> show the number of 'count' topics from rss feed
*/
$opt['forum']['url'] = '';
$opt['forum']['count'] = 5;
/* 3rd party library options
*/

View File

@ -54,14 +54,22 @@
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
*/
$tpl->assign('phpbb_enabled', $opt['forum']['count'] > 0);
$forumcontent = RSSParser::parse($opt['forum']['count'],$opt['forum']['url']);
$tpl->assign('forum',$forumcontent);
if ($opt['forum']['url'] != '')
{
/*
* 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
*/
$tpl->assign('phpbb_enabled', true);
$forumcontent = RSSParser::parse($opt['forum']['count'], $opt['forum']['url']);
$tpl->assign('forum',$forumcontent);
}
else
{
$tpl->assign('phpbb_enabled', false);
$tpl->assign('forum', '');
}
$phpbb_topics = array();
$tpl->assign('phpbb_topics', $phpbb_topics);

View File

@ -12,6 +12,9 @@ class RSSParser {
*/
public static function parse($items,$url) {
if ($items <= 0)
return '';
// error
$error = false;