require_once ("download.inc.php");
$list = new Liste (array ('name' => "updates", 'parent' => $tpl_content, 'max' => 1));
$version = $list[0]['path'] ? $list[0]['path'] : $version;
$kind = isset ($_COOKIE['kind'][$tpl_content->id]) ? $_COOKIE['kind'][$tpl_content->id] : "updates";
$length = $list[0]['length'] ? $list[0]['length'] : 10;
if ($version && $kind=="updates") {
$download = new Download ($version);
if ($list->editMode) {
$paths = "";
foreach ($download->getVersions () as $dir) {
$paths .= "$dir <$dir>\n";
}
$list[0]->setPreferences ("path", "selections", $paths);
}
$items = array ();
foreach ($download->get ($length) as $file) {
if ($file['hisfile']) {
$history = file ($file['hisfile']);
$history_date = preg_replace("/.*(\d\d\d\d-\d\d-\d\d).*/", "\\1", $history[0]);
$file_date = date("Y-m-d", $file['time']-60*60*24);
$file_version = preg_replace ("/.*_(.*_.*)/", "\\1", $file['version']);
$items[] = array (
'title' => $file['name'],
'description' => ($file_date > $history_date ? "Update of source package" : $history[1]) . " ($file_version)",
'date' => date ("j. M Y", $file['time']));
}
}
} else {
foreach (json_decode(file_get_contents("http://{$_SERVER['SERVER_NAME']}/forum/?action=.js&limit=$length"), true) as $post) {
$item = array (
'title' => $post['subject'] . ($post['new'] ? "" : ""),
'description' => "Forum: {$post['board']['name']} – Begonnen von: {$post['starter']['name']} – Antwort von: {$post['poster']['name']} »",
'date' => date ("j. M Y H:i", $post['timestamp']));
if ($kind=="long forum news") {
$item['description'] .= "
{$post['body']}";
}
$items[] = $item;
}
}
?>
if ($version) { ?>
=$item['description']?>