// ########################################################################
// # load the config file used in dotlan #
// ########################################################################
// Kein UserOnline Liveupdate
define("NO_SESSION_DB",TRUE);
include_once("../global.php");
// ########################################################################
// # load the main classes/files used in dotlan #
// ########################################################################
include_once($global['include_path']."class.rss.php");
include_once($global['include_path']."class.cbox.php");
include_once($global['include_path']."class.forum.php");
$RSS = new write_rss;
$CBOX = new cbox;
$FORUM = new forum;
// ########################################################################
// # prepare NWS and RSS Feed #
// ########################################################################
$title = $global['sitename'].$global['sitename_delimiter']._("Forum");
$link = $FORUM->link['index'];
$description = "Latest Threads";
if($_GET['do'] == "board" || $_GET['do'] == "forum") {
$forum_array = $CBOX->forum_load_threads("board",$_GET['id']);
$title .= " > ".$DB->query_one("SELECT title FROM forum_main WHERE forumid=".intval($_GET['id']));
$link = sprintf($FORUM->link['forum'],intval($_GET['id']));
} elseif($_GET['do'] == "category") {
$forum_array = $CBOX->forum_load_threads("category",$_GET['id']);
$title .= " > ".$DB->query_one("SELECT title FROM forum_cat WHERE catid=".intval($_GET['id']));
$link = sprintf($FORUM->link['category'],intval($_GET['id']));
} else $forum_array = $CBOX->forum_load_threads();
// function channel_add($title,$link,$description="") {
$CHANNEL =& $RSS->channel_add($title,$link,$description);
// ########################################################################
// # add news postings to rss feed #
// ########################################################################
$shown = 0;
foreach($forum_array AS $data) {
if($shown < $global['forum']['max_threads_rss']) {
if($data['private'] == 0)
$access = 1;
elseif($data['private'] == 2 && is_object($ADMIN) && $ADMIN->team_forum)
$access = 1;
else $access = $CBOX->forum_check_access($data['priv_access']);
if($access == 1) {
$pre_title = "";
if($data['private'] != 0) $pre_title .= "["._("Intern")."] ";
if($data['fv_id'] != 0) $pre_title .= _("Umfrage").": ";
if($data['ext'] == "news") $pre_title .= _("News").": ";
if($data['ext'] == "artikel") $pre_title .= _("Artikel").": ";
if($data['ext'] == "turnier") $pre_title .= _("Turnier").": ";
if($data['ext'] == "gallery") $pre_title .= _("Bild").": ";
if($data['ext'] == "media") $pre_title .= _("Download").": ";
$title = $HTML->unxmlentities(strtoupper($pre_title)).$data['title'];
if($data['forumtitle'] && !($_GET['do'] == "board" || $_GET['do'] == "forum"))
$title = $data['forumtitle']." > ".$title;
$link = $S->link(sprintf($CBOX->link['forum_thread'],$data['threadid']));
$category = $data['forumtitle'];
$description = preg_replace("/\[.+]/","",$data['preview'])."
";
$description .= $HTML->unxmlentities(_("Beiträge")).": ".intval($data['replies'])."
";
$author = $data['lastposter'];
//$description = trim(str_replace("\n","",str_replace("\r","",str_replace("\t","",$data['htmlshort']))));
$pubDate = $data['lastposttime'];
// function item_add($title,$link,$description=FALSE,$pubDate=FALSE,$category=FALSE,$author=FALSE)
$CHANNEL->item_add($title,$link,$description,$pubDate,$category,$author);
$shown++;
}
}
}
// ########################################################################
// # start output off rss feed #
// ########################################################################
$RSS->render();
?>