\n"; $count = 1; if (mysql_num_rows($query) == 0) { $page .= "\n"; } else { while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } else { $page .= "\n"; $count = 1; } } } $page .= "
New Thread
ThreadRepliesLast Post
No threads in forum.
".$row["title"]."".$row["replies"]."".$row["newpostdate"]."
".$row["title"]."".$row["replies"]."".$row["newpostdate"]."
"; display($page, "Forum"); } function showthread($id, $start) { $query = doquery("SELECT * FROM {{table}} WHERE id='$id' OR parent='$id' ORDER BY id LIMIT $start,15", "forum"); $query2 = doquery("SELECT title FROM {{table}} WHERE id='$id' LIMIT 1", "forum"); $row2 = mysql_fetch_array($query2); $page = "
\n"; $count = 1; while ($row = mysql_fetch_array($query)) { if ($count == 1) { $page .= "\n"; $count = 2; } else { $page .= "\n"; $count = 1; } } $page .= "
Forum :: ".$row2["title"]."
".$row["author"]."

".prettyforumdate($row["postdate"])."
".nl2br($row["content"])."
".$row["author"]."

".prettyforumdate($row["postdate"])."
".nl2br($row["content"])."

"; $page .= "
Reply To This Thread:

"; display($page, "Forum"); } function reply() { global $userrow; extract($_POST); $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),newpostdate=NOW(),author='".$userrow["username"]."',parent='$parent',replies='0',title='$title',content='$content'", "forum"); $query2 = doquery("UPDATE {{table}} SET newpostdate=NOW(),replies=replies+1 WHERE id='$parent' LIMIT 1", "forum"); header("Location: forum.php?do=thread:$parent:0"); die(); } function newthread() { global $userrow; if (isset($_POST["submit"])) { extract($_POST); $query = doquery("INSERT INTO {{table}} SET id='',postdate=NOW(),newpostdate=NOW(),author='".$userrow["username"]."',parent='0',replies='0',title='$title',content='$content'", "forum"); header("Location: forum.php"); die(); } $page = "
Make A New Post:

Title:


Message:


"; display($page, "Forum"); } ?>