changed news view on start page to headlines-only

This commit is contained in:
following
2013-04-10 21:20:27 +02:00
parent ef9759a414
commit d45409bf0b
3 changed files with 23 additions and 8 deletions

View File

@@ -52,7 +52,7 @@
$url = str_replace('{style}', $opt['template']['style'], $url);
$newscontent = read_file($url, $opt['news']['maxsize']);
*/
$newscontent = RSSParser::parse($opt['news']['count'],$opt['news']['include']);
$newscontent = RSSParser::parse($opt['news']['count'],$opt['news']['include'], false);
$tpl->assign('news', $newscontent);
$tpl->assign('extern_news', true);
@@ -72,7 +72,7 @@
* 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']);
$forumcontent = RSSParser::parse($opt['forum']['count'], $opt['forum']['url'], false);
$tpl->assign('forum',$forumcontent);
}
else

View File

@@ -10,7 +10,7 @@ class RSSParser {
* @param string $url url of the feed to parse
* @return string $item feeditems as HTML-string
*/
public static function parse($items,$url) {
public static function parse($items,$url,$includetext) {
global $translate;
if ($items <= 0)
@@ -27,6 +27,8 @@ class RSSParser {
// output
$html = '<div class="buffer" style="width: 500px;height: 2px;">&nbsp;</div>'."\n";
$html .= '<div class="newsblock">';
if (!$includetext)
$html .= "<table class='narrowtable' style='margin-top:0'>\n";
// get xml-data
$data = @file_get_contents($url);
@@ -52,10 +54,20 @@ class RSSParser {
} else {
// add html
$html .= '<p class="content-title-noshade-size15" style="display: inline;">'."\n";
$html .= strftime('%e. %B %Y',strtotime($item->pubDate)).' - '. $item->title;
$html .= '</p> <p style="line-height: 1.6em;display: inline;">&emsp;[<b><a class="link" href="'.$item->link.'">mehr...</a></b>]</p>'."\n";
$html .= '<div class="rsstext">'.$item->description.'</div>'."\n";
if ($includetext)
{
$html .= '<p class="content-title-noshade-size15" style="display: inline;">'."\n";
$html .= strftime('%e. %B %Y',strtotime($item->pubDate)).' - '. $item->title;
$html .= '</p> <p style="line-height: 1.6em;display: inline;">&emsp;[<b><a class="link" href="'.$item->link.'">mehr...</a></b>]</p>'."\n";
$html .= '<div class="rsstext">'.$item->description.'</div>'."\n";
}
else
{
$html .= '<tr><td style="text-align:right">' . strftime('%e. %B %Y',strtotime($item->pubDate)).'</td>';
$html .= '<td><a class="links" href="'.$item->link.'">';
$html .= $item->title;
$html .= '</td></tr>';
}
}
// increment counter
@@ -63,6 +75,8 @@ class RSSParser {
}
// finish html
if (!$includetext)
$html .= "</table>";
$html .= "</div>";
$html .= '<div class="buffer" style="width: 500px;">&nbsp;</div>'."\n";
}

View File

@@ -1399,8 +1399,9 @@ div#havefound {
}
/* RSS feeds */
#blog div.newsblock { margin-left:00px }
#blog div.newsblock { margin-left:20px }
#forum div.newsblock { margin-left:20px }
#blog div.rsstext {margin: 0px 30px 0.5em 0; padding: 0px; line-height: 1.3em; font-family: arial, sans serif; font-size: 12px; }
.quoteheader, .topslice_quote, .bbc_standard_quote { display:none; }
#forum div.rsstext {margin: 0px 30px 0.5em 0px; padding: 0px; line-height: 1.3em; font-family: arial, sans serif; font-size: 12px; }