mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-06 06:25:04 +02:00
Basic posting of messages, no reply, quote or edit yet
git-svn-id: file:///svn/phpbb/trunk@488 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f9b181e0ce
commit
fc9163db62
@ -248,14 +248,14 @@ CREATE TABLE phpbb_privmsgs (
|
||||
privmsgs_id int(11) NOT NULL auto_increment,
|
||||
privmsgs_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
privmsgs_subject varchar(255) DEFAULT '0' NOT NULL,
|
||||
privmsgs_from_groupid int(11) DEFAULT '0' NOT NULL,
|
||||
privmsgs_to_groupid int(11) DEFAULT '0' NOT NULL,
|
||||
privmsgs_from_userid int(11) DEFAULT '0' NOT NULL,
|
||||
privmsgs_to_userid int(11) DEFAULT '0' NOT NULL,
|
||||
privmsgs_date int(11) DEFAULT '0' NOT NULL,
|
||||
privmsgs_ip varchar(8) NOT NULL,
|
||||
privmsgs_bbcode_uid int(11) DEFAULT '0' NOT NULL,
|
||||
PRIMARY KEY (privmsgs_id),
|
||||
KEY privmsgs_from_groupid (privmsgs_from_groupid),
|
||||
KEY privmsgs_to_groupid (privmsgs_to_groupid)
|
||||
KEY privmsgs_from_userid (privmsgs_from_userid),
|
||||
KEY privmsgs_to_userid (privmsgs_to_userid)
|
||||
);
|
||||
|
||||
|
||||
@ -501,19 +501,3 @@ CREATE TABLE phpbb_words (
|
||||
replacement varchar(100) NOT NULL,
|
||||
PRIMARY KEY (word_id)
|
||||
);
|
||||
|
||||
# --------------------------------------------------------
|
||||
#
|
||||
# Table structure for table 'phpbb_auto_prune'
|
||||
#
|
||||
DROP TABLE IF EXISTS phpbb_auto_prune;
|
||||
|
||||
CREATE TABLE phpbb_auto_prune (
|
||||
prune_id int(10) NOT NULL auto_increment,
|
||||
forum_id int(11) NOT NULL,
|
||||
prune_days int(3) NOT NULL,
|
||||
last_pruned int(11),
|
||||
admin_id int(11) NOT NULL,
|
||||
PRIMARY KEY (prune_id)
|
||||
);
|
||||
|
||||
|
@ -266,15 +266,15 @@ CREATE TABLE phpbb_privmsgs (
|
||||
privmsgs_id int4 DEFAULT nextval('phpbb_privmsgs_id_seq'::text) NOT NULL,
|
||||
privmsgs_type int2 DEFAULT '0' NOT NULL,
|
||||
privmsgs_subject varchar(255) DEFAULT '0' NOT NULL,
|
||||
privmsgs_from_groupid int4 DEFAULT '0' NOT NULL,
|
||||
privmsgs_to_groupid int4 DEFAULT '0' NOT NULL,
|
||||
privmsgs_from_userid int4 DEFAULT '0' NOT NULL,
|
||||
privmsgs_to_userid int4 DEFAULT '0' NOT NULL,
|
||||
privmsgs_date int4 DEFAULT '0' NOT NULL,
|
||||
privmsgs_ip varchar(8) NOT NULL,
|
||||
privmsgs_bbcode_uid int4 DEFAULT '0' NOT NULL,
|
||||
CONSTRAINT phpbb_privmsgs_pkey PRIMARY KEY (privmsgs_id)
|
||||
);
|
||||
CREATE INDEX privmsgs_from_groupid_index ON phpbb_privmsgs (privmsgs_from_groupid);
|
||||
CREATE INDEX privmsgs_to_groupid_index ON phpbb_privmsgs (privmsgs_to_groupid);
|
||||
CREATE INDEX privmsgs_from_userid_index ON phpbb_privmsgs (privmsgs_from_userid);
|
||||
CREATE INDEX privmsgs_to_userid_index ON phpbb_privmsgs (privmsgs_to_userid);
|
||||
|
||||
|
||||
/* --------------------------------------------------------
|
||||
|
@ -198,6 +198,14 @@ $lang['To'] = "To";
|
||||
$lang['Date'] = "Date";
|
||||
$lang['Mark'] = "Mark";
|
||||
|
||||
$lang['No_to_user'] = "You must specify a username to send this message";
|
||||
$lang['No_such_user'] = "Sorry but no such user exists";
|
||||
|
||||
$lang['Message_sent'] = "Your message has been sent";
|
||||
|
||||
$lang['to_return_inbox'] = " to return to your Inbox"; // This follows a "Click HERE ... "
|
||||
$lang['to_return_index'] = " to return to the Forum Index"; // This follows a "Click HERE ... "
|
||||
|
||||
//
|
||||
// Profiles/Registration
|
||||
//
|
||||
|
@ -283,8 +283,6 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
$attach_sig = (isset($HTTP_POST_VARS['attach_sig'])) ? $HTTP_POST_VARS['attach_sig'] : $userdata['user_attachsig'];
|
||||
$preview = (isset($HTTP_POST_VARS['preview'])) ? TRUE : FALSE;
|
||||
|
||||
$username = (isset($HTTP_POST_VARS['username'])) ? $HTTP_POST_VARS['username'] : "";
|
||||
|
||||
if($mode == "reply" || $mode == "edit")
|
||||
{
|
||||
if(!empty($HTTP_GET_VARS[POST_POST_URL]))
|
||||
@ -298,7 +296,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
}
|
||||
}
|
||||
|
||||
if!empty($HTTP_GET_VARS[POST_USERS_URL]))
|
||||
if(!empty($HTTP_GET_VARS[POST_USERS_URL]) && !$preview && empty($HTTP_POST_VARS['submit']))
|
||||
{
|
||||
$sql = "SELECT username
|
||||
FROM " . USERS_TABLE . "
|
||||
@ -310,9 +308,18 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
}
|
||||
else
|
||||
{
|
||||
list($username) = $db->sql_fetchrow($result);
|
||||
list($to_username) = $db->sql_fetchrow($result);
|
||||
$to_username = stripslashes($to_username);
|
||||
}
|
||||
}
|
||||
else if(!empty($HTTP_POST_VARS['to_username']))
|
||||
{
|
||||
$to_username = stripslashes($HTTP_POST_VARS['to_username']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$to_username = "";
|
||||
}
|
||||
|
||||
if($HTTP_POST_VARS['submit'] || $preview)
|
||||
{
|
||||
@ -361,6 +368,9 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
$smile_on = ($disable_smilies) ? FALSE : TRUE;
|
||||
|
||||
$message = prepare_message($HTTP_POST_VARS['message'], $html_on, $bbcode_on, $smile_on, $uid);
|
||||
$message = preg_replace('#</textarea>#si', '</TEXTAREA>', $message);
|
||||
|
||||
$uid = make_bbcode_uid();
|
||||
|
||||
if($attach_sig && !empty($userdata['user_sig']))
|
||||
{
|
||||
@ -371,6 +381,7 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
{
|
||||
// do stripslashes incase magic_quotes is on.
|
||||
$message = stripslashes($HTTP_POST_VARS['message']);
|
||||
$message = preg_replace('#</textarea>#si', '</TEXTAREA>', $message);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -383,9 +394,20 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
$error_msg .= $lang['Empty_msg'];
|
||||
}
|
||||
|
||||
if(!empty($HTTP_POST_VARS['to_userid']))
|
||||
if(!empty($HTTP_POST_VARS['to_username']))
|
||||
{
|
||||
$to_user_id = $HTTP_POST_VARS['to_userid'];
|
||||
$sql = "SELECT user_id
|
||||
FROM " . USERS_TABLE . "
|
||||
WHERE username = '" . addslashes($to_username) . "'";
|
||||
if(!$result = $db->sql_query($sql))
|
||||
{
|
||||
$error = TRUE;
|
||||
$error_msg = $lang['No_such_user'];
|
||||
}
|
||||
else
|
||||
{
|
||||
list($to_userid) = $db->sql_fetchrow($result);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -397,10 +419,12 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
$error_msg .= $lang['No_to_user'];
|
||||
}
|
||||
|
||||
if($HTTP_POST_VARS['submit'] && !$preview)
|
||||
if($HTTP_POST_VARS['submit'] && !$preview && $mode == "post")
|
||||
{
|
||||
$msg_time = get_gmt_ts();
|
||||
|
||||
$sql = "INSERT INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_bbcode_uid)
|
||||
VALUES (" . PRIVMSGS_SENT_MAIL . ", '" . stripslashes($privmsg['privmsgs_subject']) . "', " . $privmsg['privmsgs_from_userid'] . ", " . $privmsg['privmsgs_to_userid'] . ", " . $privmsg['privmsgs_date'] . ", '" . $privmsg['privmsgs_ip'] . "', '" . $privmsg['privmsgs_bbcode_uid'] . "')";
|
||||
VALUES (" . PRIVMSGS_NEW_MAIL . ", '$subject', " . $userdata['user_id'] . ", $to_userid, $msg_time, '$user_ip', '$uid')";
|
||||
if(!$pm_sent_status = $db->sql_query($sql))
|
||||
{
|
||||
error_die(SQL_QUERY, "Could not insert private message sent info.", __LINE__, __FILE__);
|
||||
@ -410,16 +434,26 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
$privmsg_sent_id = $db->sql_nextid($pm_sent_status);
|
||||
|
||||
$sql = "INSERT INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_text)
|
||||
VALUES ($privmsg_sent_id, '" . stripslashes($privmsg['privmsgs_text']) . "')";
|
||||
VALUES ($privmsg_sent_id, '$message')";
|
||||
if(!$pm_sent_text_status = $db->sql_query($sql))
|
||||
{
|
||||
error_die(SQL_QUERY, "Could not insert private message sent text.", __LINE__, __FILE__);
|
||||
}
|
||||
|
||||
include('includes/page_header.'.$phpEx);
|
||||
|
||||
$msg = $lang['Message_sent'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("privmsg.$phpEx?folder=inbox") . "\">" . $lang['Here'] . "</a> " . $lang['to_return_inbox'] . "<br /><br />" . $lang['Click'] . " <a href=\"" . append_sid("index.$phpEx") . "\">" . $lang['Here'] . "</a> ". $lang['to_return_index'];
|
||||
|
||||
$template->set_filenames(array(
|
||||
"reg_header" => "error_body.tpl")
|
||||
);
|
||||
$template->assign_vars(array(
|
||||
"ERROR_MESSAGE" => $msg)
|
||||
);
|
||||
$template->pparse("reg_header");
|
||||
|
||||
include('includes/page_tail.'.$phpEx);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -548,9 +582,13 @@ else if($mode == "post" || $mode == "reply" || $mode == "edit")
|
||||
$post_a = $lang['Edit_Post'];
|
||||
}
|
||||
|
||||
$subject_input = '<input type="text" name="subject" value="'.$subject.'" size="50" maxlength="255">';
|
||||
$message_input = '<textarea name="message" rows="10" cols="40" wrap="virtual">'.$message.'</textarea>';
|
||||
|
||||
$hidden_form_fields = "<input type=\"hidden\" name=\"mode\" value=\"$mode\"><input type=\"hidden\" name=\"folder\" value=\"$folder\">";
|
||||
|
||||
$template->assign_vars(array(
|
||||
"S_USERNAME_INPUT" => "<input type=\"text\" name=\"to_username\" value=\"$to_username\">",
|
||||
"SUBJECT_INPUT" => $subject_input,
|
||||
"MESSAGE_INPUT" => $message_input,
|
||||
"HTML_STATUS" => $html_status,
|
||||
|
55
phpBB/templates/PSO/privmsgs_posting_body.tpl
Normal file
55
phpBB/templates/PSO/privmsgs_posting_body.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
<div align="center"><table width="80%" cellspacing="0" cellpadding="4" border="0">
|
||||
<tr>
|
||||
<td align="left"><font face="{T_FONTFACE1}" size="{T_FONTSIZE1}" color="{T_FONTCOLOR1}"><a href="{U_INDEX}">{SITENAME} {L_INDEX}</a></font></td>
|
||||
</tr>
|
||||
</table></div>
|
||||
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
function insertCode(formObj, selectObj){
|
||||
formObj.message.value += selectObj.options[selectObj.selectedIndex].value;
|
||||
return;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
<div align="center"><table width="80%" cellpadding="1" cellspacing="0" border="0">
|
||||
<tr><form action="{S_POST_ACTION}" method="POST">
|
||||
<td bgcolor="{T_TH_COLOR1}"><table border="0" cellpadding="3" cellspacing="1" width="100%">
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="{T_TH_COLOR3}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{L_POST_A}</b></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{L_USERNAME}</b></font></td>
|
||||
<td bgcolor="{T_TD_COLOR2}"><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}">{S_USERNAME_INPUT}</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{L_SUBJECT}</b></font></td>
|
||||
<td bgcolor="{T_TD_COLOR2}"><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}">{SUBJECT_INPUT}</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{L_MESSAGE_BODY}</b></font><br><br><font face="{T_FONTFACE1}" size="{T_FONTSIZE1}">{HTML_STATUS}<br>{BBCODE_STATUS}</font></td>
|
||||
<td bgcolor="{T_TD_COLOR2}"><table width="100%" cellspacing="0" cellpadding="0" border="0">
|
||||
<tr>
|
||||
<td><font face="{T_FONTFACE3}" size="{T_FONTSIZE2}">{MESSAGE_INPUT}</font></td>
|
||||
<td valign="top"> <font face="{T_FONTFACE2}" size="{T_FONTSIZE1}">BBcodes:</font><br><font face="{T_FONTFACE3}" size="{T_FONTSIZE1}"><select class="small" name="addbbcode" size="6" onchange="insertCode(this.form, this);"> <option value="[b][/b]">[b] [/b]</option> <option value="[i][/i]">[i] [/i]</option> <option value="[quote][/quote]">[quote] [/quote]</option> <option value="[code][/code]">[code] [/code]</option> <option value="[list][/list]">[list] [/list]</option> <option value="[list=][/list]">[list=] [/list]</option> <option value="[img][/img]">[img] [/img]</option> <option value="[url][/url]">[url] [/url]</option></select></font><br clear="all"> <font face="{T_FONTFACE2}" size="{T_FONTSIZE1}">Smiley codes:</font><br><font face="{T_FONTFACE3}" size="{T_FONTSIZE1}"><select class="small" name="addsmiley" size="1" onchange="insertCode(this.form, this);"> <option value=":)">Smiley</option> <option value=":(">Frown</option> <option value=":d">Big Grin</option> <option value=";)">Wink</option> <option value=":o">Eek!</option> <option value="8)">Cool</option> <option value=":?">Confused</option> <option value=":p">Razz</option> <option value=":|">Mad</option></select></font></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td bgcolor="{T_TD_COLOR1}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}"><b>{L_OPTIONS}</b></font></td>
|
||||
<td bgcolor="{T_TD_COLOR2}"><font face="{T_FONTFACE1}" size="{T_FONTSIZE2}">{HTML_TOGGLE}<br>{BBCODE_TOGGLE}<br>{SMILE_TOGGLE}<br>{SIG_TOGGLE}</font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" bgcolor="{T_TH_COLOR3}" align="center">{S_HIDDEN_FORM_FIELDS}<input type="submit" name="preview" value="{L_PREVIEW}"> <input type="submit" name="submit" value="{L_SUBMIT}"> <input type="submit" name="cancel" value="{L_CANCEL}"></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
</form></tr>
|
||||
</table></div>
|
||||
|
||||
<div align="center"><table cellspacing="2" border="0" width="80%">
|
||||
<tr>
|
||||
<td valign="top"><font face="{T_FONTFACE1}" size="{T_FONTSIZE1}"><b>{S_TIMEZONE}</b></font></td>
|
||||
<td align="right" valign="top" nowrap>{JUMPBOX}</td>
|
||||
</tr>
|
||||
</table></div>
|
Loading…
x
Reference in New Issue
Block a user