Verzeichnisstruktur phpBB-1.0.0
- Veröffentlicht
- 15.12.2000
So funktioniert es
|
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
topicadmin.php
001 <?php
002 /***************************************************************************
003 topicadmin.php - description
004 -------------------
005 begin : Sat June 17 2000
006 copyright : (C) 2000 by James Atkinson
007 email : james@totalgeek.org
008
009 $Id: topicadmin.php,v 1.12 2000/11/15 04:57:15 thefinn Exp $
010
011 ***************************************************************************/
012
013 /***************************************************************************
014 *
015 * This program is free software; you can redistribute it and/or modify
016 * it under the terms of the GNU General Public License as published by
017 * the Free Software Foundation; either version 2 of the License, or
018 * (at your option) any later version.
019 *
020 ***************************************************************************/
021 include('extention.inc');
022 include('functions.'.$phpEx);
023 include('config.'.$phpEx);
024 require('auth.'.$phpEx);
025 $pagetitle = "Topic Administration";
026 $pagetype = "bbcode_ref";
027 include('page_header.'.$phpEx);
028
029 if($submit) {
030 $mod_data = get_userdata($user, $db);
031
032 if(!is_moderator($forum, $mod_data[user_id], $db) && $mod_data[user_level] <= 2)
033 die("You are not the moderator of this forum therefor you cannot perform this function.");
034 $md_pass = md5($passwd);
035 if($mod_data[user_password] != $md_pass)
036 die("Error - You did not enter the correct password, please go back and try again.");
037
038 switch($mode) {
039 case 'del':
040 $sql = "DELETE FROM posts WHERE topic_id = '$topic'";
041 if(!$result = mysql_query($sql, $db))
042 die("Error - Could not remove posts from the database!");
043 $sql = "DELETE FROM topics WHERE topic_id = '$topic'";
044 if(!$result = mysql_query($sql, $db))
045 die("Error - Could not remove posts from the database!");
046 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.";
047 break;
048 case 'move':
049 $sql = "UPDATE topics SET forum_id = '$newforum' WHERE topic_id = '$topic'";
050 if(!$r = mysql_query($sql, $db))
051 die("Error - Could not move selected topic to selected forum. Please go back and try again.");
052 $sql = "UPDATE posts SET forum_id = '$newforum' WHERE topic_id = '$topic'";
053 if(!$r = mysql_query($sql, $db))
054 die("Error - Could not move selected topic to selected forum. Please go back and try again.");
055 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";
056 break;
057 case 'lock':
058 $sql = "UPDATE topics SET topic_status = 1 WHERE topic_id = '$topic'";
059 if(!$r = mysql_query($sql, $db))
060 die("Error - Could not lock the selected topic. Please go back and try again.");
061 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.";
062 break;
063 case 'unlock':
064 $sql = "UPDATE topics SET topic_status = '0' WHERE topic_id = '$topic'";
065 if(!$r = mysql_query($sql, $db))
066 die("Error - Could not unlock the selected topic. Please go back and try again.");
067 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.";
068 break;
069 case 'viewip':
070 $sql = "SELECT u.username, p.poster_ip FROM users u, posts p WHERE p.post_id = '$post' AND u.user_id = p.poster_id";
071 if(!$r = mysql_query($sql, $db))
072 die("Error - Could not query the database. <BR>Error: mysql_error()");
073 if(!$m = mysql_fetch_array($r))
074 die("Error - No such user or post in the database.");
075 ?>
076 <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>">
077 <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="1" WIDTH="100%">
078 <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT">
079 <TD COLSPAN="2" ALIGN="CENTER">Users IP and Account information</TD>
080 </TR>
081 <TR BGCOLOR="<?php echo $color2?>" ALIGN="LEFT">
082 <TD>Username:</TD>
083 <TD><?php echo $m[username]?></TD>
084 </TR>
085 <TR BGCOLOR="<?php echo $color2?>" ALIGN="LEFT">
086 <TD>User IP:</TD>
087 <TD><?php echo $m[poster_ip]?></TD>
088 </TR>
089 </TABLE></TD></TR></TABLE>
090 <?php
091 break;
092
093 }
094 }
095 else {
096 ?>
097 <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="POST">
098 <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>">
099 <TABLE BORDER="0" CELLPADDING="1" CELLSPACING="1" WIDTH="100%">
100 <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT">
101 <?php
102 switch($mode) {
103 case 'del':
104 ?>
105 <TD COLSPAN=2><B>Read This:</b> Please identify yourself as moderator of this forum. 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>
106 <?php
107 break;
108 case 'move':
109 ?>
110 <TD COLSPAN=2><B>Read This:</b> Please identify yourself as moderator of this forum. 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>
111 <?php
112 break;
113 case 'lock':
114 ?>
115 <TD COLSPAN=2><B>Read This:</b> Please identify yourself as moderator of this forum. 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>
116 <?php
117 break;
118 case 'unlock':
119 ?>
120 <TD COLSPAN=2><B>Read This:</b> Please identify yourself as moderator of this forum. 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>
121 <?php
122 break;
123 case 'viewip':
124 ?>
125 <TD COLSPAN=2><B>Read This:</b> Please identify yourself as moderator of this forum to view this users IP address.</TD>
126 <?php
127 break;
128 }
129 ?>
130 </TR>
131 <TR>
132 <TD BGCOLOR="<?php echo $color1?>">Username:</TD>
133 <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="TEXT" NAME="user" SIZE="25" MAXLENGTH="40" VALUE="<?php echo $userdata[username]?>"></TD>
134 </TR>
135 <TR>
136 <TD BGCOLOR="<?php echo $color1?>">Password:</TD>
137 <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="PASSWORD" NAME="passwd" SIZE="25" MAXLENGTH="25"></TD>
138 </TR>
139 <?php
140 if($mode == 'move') {
141 ?>
142 <TR>
143 <TD BGCOLOR="<?php echo $color1?>">Move Topic To:</TD>
144 <TD BGCOLOR="<?php echo $color2?>"><SELECT NAME="newforum" SIZE="0">
145 <?php
146 $sql = "SELECT forum_id, forum_name FROM forums WHERE forum_id != '$forum' ORDER BY forum_id";
147 if($result = mysql_query($sql, $db)) {
148 if($myrow = mysql_fetch_array($result)) {
149 do {
150 echo "<OPTION VALUE=\"$myrow[forum_id]\">$myrow[forum_name]</OPTION>\n";
151 } while($myrow = mysql_fetch_array($result));
152 }
153 else {
154 echo "<OPTION VALUE=\"-1\">No Forums in DB</OPTION>\n";
155 }
156 }
157 else {
158 echo "<OPTION VALUE=\"-1\">Database Error</OPTION>\n";
159 }
160 ?>
161 </SELECT></TD>
162 </TR>
163 <?php
164 }
165 ?>
166 <TR BGCOLOR="<?php echo $color1?>">
167 <TD COLSPAN="2" ALIGN="CENTER">
168 <?php
169 switch($mode) {
170 case 'del':
171 ?>
172 <INPUT TYPE="HIDDEN" NAME="mode" VALUE="del">
173 <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>">
174 <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>">
175 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Delete Topic">
176 <?php
177 break;
178 case 'move':
179 ?>
180 <INPUT TYPE="HIDDEN" NAME="mode" VALUE="move">
181 <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>">
182 <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>">
183 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Move Topic">
184 <?php
185 break;
186 case 'lock':
187 ?>
188 <INPUT TYPE="HIDDEN" NAME="mode" VALUE="lock">
189 <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>">
190 <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>">
191 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Lock Topic">
192 <?php
193 break;
194 case 'unlock':
195 ?>
196 <INPUT TYPE="HIDDEN" NAME="mode" VALUE="unlock">
197 <INPUT TYPE="HIDDEN" NAME="topic" VALUE="<?php echo $topic?>">
198 <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>">
199 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Unlock Topic">
200 <?php
201 break;
202 case 'viewip':
203 ?>
204 <INPUT TYPE="HIDDEN" NAME="mode" VALUE="viewip">
205 <INPUT TYPE="HIDDEN" NAME="post" VALUE="<?php echo $post?>">
206 <INPUT TYPE="HIDDEN" NAME="forum" VALUE="<?php echo $forum?>">
207 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="View IP">
208 <?php
209 break;
210 }
211 ?>
212 </TD></TR>
213 </FORM>
214 </TABLE></TD></TR></TABLE></TD></TR></TABLE>
215 <?php
216 }
217 include('page_tail.'.$phpEx);
218 ?>
219
220
221
222
223
224
225
226
227
228