$zid); if (!isset($_POST['zeitung'])) { $ret .= information('Sie beginnen eine neue Diskussion im Forum.'); } else { $replace['topic'] = htmlspecialchars($_POST['topic']); $replace['body'] = string_sanitise($_POST['body']); if (strlen($_POST['topic'])) { if (strlen($_POST['body'])) { if (($tid = topic_add($zid, $replace['topic'], $replace['body'])) !== false) { header(sprintf('Location: %stopic/%d.html', $cfg['home'], $tid)); } else $ret .= warning('Es ist ein Datenbankfehler aufgetreten.'); } else $ret .= warning('Sie haben keinen Text für die Diskussion angegeben!'); } else $ret .= warning('Sie haben keinen Titel für die Diskussion angegeben!'); } $ret .= load_javascript('topic.js') . load_template('topic.html', $replace); } } return $ret; } // Sideeffect: May set $zlist['redirect'] function process_reply() { global $cfg; global $zlist; global $_GET; global $_POST; if (isset($_GET['topic']) && is_numeric($_GET['topic'])) $topic = $_GET['topic']; elseif (isset($_POST['topic']) && is_numeric($_POST['topic'])) $topic = $_POST['topic']; else $ret = warning('Keine passende Diskussion gefunden!'); if (isset($topic)) { $discussion = format_topic($topic); if (isset($zlist['zid'])) { $ret .= format_newspaper($zlist['zid'], true); if (isset($_POST['body'])) { if (article_add($topic, string_sanitise($_POST['body'])) === true) { $ret .= information('Danke für Ihren Beitrag. Sie werden automatisch zur Diskussion weitergeleitet.'); header(sprintf('Location: %stopic/%d.html', $cfg['home'], $topic)); } else { $ret .= warning('Ihr Beitrag konnte nicht aufgenommen werden.'); $ret .= $discussion; $replace = array('topic' => $topic, 'title' => $zlist['topic'], 'body' => htmlspecialchars($_POST['body'])); $ret .= load_javascript('reply.js') . load_template('reply.html', $replace); } } else { $ret .= $discussion; $replace = array('topic' => $topic, 'title' => $zlist['topic']); $ret .= load_javascript('reply.js') . load_template('reply.html', $replace); } } else $ret .= $discussion; } return $ret; } ?>