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 |
replypmsg.php
001 <?php
002 /***************************************************************************
003 replypmsg.php - description
004 -------------------
005 begin : Sat June 17 2000
006 copyright : (C) 2000 by James Atkinson
007 email : james@totalgeek.org
008
009 $Id: replypmsg.php,v 1.5 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 = "Post PM Reply";
026 $pagetype = "pmreply";
027 include('page_header.'.$phpEx);
028
029 if($submit) {
030 if($message == '') {
031 die("You must type a message to post. You cannot post an empty message, go back and enter a message");
032 }
033
034 $sql = "SELECT u.* FROM users u, priv_msgs p WHERE (u.user_id = p.to_userid) AND (p.msg_id = $msgid)";
035 $result = mysql_query($sql, $db);
036 if (!$result) {
037 die("error doing DB query");
038 }
039 $fromuserdata = mysql_fetch_array($result);
040
041
042 if (!$user_logged_in) { // don't check this stuff if we have a valid session..
043 if($password == '') {
044 die("You must enter your password. Go back and do so.");
045 }
046
047 $md_pass = md5($password);
048
049 if($md_pass != $fromuserdata["user_password"]) {
050 die("You have entered an incorrect password. Go back and try again.");
051 }
052 } else {
053 // we have a valid session..
054 if ($fromuserdata[user_id] == $userdata[user_id]) {
055 $fromuserdata = $userdata; // fromuser = current user.
056 } else {
057 die("Wrong user logged in.");
058 }
059 }
060
061 /* correct password or logged-in user, continuing with message send. */
062
063 if($allow_pmsg_html == 0 && !isset($html)) {
064 $message = htmlspecialchars($message);
065 }
066 if($allow_pmsg_bbcode == 1 && !isset($bbcode)) {
067 $message = bbencode($message);
068 }
069 if($sig) {
070 $message .= "<BR>-----------------<BR>" . $fromuserdata[user_sig];
071 }
072 $message = str_replace("\n", "<BR>", $message);
073 if(!$smile) {
074 $message = smile($message);
075 }
076 $message = make_clickable($message);
077 $message = addslashes($message);
078 $time = date("Y-m-d H:i");
079 $sql = "SELECT from_userid FROM priv_msgs WHERE (msg_id = $msgid)";
080 $result = mysql_query($sql);
081 if (!$result) {
082 echo $sql . mysql_error();
083 die("Error doing DB query");
084 }
085 $row = mysql_fetch_array($result);
086 $touserid = $row[from_userid];
087
088 $sql = "INSERT INTO priv_msgs (from_userid, to_userid, msg_time, msg_text, poster_ip) ";
089 $sql .= "VALUES ($fromuserdata[user_id], $touserid, '$time', '$message', '$poster_ip')";
090
091 if(!$result = mysql_query($sql, $db)) {
092 die("Error - Could not enter data into the database. Please go back and try again");
093 }
094
095 echo "Reply Posted, you can click <a href=\"viewpmsg.$phpEx\">here</a> to view your private messages";
096
097 } else {
098 $sql = "SELECT from_userid, to_userid FROM priv_msgs WHERE (msg_id = $msgid)";
099 $result = mysql_query($sql, $db);
100 if (!$result) {
101 die("error doing DB query.");
102 }
103 $row = mysql_fetch_array($result);
104 if (!$row) {
105 die("message not found");
106 }
107 $fromuserdata = get_userdata_from_id($row[from_userid], $db);
108 $touserdata = get_userdata_from_id($row[to_userid], $db);
109 if ( $user_logged_in && ($userdata[user_id] != $touserdata[user_id]) ) {
110 die("You can't reply to that message. It wasn't sent to you.");
111 }
112
113 ?>
114 <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="POST">
115 <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>">
116 <TABLE BORDER="0" CALLPADDING="1" CELLSPACEING="1" WIDTH="100%">
117 <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT">
118 <TD width=25%><b>About Posting:</b></TD>
119 <TD>All <b>registered</b> users can post private messages</TD>
120 </TR>
121 <TR ALIGN="LEFT">
122 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>Your username:<b></TD>
123 <TD BGCOLOR="<?php echo $color2?>">
124 <?PHP
125 if ($user_logged_in) {
126 echo "$userdata[username] \n";
127 } else {
128 echo "$touserdata[username] \n";
129 }
130 ?>
131 </TD>
132 </TR>
133 <?PHP
134 if (!$user_logged_in) {
135 // no session, need a password.
136 echo " <TR ALIGN=\"LEFT\"> \n";
137 echo " <TD BGCOLOR=\"$color1\" width=25%><b>Password:</b></TD> \n";
138 echo " <TD BGCOLOR=\"$color2\"><INPUT TYPE=\"PASSWORD\" NAME=\"password\" SIZE=\"25\" MAXLENGTH=\"25\"></TD> \n";
139 echo " </TR> \n";
140 }
141 ?>
142 <TR ALIGN="LEFT">
143 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>To:<b></TD>
144 <TD BGCOLOR="<?php echo $color2?>"><?php echo $fromuserdata[username]?></TD>
145 </TR>
146
147 <TR ALIGN="LEFT">
148 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>Message:</b><br><br>
149 <font size=-1>
150 <?php
151 echo "HTML is: ";
152 if($allow_html == 1)
153 echo "On<BR>\n";
154 else
155 echo "Off<BR>\n";
156 echo "<a href=\"bbcode_ref.$phpEx\" TARGET=\"blank\">BBCode</a> is: ";
157 if($allow_bbcode == 1)
158 echo "On<br>\n";
159 else
160 echo "Off<BR>\n";
161
162 if($quote) {
163 $sql = "SELECT p.msg_text, p.msg_time, u.username FROM priv_msgs p, users u ";
164 $sql .= "WHERE (p.msg_id = $msgid) AND (p.from_userid = u.user_id)";
165 if($result = mysql_query($sql, $db)) {
166 $row = mysql_fetch_array($result);
167 $text = desmile($row[msg_text]);
168 $text = str_replace("<BR>", "\n", $text);
169 $text = stripslashes($text);
170 $text = bbdecode($text);
171 $reply = "[quote]\nOn $row[msg_time], $row[username] wrote:\n$text\n[/quote]";
172 }
173 else {
174 $reply = "Error Contacting database. Please try again.\n";
175 }
176 }
177 ?>
178 </font></TD>
179 <TD BGCOLOR="<?php echo $color2?>"><TEXTAREA NAME="message" ROWS=10 COLS=45 WRAP="VIRTUAL"><?php echo $reply?></TEXTAREA></TD>
180 </TR>
181 <TR ALIGN="LEFT">
182 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>Options:</b></TD>
183 <TD BGCOLOR="<?php echo $color2?>" >
184 <?php
185 if($allow_html == 1) {
186 ?>
187 <INPUT TYPE="CHECKBOX" NAME="html">Disable HTML on this Post<BR>
188 <?php
189 }
190 if($allow_bbcode == 1) {
191 ?>
192 <INPUT TYPE="CHECKBOX" NAME="bbcode">Disable <a href="bbcode_ref.<?php echo $phpEx?>" target="_blank"><i>BBCode</i></a> on this Post<BR>
193 <?php
194 }
195 ?>
196
197 <INPUT TYPE="CHECKBOX" NAME="smile">Disable <a href="bb_smilies.<?php echo $phpEx?>" target="_blank"><i>smilies</i></a> on this post.<BR>
198 <?php
199 if($allow_sig == 1) {
200 ?>
201 <INPUT TYPE="CHECKBOX" NAME="sig">Show signature <font size=-2>(This can be altered or added in your profile)</font><BR>
202 <?php
203 }
204 ?>
205 </TD>
206 </TR>
207 <TR>
208 <TD BGCOLOR="<?php echo $color1?>" colspan=2 ALIGN="CENTER">
209 <INPUT TYPE="HIDDEN" NAME="msgid" VALUE="<?php echo $msgid?>">
210 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit"> <INPUT TYPE="RESET" VALUE="Clear">
211 </TR>
212 </TABLE></TD></TR></TABLE>
213 </FORM>
214 <BR>
215
216 <?PHP
217 }
218 require('page_tail.'.$phpEx);
219 ?>
220