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 |
sendpmsg.php
001 <?php
002 /***************************************************************************
003 sendpmsg.php - description
004 -------------------
005 begin : Wed June 19 2000
006 copyright : (C) 2000 by James Atkinson
007 email : james@totalgeek.org
008
009 $Id: sendpmsg.php,v 1.10 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
022 /**
023 * sendpmsg.php - Nathan Codding
024 * - Used for sending private messages between users of the BB.
025 */
026 include('extention.inc');
027 include('functions.'.$phpEx);
028 include('config.'.$phpEx);
029 require('auth.'.$phpEx);
030 $pagetitle = "Send Private Message";
031 $pagetype = "sendprivmsg";
032 include('page_header.'.$phpEx);
033
034
035 if($submit) {
036 if($message == '') {
037 die("You must type a message to post. You cannot post an empty message, go back and enter a message");
038 }
039 if ($tousername == '') {
040 die("You must enter the username you want to send the message to. Go back and do so.");
041 }
042 $touserdata = get_userdata($tousername, $db);
043 if(!$touserdata[username]) {
044 die("The recipient does not exist.");
045 }
046
047 if (!$user_logged_in) { // don't check this stuff if we have a valid session..
048 if($fromusername == '' || $password == '') {
049 die("You must enter your username and password. Go back and do so.");
050 }
051
052 $md_pass = md5($password);
053 $fromuserdata = get_userdata($fromusername, $db);
054 if($md_pass != $fromuserdata["user_password"]) {
055 die("You have entered an incorrect password. Go back and try again.");
056 }
057 } else {
058 // we have a valid session..
059 $fromuserdata = $userdata; // fromuser = current user.
060 }
061
062 /* correct password or logged-in user, continuing with message send. */
063
064 if($allow_pmsg_html == 0 && !isset($html)) {
065 $message = htmlspecialchars($message);
066 }
067 if($sig) {
068 $message .= "<BR>-----------------<BR>" . $fromuserdata[user_sig];
069 }
070 if($allow_pmsg_bbcode == 1 && !isset($bbcode)) {
071 $message = bbencode($message);
072 }
073 $message = str_replace("\n", "<BR>", $message);
074 if(!$smile) {
075 $message = smile($message);
076 }
077 $message = make_clickable($message);
078 $message = addslashes($message);
079 $time = date("Y-m-d H:i");
080
081 $sql = "INSERT INTO priv_msgs (from_userid, to_userid, msg_time, msg_text) ";
082 $sql .= "VALUES ($fromuserdata[user_id], $touserdata[user_id], '$time', '$message')";
083
084 if(!mysql_query($sql, $db)) {
085 echo $sql . " : " . mysql_error() . "<br>";
086 die("Error - Could not enter data into the database. Please go back and try again");
087 }
088
089 echo "Message Posted.<br> \n";
090 echo "<a href=\"sendpmsg.$phpEx\">Send another message</a> <br> \n";
091 echo "<a href=\"index.$phpEx\">Forum index</a> <br> \n";
092
093 } else {
094
095 /* displaying the form */
096
097 ?>
098 <FORM ACTION="<?php echo $PHP_SELF?>" METHOD="POST">
099 <TABLE BORDER="0" CELLPADDING="1" CELLSPACEING="0" ALIGN="CENTER" VALIGN="TOP" WIDTH="95%"><TR><TD BGCOLOR="<?php echo $table_bgcolor?>">
100 <TABLE BORDER="0" CALLPADDING="1" CELLSPACEING="1" WIDTH="100%">
101 <TR BGCOLOR="<?php echo $color1?>" ALIGN="LEFT">
102 <TD width=25%><b>About Posting:</b></TD>
103 <TD>All <b>registered</b> users can post private messages</TD>
104 </TR>
105 <TR ALIGN="LEFT">
106 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>Your username:<b></TD>
107 <TD BGCOLOR="<?php echo $color2?>">
108 <?PHP
109 if ($user_logged_in) {
110 echo $userdata[username] . " \n";
111 } else {
112 echo "<INPUT TYPE=\"TEXT\" NAME=\"fromusername\" SIZE=\"25\" MAXLENGTH=\"40\" VALUE=\"$userdata[username]\"> \n";
113 }
114 ?>
115 </TD>
116 </TR>
117 <?PHP
118 if (!$user_logged_in) {
119 // no session, need a password.
120 echo " <TR ALIGN=\"LEFT\"> \n";
121 echo " <TD BGCOLOR=\"$color1\" width=25%><b>Password:</b></TD> \n";
122 echo " <TD BGCOLOR=\"$color2\"><INPUT TYPE=\"PASSWORD\" NAME=\"password\" SIZE=\"25\" MAXLENGTH=\"25\"></TD> \n";
123 echo " </TR> \n";
124 }
125 ?>
126 <TR ALIGN="LEFT">
127 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>To:<b></TD>
128 <TD BGCOLOR="<?php echo $color2?>"><INPUT TYPE="TEXT" NAME="tousername" SIZE="25" MAXLENGTH="40"></TD>
129 </TR>
130 <TR ALIGN="LEFT">
131 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>Message:</b><br><br>
132 <font size=-1>
133 <?php
134 echo "HTML is: ";
135 if($allow_pmsg_html == 1)
136 echo "On<BR>\n";
137 else
138 echo "Off<BR>\n";
139 echo "<a href=\"bbcode_ref.$phpEx\" TARGET=\"blank\">BBCode</a> is: ";
140 if($allow_pmsg_bbcode == 1)
141 echo "On<br>\n";
142 else
143 echo "Off<BR>\n";
144 ?>
145 </font></TD>
146 <TD BGCOLOR="<?php echo $color2?>"><TEXTAREA NAME="message" ROWS=10 COLS=45 WRAP="VIRTUAL"></TEXTAREA></TD>
147 </TR>
148 <TR ALIGN="LEFT">
149 <TD BGCOLOR="<?php echo $color1?>" width=25%><b>Options:</b></TD>
150 <TD BGCOLOR="<?php echo $color2?>" >
151 <?php
152 if($allow_pmsg_html == 1) {
153 ?>
154 <INPUT TYPE="CHECKBOX" NAME="html">Disable HTML in this message<BR>
155 <?php
156 }
157 ?>
158 <?php
159 if($allow_pmsg_bbcode == 1) {
160 ?>
161 <INPUT TYPE="CHECKBOX" NAME="bbcode">Disable <a href="bbcode_ref.<?php echo $phpEx?>" target="_blank"><i>BBCode</i></a> in this message<BR>
162 <?php
163 }
164 ?>
165
166 <INPUT TYPE="CHECKBOX" NAME="smile">Disable <a href="bb_smilies.<?php echo $phpEx?>" target="_blank"><i>smilies</i></a> in this message.<BR>
167 <?php
168 if($allow_sig == 1) {
169 ?>
170 <INPUT TYPE="CHECKBOX" NAME="sig">Show signature <font size=-2>(This can be altered or added in your profile)</font><BR>
171 <?php
172 }
173 ?>
174 </TD>
175 </TR>
176 <TR>
177 <TD BGCOLOR="<?php echo $color1?>" colspan=2 ALIGN="CENTER">
178 <INPUT TYPE="SUBMIT" NAME="submit" VALUE="Submit"> <INPUT TYPE="RESET" VALUE="Clear">
179 </TR>
180 </TABLE></TD></TR></TABLE>
181 </FORM>
182
183 <?php
184 }
185 require('page_tail.'.$phpEx);
186 ?>
187