///////////////////////////////////////////////////////////////////////////////////
// //
// 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;
$title = "$category @ $site_name";
include $inc_dir . "header.php3";
$cookie_name = eregi_replace(" ", "_", $site_name);
$is_browser = 1;
top_bar();
$locked_img = "";
$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);
$moderated = $row["moderated"];
$moderator = $row["moderator"];
$password = $row["password"];
if ($password) {
check_auth($password);
}
print("
SQL Statement: $statement
"); $db_result2 = SQL_query($statement, $db_link); // find out how many results there were... $mod_rows = SQL_get_aff_rows($db_link, $db_result2); if ($user_mod) { // form the select statement $statement = "SELECT * FROM articles WHERE category='$category' AND thread_id=0 ORDER BY touched DESC"; } } else { // form the select statement $statement = "SELECT * FROM articles WHERE category='$category' AND thread_id=0 AND approved=$moderated ORDER BY touched DESC"; } // output it... helpful for debugging purposes... //print("SQL Statement: $statement
"); $count_res = SQL_query($statement, $db_link); $count_rows = SQL_get_aff_rows($db_link, $count_res); $db_result2 = SQL_query($statement . SQL_limit($cur_limit, $site_max_threads), $db_link); $aff_rows = SQL_get_aff_rows($db_link, $db_result2); $start_pos = $cur_limit + 1; $cur_pos = $cur_limit + $aff_rows; if ($aff_rows == 0) { print("No posts found in this category yet.
\n"); include $inc_dir . "footer.php3"; exit; } //print("\n"); if ($count_rows > $aff_rows) { print("Page "); $pages = ($count_rows / $site_max_threads); if ($count_rows % $site_max_threads) { $pages++; } $pages--; for ($page = 0; $page < $pages; $page++) { $page_disp = $page + 1; $start = $page * $site_max_threads; $page_url = $site_url . "browse" . $ext . "?category=" . urlencode($category) . "&cur_limit=$start"; if ($start == $cur_limit) { print(" $page_disp "); } else { print(" $page_disp "); } } print("
"); } $row_id = 0; if ($aff_rows > 0) { print("| Thread Name | Number of Posts | Latest Post | Thread Started | |
|---|---|---|---|---|
| $new_img | \n"); } else { print("||||
| $new_img | \n"); } $thread_ref = $site_url . "browse_thread" . $ext . "?category=" . urlencode($category) . "&query=$thread_id&thread_name=" . urlencode($thread_name); print("$thread_name | \n"); print(""); if ($moderated) { $st = "SELECT id FROM articles WHERE category='$category' AND (thread_id=$thread_id OR id=$thread_id) AND approved=$moderated"; $res = SQL_query($st, $db_link); $num = SQL_get_aff_rows($db_link, $res); if ($user_mod) { $st = "SELECT id FROM articles WHERE category='$category' AND (thread_id=$thread_id OR id=$thread_id) AND approved!=$moderated"; $res = SQL_query($st, $db_link); $num2 = SQL_get_aff_rows($db_link, $res); print("$num ($num2)"); } else { print("$num"); } } else { print("$replies"); } print(" | $last_time | $pret_time ($realname) |