alert(\'The post must contain at least one character\');';
}
/*
+----------------------------------------------------------------------------------------
| If a character has been specified, insert into the MySQL table
+----------------------------------------------------------------------------------------
*/
else
{
//mysql_query("INSERT INTO $tblname (Post, Owner, Posted_On, ParentID, Topic) VALUES ('$message','$username','$time','$id','$thread_topic') ");
//mysql_query("UPDATE $tblname SET Replies=Replies+'1' WHERE `ParentID`='$id'");
//mysql_query("UPDATE $tblname SET `Last_replied_to` =Last_replied_to+'1' WHERE `ID`=1 LIMIT 1");
}
}
/*
+----------------------------------------------------------------------------------------
| Display the "thread form"
+----------------------------------------------------------------------------------------
*/
echo '
';
echo '
Viewing thread
';
/*
+----------------------------------------------------------------------------------------
| Generate the variable for the table name
| Execute the MySQL query
+----------------------------------------------------------------------------------------
*/
$tblname = 'forum_threads';
$result = mysql_query("SELECT * FROM `".$tblname."` WHERE `ParentID`='$id'"); // Change to only the fields you need
/*
+----------------------------------------------------------------------------------------
| Display the posts that have been made on the thread
| No need for a row = 0 and there will always be a post
+----------------------------------------------------------------------------------------
*/
while( $thread_r=@mysql_fetch_array($result) ) // Supress errors
{
/*
+----------------------------------------------------------------------------------------
| Set all the variables that are returned from the query
+----------------------------------------------------------------------------------------
*/
$thread_id = $thread_r['ParentID'];
if ($thread_r['Topic'] != 0)
{
$thread_topic = $thread_r['Topic'];
}
$thread_post = $thread_r['Post'];
$thread_owner = $thread_r['Owner'];
$thread_time = $thread_r['Posted_On'];
if (auth() == 0) {
$auth = 'Edit - Remove';
}
else {
$auth = 'No Options';
}
?>
';
echo '
';
echo '
Reply to thread
'; ?>