" . "You must be logged in to post. Please Log in before posting a message." . ""; } elseif ($edit_mode and $_SESSION['user_id'] != $authorid) { echo "
" . "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 " . $row['subject'] . "\n"; $subject = ($re == ""?"":"Re: " . $re); } else { $topicname = "Reply"; $topicid = 0; } } } if ($forumid == "" or $forumid == 0) $forumid=1; $sql = "SELECT forum_name FROM forum_forum WHERE id = '"; $sql .= $forumid . "'"; $result = mysql_query($sql,$conn) or die('Could not retrieve forum name; ' . mysql_error()); $row = mysql_fetch_array($result); $forumname = $row['forum_name']; ?>

Subject:

Body:

\n"; } else { echo '\n"; } ?>

\n"; echo "\n"; echo "\n"; echo "\n"; echo "
\n"; } require_once 'footer.php'; ?>