Skip to content
Permalink
Browse files

changed news view on start page to headlines-only

  • Loading branch information...
following
following committed Apr 10, 2013
1 parent ef9759a commit d45409bf0ba4345f11397043bea32d129bfb2284
Showing with 23 additions and 8 deletions.
  1. +2 −2 htdocs/index.php
  2. +19 −5 htdocs/lib2/RSSParser.class.php
  3. +2 −1 htdocs/resource2/ocstyle/css/style_screen.css
@@ -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
@@ -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 @@ public static function parse($items,$url) {
// 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,17 +54,29 @@ public static function parse($items,$url) {
} 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
$i++;
}
// finish html
if (!$includetext)
$html .= "</table>";
$html .= "</div>";
$html .= '<div class="buffer" style="width: 500px;">&nbsp;</div>'."\n";
}
@@ -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; }

0 comments on commit d45409b

Please sign in to comment.
You can’t perform that action at this time.