|
From: Doug K. <dou...@us...> - 2001-11-05 21:55:24
|
Update of /cvsroot/phpbb/phpBB In directory usw-pr-cvs1:/tmp/cvs-serv20936 Modified Files: config.php topicadmin.php Log Message: Index: config.php =================================================================== RCS file: /cvsroot/phpbb/phpBB/config.php,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -r1.68 -r1.69 *** config.php 2001/06/16 06:05:50 1.68 --- config.php 2001/11/05 21:55:21 1.69 *************** *** 1,115 **** ! <?php ! /*************************************************************************** ! config.php - description ! ------------------- ! begin : Sat June 17 2000 ! copyright : (C) 2001 The phpBB Group ! email : su...@ph... ! ! $Id$ ! ! ***************************************************************************/ ! ! /*************************************************************************** ! * ! * 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 is the only setting you should need to change in this file. ! // You should set this to the web path to your phpBB installation. ! // For example, if you have phpBB installed in: ! // http://www.mysite.com/phpBB ! // Leave this setting EXACTLY how it is, you're done. ! // If you have phpBB installed in: ! // http://www.mysite.com/forums ! // Change this to: ! // $url_phpbb = "/forums"; ! // Once this is set you should not need to modify anything else in this file. ! $url_phpbb = "/phpBB"; ! ! // -- Edit the following ONLY if you cannot login and $url_phpbb is set correclty -- ! // You shouldn't have to change any of these 5. ! $url_admin = "$url_phpbb/admin"; ! $url_images = "$url_phpbb/images"; ! $url_smiles = "$url_images/smiles"; ! $url_phpbb_index = $url_phpbb . '/index.' . $phpEx; ! $url_admin_index = $url_admin . '/index.' . $phpEx; ! ! /* -- Cookie settings (lastvisit, userid) -- */ ! // Most likely you can leave this be, however if you have problems ! // logging into the forum set this to your domain name, without ! // the http:// ! // For example, if your forum is at http://www.mysite.com/phpBB then ! // set this value to ! // $cookiedomain = "www.mysite.com"; ! $cookiedomain = ""; ! // It should be safe to leave this alone as well. But if you do change it ! // make sure you don't set it to a variable already in use such as 'forum'. ! $cookiename = "phpBB"; ! // It should be safe to leave these alone as well. ! $cookiepath = $url_phpbb; ! $cookiesecure = false; ! ! /* -- Cookie settings (sessions) -- */ ! // This is the cookie name for the sessions cookie, you shouldn't have to change it ! $sesscookiename = "phpBBsession"; ! // This is the number of seconds that a session lasts for, 3600 == 1 hour. ! // The session will exprire if the user dosan't view a page on the forum within ! // this amount of time. ! $sesscookietime = 3600; ! ! /** ! * This setting is only for people running Microsoft IIS. ! * If you're running IIS and your users cannot login using ! * the "login" link on the main page, but they CAN login ! * through other pages like preferences, then you should ! * change this setting to 1. Otherwise, leave at set ! * to 0, because this is an ugly hack around some IIS junk. ! */ ! // Change to "define('USE_IIS_LOGIN_HACK', 1);" if you need to. ! define('USE_IIS_LOGIN_HACK', 0); ! ! /* Stuff for priv msgs - not in DB yet: */ ! // Allow BBCode in private messages? ! $allow_pmsg_bbcode = 1; ! // Allow HTML in private message? ! $allow_pmsg_html = 0; ! ! /* -- You shouldn't have to change anything after this point */ ! /* -- Cosmetic Settings -- */ ! $FontColor = "#FFFFFF"; ! $textcolorMessage = "#FFFFFF"; // Message Font Text Color ! $FontSizeMessage = "1"; // Message Font Text Size ! $FontFaceMessage = "Arial"; // Message Font Text Face ! ! /* -- Images -- */ ! $reply_wquote_image = "$url_images/quote.gif"; ! ! $folder_image = "$url_images/folder.gif"; ! $hot_folder_image = "$url_images/hot_folder.gif"; ! $newposts_image = "$url_images/red_folder.gif"; ! $hot_newposts_image = "$url_images/hot_red_folder.gif"; ! ! $posticon = "$url_images/posticon.gif"; ! $edit_image = "$url_images/edit.gif"; ! $profile_image = "$url_images/profile.gif"; ! $email_image = "$url_images/email.gif"; ! ! $locked_image = "$url_images/lock.gif"; ! $locktopic_image = "$url_images/lock_topic.gif"; ! $deltopic_image = "$url_images/del_topic.gif"; ! $movetopic_image = "$url_images/move_topic.gif"; ! $unlocktopic_image = "$url_images/unlock_topic.gif"; ! $ip_image = "$url_images/ip_logged.gif"; ! ! $www_image = "$url_images/www_icon.gif"; ! $icq_add_image = "$url_images/icq_add.gif"; ! $images_aim = "$url_images/aim.gif"; ! $images_yim = "$url_images/yim.gif"; ! $images_msnm = "$url_images/msnm.gif"; ! ! /* -- Other Settings -- */ ! $phpbbversion = "1.4.1"; --- 1,115 ---- ! <?php ! /*************************************************************************** ! config.php - description ! ------------------- ! begin : Sat June 17 2000 ! copyright : (C) 2001 The phpBB Group ! email : su...@ph... ! ! $Id$ ! ! ***************************************************************************/ ! ! /*************************************************************************** ! * ! * 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 is the only setting you should need to change in this file. ! // You should set this to the web path to your phpBB installation. ! // For example, if you have phpBB installed in: ! // http://www.mysite.com/phpBB ! // Leave this setting EXACTLY how it is, you're done. ! // If you have phpBB installed in: ! // http://www.mysite.com/forums ! // Change this to: ! // $url_phpbb = "/forums"; ! // Once this is set you should not need to modify anything else in this file. ! $url_phpbb = "/phpBB"; ! ! // -- Edit the following ONLY if you cannot login and $url_phpbb is set correclty -- ! // You shouldn't have to change any of these 5. ! $url_admin = "$url_phpbb/admin"; ! $url_images = "$url_phpbb/images"; ! $url_smiles = "$url_images/smiles"; ! $url_phpbb_index = $url_phpbb . '/index.' . $phpEx; ! $url_admin_index = $url_admin . '/index.' . $phpEx; ! ! /* -- Cookie settings (lastvisit, userid) -- */ ! // Most likely you can leave this be, however if you have problems ! // logging into the forum set this to your domain name, without ! // the http:// ! // For example, if your forum is at http://www.mysite.com/phpBB then ! // set this value to ! // $cookiedomain = "www.mysite.com"; ! $cookiedomain = ""; ! // It should be safe to leave this alone as well. But if you do change it ! // make sure you don't set it to a variable already in use such as 'forum'. ! $cookiename = "phpBB"; ! // It should be safe to leave these alone as well. ! $cookiepath = $url_phpbb; ! $cookiesecure = false; ! ! /* -- Cookie settings (sessions) -- */ ! // This is the cookie name for the sessions cookie, you shouldn't have to change it ! $sesscookiename = "phpBBsession"; ! // This is the number of seconds that a session lasts for, 3600 == 1 hour. ! // The session will exprire if the user dosan't view a page on the forum within ! // this amount of time. ! $sesscookietime = 3600; ! ! /** ! * This setting is only for people running Microsoft IIS. ! * If you're running IIS and your users cannot login using ! * the "login" link on the main page, but they CAN login ! * through other pages like preferences, then you should ! * change this setting to 1. Otherwise, leave at set ! * to 0, because this is an ugly hack around some IIS junk. ! */ ! // Change to "define('USE_IIS_LOGIN_HACK', 1);" if you need to. ! define('USE_IIS_LOGIN_HACK', 0); ! ! /* Stuff for priv msgs - not in DB yet: */ ! // Allow BBCode in private messages? ! $allow_pmsg_bbcode = 1; ! // Allow HTML in private message? ! $allow_pmsg_html = 0; ! ! /* -- You shouldn't have to change anything after this point */ ! /* -- Cosmetic Settings -- */ ! $FontColor = "#FFFFFF"; ! $textcolorMessage = "#FFFFFF"; // Message Font Text Color ! $FontSizeMessage = "1"; // Message Font Text Size ! $FontFaceMessage = "Arial"; // Message Font Text Face ! ! /* -- Images -- */ ! $reply_wquote_image = "$url_images/quote.gif"; ! ! $folder_image = "$url_images/folder.gif"; ! $hot_folder_image = "$url_images/hot_folder.gif"; ! $newposts_image = "$url_images/red_folder.gif"; ! $hot_newposts_image = "$url_images/hot_red_folder.gif"; ! ! $posticon = "$url_images/posticon.gif"; ! $edit_image = "$url_images/edit.gif"; ! $profile_image = "$url_images/profile.gif"; ! $email_image = "$url_images/email.gif"; ! ! $locked_image = "$url_images/lock.gif"; ! $locktopic_image = "$url_images/lock_topic.gif"; ! $deltopic_image = "$url_images/del_topic.gif"; ! $movetopic_image = "$url_images/move_topic.gif"; ! $unlocktopic_image = "$url_images/unlock_topic.gif"; ! $ip_image = "$url_images/ip_logged.gif"; ! ! $www_image = "$url_images/www_icon.gif"; ! $icq_add_image = "$url_images/icq_add.gif"; ! $images_aim = "$url_images/aim.gif"; ! $images_yim = "$url_images/yim.gif"; ! $images_msnm = "$url_images/msnm.gif"; ! ! /* -- Other Settings -- */ ! $phpbbversion = "1.4.3"; Index: topicadmin.php =================================================================== RCS file: /cvsroot/phpbb/phpBB/topicadmin.php,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** topicadmin.php 2001/06/16 06:05:50 1.21 --- topicadmin.php 2001/11/05 21:55:21 1.22 *************** *** 1,294 **** ! <?php ! /*************************************************************************** ! topicadmin.php - description ! ------------------- ! begin : Sat June 17 2000 ! copyright : (C) 2001 The phpBB Group ! email : su...@ph... ! ! $Id$ ! ! ***************************************************************************/ ! ! /*************************************************************************** ! * ! * 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. ! * ! ***************************************************************************/ ! include('extention.inc'); ! include('functions.'.$phpEx); ! include('config.'.$phpEx); ! require('auth.'.$phpEx); ! $pagetitle = "Topic Administration"; ! $pagetype = "bbcode_ref"; ! include('page_header.'.$phpEx); ! ! if (isset($user)) ! { ! $mod_data = get_userdata($user, $db); ! } else { ! $mod_data = get_userdata($userdata[username], $db); ! } ! ! if(!is_moderator($forum, $mod_data[user_id], $db) && $mod_data[user_level] <= 2) ! error_die("You are not the moderator of this forum therefore you cannot perform this function."); ! ! if($HTTP_POST_VARS['submit'] || ($user_logged_in==1 && $mode=='viewip')) { ! if( $user_logged_in != 1 && ($mod_data[user_password] != md5($passwd)) ) ! error_die("Error - You did not enter the correct password, please go back and try again."); ! ! switch($mode) { ! case 'del': ! // Update the users's post count, this might be slow on big topics but it makes other parts of the ! // forum faster so we win out in the long run. ! $sql = "SELECT poster_id, post_id FROM posts WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not query the posts database!"); ! while($row = mysql_fetch_array($r)) { ! if($row[poster_id] != -1) { ! $sql = "UPDATE users SET user_posts = user_posts - 1 WHERE user_id = '$row[poster_id]'"; ! @mysql_query($sql, $db); ! } ! } ! ! // Get the post ID's we have to remove. ! $sql = "SELECT post_id FROM posts WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not query the posts database!"); ! while($row = mysql_fetch_array($r)) ! { ! $posts_to_remove[] = $row["post_id"]; ! } ! ! $sql = "DELETE FROM posts WHERE topic_id = '$topic'"; ! if(!$result = mysql_query($sql, $db)) ! die("Error - Could not remove posts from the database!"); ! $sql = "DELETE FROM topics WHERE topic_id = '$topic'"; ! if(!$result = mysql_query($sql, $db)) ! die("Error - Could not remove posts from the database!"); ! $sql = "DELETE FROM posts_text WHERE "; ! for($x = 0; $x < count($posts_to_remove); $x++) ! { ! if($set) ! { ! $sql .= " OR "; ! } ! $sql .= "post_id = ".$posts_to_remove[$x]; ! $set = TRUE; ! } ! ! if(!mysql_query($sql, $db)) ! { ! die("Error - Could not remove post texts!"); ! } ! sync($db, $forum, 'forum'); ! ! echo "The topic has been removed from the database. Click <a href=\"viewforum.$phpEx?forum=$forum\">here</a> to return to the forum, or <a href=\"index.$phpEx\">here</a> to return to the forum index."; ! break; ! case 'move': ! $sql = "UPDATE topics SET forum_id = '$newforum' WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not move selected topic to selected forum. Please go back and try again."); ! $sql = "UPDATE posts SET forum_id = '$newforum' WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not move selected topic to selected forum. Please go back and try again."); ! sync($db, $newforum, 'forum'); ! sync($db, $forum, 'forum'); ! ! echo "The topic has been moved. Click <a href=\"viewtopic.$phpEx?topic=$topic&forum=$newforum\">here</a> to view the updated topic. Or click <a href=\"index.$phpEx\">here</a> to return to the forum index"; ! break; ! case 'lock': ! $sql = "UPDATE topics SET topic_status = 1 WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not lock the selected topic. Please go back and try again."); ! echo "The topic has been locked. Click <a href=\"viewtopic.$phpEx?topic=$topic&forum=$forum\">here</a> to view, or <a href=\"index.$phpEx\">here</a> to return to the forum index."; ! break; ! case 'unlock': ! $sql = "UPDATE topics SET topic_status = '0' WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not unlock the selected topic. Please go back and try again."); ! echo "The topic has been unlocked. Click <a href=\"viewtopic.$phpEx?topic=$topic&forum=$forum\">here</a> to view, or <a href=\"index.$phpEx\">here</a> to return to the forum index."; ! break; ! case 'viewip': ! $sql = "SELECT u.username, p.poster_ip FROM users u, posts p WHERE p.post_id = '$post' AND u.user_id = p.poster_id"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not query the database. <BR>Error: mysql_error()"); ! if(!$m = mysql_fetch_array($r)) ! die("Error - No such user or post in the database."); ! $poster_host = gethostbyaddr($m[poster_ip]); ! ?> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>"> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="1" WIDTH="100%"> ! <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT"> ! <TD COLSPAN="2" ALIGN="CENTER">Users IP and Account information</TD> ! </TR> ! <TR BGCOLOR="<?php echo $color2?>" ALIGN="LEFT"> ! <TD>User IP:</TD> ! <TD><?php echo $m[poster_ip] . " ( $poster_host )"?></TD> ! </TR> ! <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT"> ! <TD COLSPAN="2" ALIGN="CENTER">Usernames of users that posted from this IP + post counts</TD> ! </TR> ! <?php ! $sql = "SELECT user_id, username, count(*) as postcount FROM posts p, users u WHERE poster_ip='".$m[poster_ip]."' && p.poster_id = u.user_id GROUP BY user_id"; ! if(!$r = mysql_query($sql, $db)) ! { ! echo "<TR><TD COLSPAN=\"2\">Error - Could not query the database. <BR>Error: mysql_error()</TD></TR></TABLE>"; ! exit(); ! } ! ! while ($row = mysql_fetch_array($r)){ ! print "<TR BGCOLOR=\"$color2\" ALIGN=\"LEFT\">\n"; ! print " <TD><A HREF=\"bb_profile.php?mode=view&user=".$row[user_id]."\">".$row[username]."</A></TD>\n"; ! print " <TD>".$row[postcount]." posts</TD>\n"; ! print "</TR>\n"; ! } ! ?> ! ! </TABLE></TD></TR></TABLE> ! <?php ! break; ! ! } ! } ! else { // No submit ! ?> ! <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="POST"> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>"> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="1" WIDTH="100%"> ! <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT"> ! <?php ! switch($mode) { ! case 'del': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the delete button at the bottom of this form the topic you have selected, and all its related posts, will be <b>permanently</b> removed.</TD> ! <?php ! break; ! case 'move': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the move button at the bottom of this form the topic you have selected, and its related posts, will be moved to the forum you have selected.</TD> ! <?php ! break; ! case 'lock': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the lock button at the bottom of this form the topic you have selected will be locked. You may unlock it at a later time if you like.</TD> ! <?php ! break; ! case 'unlock': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the unlock button at the bottom of this form the topic you have selected will be unlocked. You may lock it again at a later time if you like.</TD> ! <?php ! break; ! case 'viewip': ! ?> ! <TD COLSPAN=2><B>Read This:</b>View this users IP address.</TD> ! <?php ! break; ! } ! ?> ! </TR> ! <?php ! if (!$user_logged_in) ! { ! ?> ! <TR> ! <TD BGCOLOR="<?php echo $color1?>">Username:</TD> ! <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="TEXT" NAME="user" SIZE="25" MAXLENGTH="40" VALUE="<?php echo $userdata[username]?>"></TD> ! </TR> ! <TR> ! <TD BGCOLOR="<?php echo $color1?>">Password:</TD> ! <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="PASSWORD" NAME="passwd" SIZE="25" MAXLENGTH="25"></TD> ! </TR> ! <?php ! } ! if($mode == 'move') { ! ?> ! <TR> ! <TD BGCOLOR="<?php echo $color1?>">Move Topic To:</TD> ! <TD BGCOLOR="<?php echo $color2?>"><SELECT NAME="newforum" SIZE="0"> ! <?php ! $sql = "SELECT forum_id, forum_name FROM forums WHERE forum_id != '$forum' ORDER BY forum_id"; ! if($result = mysql_query($sql, $db)) { ! if($myrow = mysql_fetch_array($result)) { ! do { ! echo "<OPTION VALUE=\"$myrow[forum_id]\">$myrow[forum_name]</OPTION>\n"; ! } while($myrow = mysql_fetch_array($result)); ! } ! else { ! echo "<OPTION VALUE=\"-1\">No Forums in DB</OPTION>\n"; ! } ! } ! else { ! echo "<OPTION VALUE=\"-1\">Database Error</OPTION>\n"; ! } ! ?> ! </SELECT></TD> ! </TR> ! <?php ! } ! ?> ! <TR BGCOLOR="<?php echo $color1?>"> ! <TD COLSPAN="2" ALIGN="CENTER"> ! <?php ! switch($mode) { ! case 'del': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="del"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Delete Topic"> ! <?php ! break; ! case 'move': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="move"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Move Topic"> ! <?php ! break; ! case 'lock': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="lock"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Lock Topic"> ! <?php ! break; ! case 'unlock': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="unlock"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Unlock Topic"> ! <?php ! break; ! case 'viewip': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="viewip"> ! <INPUT TYPE="HIDDEN" NAME="post" VALUE="<?php echo $post?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="View IP"> ! <?php ! break; ! } ! ?> ! </TD></TR> ! </FORM> ! </TABLE></TD></TR></TABLE></TD></TR></TABLE> ! <?php ! } ! include('page_tail.'.$phpEx); ! ?> ! ! ! ! ! ! ! ! ! --- 1,300 ---- ! <?php ! /*************************************************************************** ! topicadmin.php - description ! ------------------- ! begin : Sat June 17 2000 ! copyright : (C) 2001 The phpBB Group ! email : su...@ph... ! ! $Id$ ! ! ***************************************************************************/ ! ! /*************************************************************************** ! * ! * 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. ! * ! ***************************************************************************/ ! include('extention.inc'); ! include('functions.'.$phpEx); ! include('config.'.$phpEx); ! require('auth.'.$phpEx); ! $pagetitle = "Topic Administration"; ! $pagetype = "bbcode_ref"; ! include('page_header.'.$phpEx); ! ! if (isset($user)) ! { ! error_die("Error - You did not enter the correct password, please go back and try again."); ! } ! else if(isset($userdata[username])) ! { ! $mod_data = get_userdata($userdata[username], $db); ! } ! else ! { ! error_die("Error - You must be signed in to perform this function. Please go back and try again."); ! } ! ! if(!is_moderator($forum, $mod_data[user_id], $db) && $mod_data[user_level] <= 2) ! error_die("You are not the moderator of this forum therefore you cannot perform this function."); ! ! if($HTTP_POST_VARS['submit'] || ($user_logged_in==1 && $mode=='viewip')) { ! if( $user_logged_in != 1 && ($mod_data[user_password] != md5($passwd)) ) ! error_die("Error - You did not enter the correct password, please go back and try again."); ! ! switch($mode) { ! case 'del': ! // Update the users's post count, this might be slow on big topics but it makes other parts of the ! // forum faster so we win out in the long run. ! $sql = "SELECT poster_id, post_id FROM posts WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not query the posts database!"); ! while($row = mysql_fetch_array($r)) { ! if($row[poster_id] != -1) { ! $sql = "UPDATE users SET user_posts = user_posts - 1 WHERE user_id = '$row[poster_id]'"; ! @mysql_query($sql, $db); ! } ! } ! ! // Get the post ID's we have to remove. ! $sql = "SELECT post_id FROM posts WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not query the posts database!"); ! while($row = mysql_fetch_array($r)) ! { ! $posts_to_remove[] = $row["post_id"]; ! } ! ! $sql = "DELETE FROM posts WHERE topic_id = '$topic'"; ! if(!$result = mysql_query($sql, $db)) ! die("Error - Could not remove posts from the database!"); ! $sql = "DELETE FROM topics WHERE topic_id = '$topic'"; ! if(!$result = mysql_query($sql, $db)) ! die("Error - Could not remove posts from the database!"); ! $sql = "DELETE FROM posts_text WHERE "; ! for($x = 0; $x < count($posts_to_remove); $x++) ! { ! if($set) ! { ! $sql .= " OR "; ! } ! $sql .= "post_id = ".$posts_to_remove[$x]; ! $set = TRUE; ! } ! ! if(!mysql_query($sql, $db)) ! { ! die("Error - Could not remove post texts!"); ! } ! sync($db, $forum, 'forum'); ! ! echo "The topic has been removed from the database. Click <a href=\"viewforum.$phpEx?forum=$forum\">here</a> to return to the forum, or <a href=\"index.$phpEx\">here</a> to return to the forum index."; ! break; ! case 'move': ! $sql = "UPDATE topics SET forum_id = '$newforum' WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not move selected topic to selected forum. Please go back and try again."); ! $sql = "UPDATE posts SET forum_id = '$newforum' WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not move selected topic to selected forum. Please go back and try again."); ! sync($db, $newforum, 'forum'); ! sync($db, $forum, 'forum'); ! ! echo "The topic has been moved. Click <a href=\"viewtopic.$phpEx?topic=$topic&forum=$newforum\">here</a> to view the updated topic. Or click <a href=\"index.$phpEx\">here</a> to return to the forum index"; ! break; ! case 'lock': ! $sql = "UPDATE topics SET topic_status = 1 WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not lock the selected topic. Please go back and try again."); ! echo "The topic has been locked. Click <a href=\"viewtopic.$phpEx?topic=$topic&forum=$forum\">here</a> to view, or <a href=\"index.$phpEx\">here</a> to return to the forum index."; ! break; ! case 'unlock': ! $sql = "UPDATE topics SET topic_status = '0' WHERE topic_id = '$topic'"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not unlock the selected topic. Please go back and try again."); ! echo "The topic has been unlocked. Click <a href=\"viewtopic.$phpEx?topic=$topic&forum=$forum\">here</a> to view, or <a href=\"index.$phpEx\">here</a> to return to the forum index."; ! break; ! case 'viewip': ! $sql = "SELECT u.username, p.poster_ip FROM users u, posts p WHERE p.post_id = '$post' AND u.user_id = p.poster_id"; ! if(!$r = mysql_query($sql, $db)) ! die("Error - Could not query the database. <BR>Error: mysql_error()"); ! if(!$m = mysql_fetch_array($r)) ! die("Error - No such user or post in the database."); ! $poster_host = gethostbyaddr($m[poster_ip]); ! ?> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>"> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="1" WIDTH="100%"> ! <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT"> ! <TD COLSPAN="2" ALIGN="CENTER">Users IP and Account information</TD> ! </TR> ! <TR BGCOLOR="<?php echo $color2?>" ALIGN="LEFT"> ! <TD>User IP:</TD> ! <TD><?php echo $m[poster_ip] . " ( $poster_host )"?></TD> ! </TR> ! <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT"> ! <TD COLSPAN="2" ALIGN="CENTER">Usernames of users that posted from this IP + post counts</TD> ! </TR> ! <?php ! $sql = "SELECT user_id, username, count(*) as postcount FROM posts p, users u WHERE poster_ip='".$m[poster_ip]."' && p.poster_id = u.user_id GROUP BY user_id"; ! if(!$r = mysql_query($sql, $db)) ! { ! echo "<TR><TD COLSPAN=\"2\">Error - Could not query the database. <BR>Error: mysql_error()</TD></TR></TABLE>"; ! exit(); ! } ! ! while ($row = mysql_fetch_array($r)){ ! print "<TR BGCOLOR=\"$color2\" ALIGN=\"LEFT\">\n"; ! print " <TD><A HREF=\"bb_profile.php?mode=view&user=".$row[user_id]."\">".$row[username]."</A></TD>\n"; ! print " <TD>".$row[postcount]." posts</TD>\n"; ! print "</TR>\n"; ! } ! ?> ! ! </TABLE></TD></TR></TABLE> ! <?php ! break; ! ! } ! } ! else { // No submit ! ?> ! <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="POST"> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>"> ! <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="1" WIDTH="100%"> ! <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT"> ! <?php ! switch($mode) { ! case 'del': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the delete button at the bottom of this form the topic you have selected, and all its related posts, will be <b>permanently</b> removed.</TD> ! <?php ! break; ! case 'move': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the move button at the bottom of this form the topic you have selected, and its related posts, will be moved to the forum you have selected.</TD> ! <?php ! break; ! case 'lock': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the lock button at the bottom of this form the topic you have selected will be locked. You may unlock it at a later time if you like.</TD> ! <?php ! break; ! case 'unlock': ! ?> ! <TD COLSPAN=2><B>Read This:</b>Once you press the unlock button at the bottom of this form the topic you have selected will be unlocked. You may lock it again at a later time if you like.</TD> ! <?php ! break; ! case 'viewip': ! ?> ! <TD COLSPAN=2><B>Read This:</b>View this users IP address.</TD> ! <?php ! break; ! } ! ?> ! </TR> ! <?php ! if (!$user_logged_in) ! { ! ?> ! <TR> ! <TD BGCOLOR="<?php echo $color1?>">Username:</TD> ! <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="TEXT" NAME="user" SIZE="25" MAXLENGTH="40" VALUE="<?php echo $userdata[username]?>"></TD> ! </TR> ! <TR> ! <TD BGCOLOR="<?php echo $color1?>">Password:</TD> ! <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="PASSWORD" NAME="passwd" SIZE="25" MAXLENGTH="25"></TD> ! </TR> ! <?php ! } ! if($mode == 'move') { ! ?> ! <TR> ! <TD BGCOLOR="<?php echo $color1?>">Move Topic To:</TD> ! <TD BGCOLOR="<?php echo $color2?>"><SELECT NAME="newforum" SIZE="0"> ! <?php ! $sql = "SELECT forum_id, forum_name FROM forums WHERE forum_id != '$forum' ORDER BY forum_id"; ! if($result = mysql_query($sql, $db)) { ! if($myrow = mysql_fetch_array($result)) { ! do { ! echo "<OPTION VALUE=\"$myrow[forum_id]\">$myrow[forum_name]</OPTION>\n"; ! } while($myrow = mysql_fetch_array($result)); ! } ! else { ! echo "<OPTION VALUE=\"-1\">No Forums in DB</OPTION>\n"; ! } ! } ! else { ! echo "<OPTION VALUE=\"-1\">Database Error</OPTION>\n"; ! } ! ?> ! </SELECT></TD> ! </TR> ! <?php ! } ! ?> ! <TR BGCOLOR="<?php echo $color1?>"> ! <TD COLSPAN="2" ALIGN="CENTER"> ! <?php ! switch($mode) { ! case 'del': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="del"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Delete Topic"> ! <?php ! break; ! case 'move': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="move"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Move Topic"> ! <?php ! break; ! case 'lock': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="lock"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Lock Topic"> ! <?php ! break; ! case 'unlock': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="unlock"> ! <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Unlock Topic"> ! <?php ! break; ! case 'viewip': ! ?> ! <INPUT TYPE="HIDDEN" NAME="mode" VALUE="viewip"> ! <INPUT TYPE="HIDDEN" NAME="post" VALUE="<?php echo $post?>"> ! <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>"> ! <INPUT TYPE="SUBMIT" NAME="submit" VALUE="View IP"> ! <?php ! break; ! } ! ?> ! </TD></TR> ! </FORM> ! </TABLE></TD></TR></TABLE></TD></TR></TABLE> ! <?php ! } ! include('page_tail.'.$phpEx); ! ?> ! ! ! ! ! ! ! ! ! |