/////////////////////////////////////////////////////////////////////////////////// // // // phpBoard -- Copyright (c) 2000 by Nathan Clemons // // nathan@thelinuxcommunity.org // // // // This program is free software; you can redistribute it and/or modify // // it under the terms of the GNU General Public License as published by // // the Free Software Foundation; either version 2 of the License, or // // (at your option) any later version. // // // // This program is distributed in the hope that it will be useful, // // but WITHOUT ANY WARRANTY; without even the implied warranty of // // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // // GNU General Public License for more details. // // // // You should have received a copy of the GNU General Public License // // along with this program; if not, write to the Free Software // // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // // /////////////////////////////////////////////////////////////////////////////////// require "config_inc.php3"; require $inc_dir . "sql_inc.php3"; require $inc_dir . "lib_inc.php3"; require $inc_dir . $user_lib; $thread_name = stripslashes($thread_name); $thread_name = make_clickable($thread_name); $title = "$thread_name @ $site_name"; include $inc_dir . "header.php3"; $db_link = SQL_connect(); $statement = "SELECT * FROM categories WHERE name='$category'"; $db_result = SQL_query($statement, $db_link); $posts = SQL_get_aff_rows($db_link, $db_result); $row = SQL_fetch_array($db_result, 0); top_bar(); $moderated = $row["moderated"]; $moderator = $row["moderator"]; $password = $row["password"]; if ($password) { check_auth($password); } $user_mod = check_mod($moderator); if (!$cur_limit) { $cur_limit = 0; } if ($moderated && $user_mod) { // form the select statement $statement = "SELECT id,status FROM articles WHERE category='$category' AND (id=$query OR thread_id=$query)"; $statement2 = "SELECT * FROM articles WHERE category='$category' AND (id=$query OR thread_id=$query) ORDER BY thread_id,posted " . SQL_limit($cur_limit,$site_max_posts); } else { // form the select statement $statement = "SELECT id,status FROM articles WHERE category='$category' AND (id=$query OR thread_id=$query) AND approved=$moderated"; $statement2 = "SELECT * FROM articles WHERE category='$category' AND (id=$query OR thread_id=$query) AND approved=$moderated ORDER BY thread_id,posted " . SQL_limit($cur_limit,$site_max_posts); } // output it... helpful for debugging purposes... // print("
Page "); $pages = ($count_rows / $site_max_posts); if ($count_rows % $site_max_posts) { $pages++; } $pages--; for ($page = 0; $page < $pages; $page++) { $page_disp = $page + 1; $start = $page * $site_max_posts; $page_url = $site_url . "browse_thread" . $ext . "?category=" . urlencode($category) . "&query=$query&thread_name=". urlencode($thread_name) . "&cur_limit=$start"; if ($start == $cur_limit) { print(" $page_disp "); } else { print(" $page_disp "); } } print("
"); } print("| Author | Topic |
|---|---|
| This thread is locked. | |
| ");
parse_user($realname, $row["username"], $admin, $imgurl, $row["posted"], $email);
if ($user_mod) {
print(" " . $row["remote_addr"]); if ($row["remote_host"] != "") { print(" (" . $row["remote_host"] . ")"); } print(" "); if ($moderated && $row["approved"] != $moderated) { $approve_ref = $site_url . "moderate" . $ext . "?query=$post_id&action=approve_confirm&category=" . urlencode($category); print("Approve "); } if ($row["thread_id"] == 0) { $del_thread_ref = $site_url . "moderate" . $ext . "?query=$query&action=del_t_confirm&category=" . urlencode($category); $lock_thread_ref = $site_url . "moderate" . $ext . "?query=$query&action=lock_confirm&category=" . urlencode($category); $unlock_thread_ref = $site_url . "moderate" . $ext . "?query=$query&action=unlock_confirm&category=" . urlencode($category); $move_thread_ref = $site_url . "moderate" . $ext . "?query=$query&action=move_confirm&category=" . urlencode($category); print("Delete Thread "); print("Lock Thread "); print("Unlock Thread "); print("Move Thread"); } else { $del_post_ref = $site_url . "moderate" . $ext . "?query=$post_id&action=del_p_confirm&category=" . urlencode($category); print("Delete Post"); } } print(" | \n");
$text = make_clickable($row["text"]);
$text = nl2br($text);
$title2 = make_clickable($row["title"]);
$title2 = nl2br($title2);
$title2 = stripslashes($title2);
print("$title2");
if ($moderated && $user_mod && $row["approved"] != $moderated) {
print(" (Unapproved Post)");
}
print(" $text |