Merge branch 'stable'

This commit is contained in:
following
2013-04-10 21:22:52 +02:00
4 changed files with 34 additions and 11 deletions
+2 -2
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('newsfeed', $opt['news']['include']);
@@ -73,7 +73,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
+19 -5
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";
}
@@ -1415,8 +1415,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; }
+11 -3
View File
@@ -94,11 +94,15 @@
exit;
}
// aufräumen ... 24h nach letztem Abruf
// cleanup ... 24h after last call
$cleanerdate = date($sDateformat, time() - 86400);
$rs = sql("SELECT `id` FROM `xmlsession` WHERE `last_use`<'&1' AND `cleaned`=0", $cleanerdate);
while ($r = sql_fetch_array($rs))
{
// This loop can be started simultaneously by multiple synchronous XML
// requests, which both try to delete entries, files and directories.
// Therefore errors must be gracefully ignored.
// xmlsession_data löschen
sql('DELETE FROM `xmlsession_data` WHERE `session_id`=&1', $r['id']);
@@ -1052,6 +1056,10 @@ function user_id2uuid($id)
function unlinkrecursiv($path)
{
// This loop can be started simultaneously by multiple synchronous XML
// requests, which both try to delete entries, files and directories.
// Therefore errors must be gracefully ignored.
if (mb_substr($path, -1) != '/') $path .= '/';
$notunlinked = 0;
@@ -1076,7 +1084,7 @@ function unlinkrecursiv($path)
(mb_substr($file, -3) == '.gz') ||
(mb_substr($file, -4) == '.bz2') ||
(mb_substr($file, -4) == '.xml'))
unlink($path . $file);
@unlink($path . $file);
else
$notunlinked++;
}
@@ -1087,7 +1095,7 @@ function unlinkrecursiv($path)
if ($notunlinked == 0)
{
rmdir($path);
@rmdir($path);
return true;
}
else