/////////////////////////////////////////////////////////////////////////////////// // // // 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 = make_clickable($thread_name); if ($thread_name != "") { $title = "$thread_name @ $site_name"; } else { $title = "$category @ $site_name"; } include $inc_dir . "header.php3"; top_bar(); $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"]; $cat_pass = $row["password"]; if ($cat_pass) { check_auth($cat_pass); } $admin = get_user_info_field($user, $admin_field); $pass = get_user_info_field($user, $passwd_field); if ($admin == "" && $pass == "") { print("
Account not found... please click back and try again.
\n"); SQL_close($db_link); include $inc_dir . "footer.php3"; exit; } if (!check_pw($password, $pass)) { print("Password authentication incorrect. Please click back and enter the password again, or if you are using cookies, please login again.
\n"); SQL_close($db_link); include $inc_dir . "footer.php3"; exit; } if ($moderated) { if (($moderator == $user) || ($admin)) { $mod_stat = 1; } else { $mod_stat = 0; } } else { $mod_stat = 0; } if ($HTTP_VIA != "") { $fields = ", remote_addr, user_agent, proxy_addr, proxy_host, proxy_agent"; $remote_addr = $HTTP_X_FORWARDED_FOR; $user_agent = addslashes($HTTP_USER_AGENT); $proxy_addr = $REMOTE_ADDR; $proxy_host = addslashes($REMOTE_HOST); $proxy_agent = addslashes($HTTP_VIA); $values = ", '$remote_addr', '$user_agent', '$proxy_addr', '$proxy_host', '$proxy_agent'"; } else { $fields = ", remote_addr, remote_host, user_agent"; $user_agent = addslashes($HTTP_USER_AGENT); $remote_addr = $REMOTE_ADDR; $remote_host = addslashes($REMOTE_HOST); $values = ", '$remote_addr', '$remote_host', '$user_agent'"; } if (!isset($thread_id)) { $statement = "INSERT INTO articles (category, username, title, text, posted, approved, touched, status, replies, thread_id$fields)"; $statement .= " VALUES ('$category', '$user', '$post_title', '$text', NOW(), $mod_stat, NOW(), 0, 0, 0$values)"; } else { $statement = "UPDATE articles SET replies=replies+1 WHERE id=$thread_id"; $res = SQL_query($statement, $db_link); $statement = "INSERT INTO articles (category, username, title, text, posted, thread_id, approved, status, replies, touched$fields)"; $statement .= " VALUES ('$category', '$user', '$post_title', '$text', NOW(), $thread_id, $mod_stat, 0, 0, NOW()$values)"; } // output it... helpful for debugging purposes... //print("SQL Statement: $statement
"); $db_result = SQL_query($statement, $db_link); // find out how many results there were... $aff_rows = SQL_get_aff_rows($db_link, $db_result); //print("| Article Posted |
| Title: $title2 |
| User: $user |
| $text2 |
| Click here to return to the topic. |