" .
"You are not authorized to edit this post. Please contact " .
"your administrator.
";
} else {
if ($edit_mode) {
$sql = "SELECT * FROM forum_posts p, forum_forum f " .
"WHERE p.id = " . $_GET['post'].
" AND p.forum_id = f.id";
$result = mysql_query($sql,$conn)
or die('Could not retrieve post data; ' . mysql_error());
$row = mysql_fetch_array($result);
$subject = $row['subject'];
$topicid = $row['topic_id'];
$forumid = $row['forum_id'];
$body = $row['body'];
$post = $_GET['post'];
$authorid = $row['author_id'];
} else {
if ($topicid == "") {
$topicid = 0;
$topicname = "New Topic";
} else {
if ($reid != "") {
$sql = "SELECT subject FROM forum_posts WHERE id = " . $reid;
$result = mysql_query($sql,$conn)
or die('Could not retrieve topic; ' . mysql_error());
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$re = preg_replace("/(re: )/i","",$row['subject']);
}
}
$sql = "SELECT subject FROM forum_posts WHERE id = ";
$sql .= $topicid . " AND topic_id = 0 AND forum_id = $forumid;";
$result = mysql_query($sql,$conn)
or die('Could not retrieve topic; ' . mysql_error());
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_array($result);
$topicname = "Reply to \n";
}
require_once 'footer.php';
?>