Email form - free with purchase of any two other items

git-svn-id: file:///svn/phpbb/trunk@1316 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2001-11-15 16:26:41 +00:00
parent 01488dc03b
commit 0ed25deb63
13 changed files with 338 additions and 71 deletions

View file

@ -486,6 +486,7 @@ CREATE TABLE phpbb_users (
user_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL, user_dateformat varchar(14) DEFAULT 'd M Y H:i' NOT NULL,
user_style int(11), user_style int(11),
user_lang varchar(255), user_lang varchar(255),
user_emailtime int(11),
user_viewemail tinyint(1), user_viewemail tinyint(1),
user_attachsig tinyint(1), user_attachsig tinyint(1),
user_allowhtml tinyint(1), user_allowhtml tinyint(1),

View file

@ -464,6 +464,7 @@ CREATE TABLE phpbb_users (
user_yim varchar(255), user_yim varchar(255),
user_msnm varchar(255), user_msnm varchar(255),
user_posts int4 DEFAULT '0' NOT NULL, user_posts int4 DEFAULT '0' NOT NULL,
user_emailtime int4,
user_viewemail int2, user_viewemail int2,
user_attachsig int2, user_attachsig int2,
user_allowhtml int2, user_allowhtml int2,

View file

@ -725,8 +725,7 @@ else if( $group_id )
if( !empty($group_members[$i]['user_viewemail']) ) if( !empty($group_members[$i]['user_viewemail']) )
{ {
$email_addr = str_replace("@", " at ", $group_members[$i]['user_email']); $email_img = ( $group_members[$i]['user_viewemail'] ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL ."=" . $group_members[$i]['user_id']) . "\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
$email_img = ( $group_members[$i]['user_viewemail'] ) ? "<a href=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
} }
else else
{ {
@ -881,8 +880,7 @@ else if( $group_id )
if( !empty($modgroup_pending_list[$i]['user_viewemail']) ) if( !empty($modgroup_pending_list[$i]['user_viewemail']) )
{ {
$email_addr = str_replace("@", " at ", $modgroup_pending_list[$i]['user_email']); $email_img = ( $modgroup_pending_list[$i]['user_viewemail'] ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL ."=" . $modgroup_pending_list[$i]['user_id']) . "\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
$email_img = ( $modgroup_pending_list[$i]['user_viewemail'] ) ? "<a href=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
} }
else else
{ {

View file

@ -0,0 +1,12 @@
Hello {TO_USERNAME},
The following is an email sent to you by {FROM_USERNAME} via your account on {SITENAME}. If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address:
{BOARD_EMAIL}
Include this full email (particularly the headers). Please note that the reply address to this email has been set to that of {FROM_USERNAME}.
Message sent to you follows
~~~~~~~~~~~~~~~~~~~~~~~~~~~
{MESSAGE}

View file

@ -62,9 +62,6 @@ $lang['Password'] = "Password";
$lang['Email'] = "Email"; $lang['Email'] = "Email";
$lang['Poster'] = "Poster"; $lang['Poster'] = "Poster";
$lang['Author'] = "Author"; $lang['Author'] = "Author";
$lang['is'] = "is";
$lang['are'] = "are";
$lang['by'] = "by";
$lang['Time'] = "Time"; $lang['Time'] = "Time";
$lang['Hour'] = "Hour"; $lang['Hour'] = "Hour";
$lang['Hours'] = "Hours"; $lang['Hours'] = "Hours";
@ -88,18 +85,15 @@ $lang['Years'] = "Years";
$lang['Enabled'] = "Enabled"; $lang['Enabled'] = "Enabled";
$lang['Disabled'] = "Disabled"; $lang['Disabled'] = "Disabled";
$lang['Next'] = "Next"; $lang['Next'] = "Next";
$lang['Previous'] = "Previous"; $lang['Previous'] = "Previous";
$lang['Goto_page'] = "Goto page"; $lang['Goto_page'] = "Goto page";
$lang['Page'] = "Page"; // Followed by the current page number then 'of x' where x is total pages
$lang['Pages'] = "Pages";
$lang['IP_Address'] = "IP Address"; $lang['IP_Address'] = "IP Address";
$lang['View_latest_post'] = "View latest post"; $lang['View_latest_post'] = "View latest post";
$lang['Page_of'] = "Page <b>%d</b> of <b>%d</b>"; // Replaces with: Page 1 of 2 for example $lang['Page_of'] = "Page <b>%d</b> of <b>%d</b>"; // Replaces with: Page 1 of 2 for example
$lang['Page'] = "Page"; // Followed by the current page number then 'of x' where x is total pages
$lang['Pages'] = "Pages";
$lang['of'] = "of"; // See Page above
$lang['Submit'] = "Submit"; $lang['Submit'] = "Submit";
$lang['Reset'] = "Reset"; $lang['Reset'] = "Reset";
@ -216,8 +210,8 @@ $lang['Rules_reply_can'] = "You <b>can</b> reply to topics in this forum";
$lang['Rules_reply_cannot'] = "You <b>cannot</b> reply to topics in this forum"; $lang['Rules_reply_cannot'] = "You <b>cannot</b> reply to topics in this forum";
$lang['Rules_edit_can'] = "You <b>can</b> edit your posts in this forum"; $lang['Rules_edit_can'] = "You <b>can</b> edit your posts in this forum";
$lang['Rules_edit_cannot'] = "You <b>cannot</b> edit your posts in this forum"; $lang['Rules_edit_cannot'] = "You <b>cannot</b> edit your posts in this forum";
$lang['Rules_delete_can'] = "You <b>can</b> delete posts in this forum"; $lang['Rules_delete_can'] = "You <b>can</b> delete your posts in this forum";
$lang['Rules_delete_cannot'] = "You <b>cannot</b> delete posts in this forum"; $lang['Rules_delete_cannot'] = "You <b>cannot</b> delete your posts in this forum";
$lang['Rules_vote_can'] = "You <b>can</b> vote in polls in this forum"; $lang['Rules_vote_can'] = "You <b>can</b> vote in polls in this forum";
$lang['Rules_vote_cannot'] = "You <b>cannot</b> vote in polls in this forum"; $lang['Rules_vote_cannot'] = "You <b>cannot</b> vote in polls in this forum";
$lang['Rules_moderate'] = "You <b>can</b> %smoderate this forum%s"; // %s replaced by a href $lang['Rules_moderate'] = "You <b>can</b> %smoderate this forum%s"; // %s replaced by a href
@ -294,6 +288,7 @@ $lang['Confirm_delete'] = "Are you sure you want to delete this post?";
$lang['Confirm_delete_poll'] = "Are you sure you want to delete this poll?"; $lang['Confirm_delete_poll'] = "Are you sure you want to delete this poll?";
$lang['Submit_post'] = "Submit Post"; $lang['Submit_post'] = "Submit Post";
$lang['Preview'] = "Preview"; $lang['Preview'] = "Preview";
$lang['Spellcheck'] = "Spellcheck";
$lang['Cancel_post'] = "Cancel post"; $lang['Cancel_post'] = "Cancel post";
$lang['Flood_Error'] = "You cannot make another post so soon after your last, please try again in a short while"; $lang['Flood_Error'] = "You cannot make another post so soon after your last, please try again in a short while";
@ -326,16 +321,20 @@ $lang['Poll_for'] = "Run poll for";
$lang['Poll_for_explain'] = "[ Enter 0 or leave blank for a never ending poll ]"; $lang['Poll_for_explain'] = "[ Enter 0 or leave blank for a never ending poll ]";
$lang['Delete_poll'] = "Delete Poll"; $lang['Delete_poll'] = "Delete Poll";
$lang['Disable_HTML_post'] = "Disable HTML in this post";
$lang['Disable_BBCode_post'] = "Disable BBCode in this post";
$lang['Disable_Smilies_post'] = "Disable Smilies in this post";
$lang['HTML_is_ON'] = "HTML is <u>ON</u>";
$lang['HTML_is_OFF'] = "HTML is <u>OFF</u>";
$lang['BBCode_is_ON'] = "BBCode is <u>ON</u>";
$lang['BBCode_is_OFF'] = "BBCode is <u>OFF</u>";
$lang['Smilies_are_ON'] = "Smilies are <u>ON</u>";
$lang['Smilies_are_OFF'] = "Smilies are <u>OFF</u>";
$lang['Attach_signature'] = "Attach signature (signatures can be changed in profile)"; $lang['Attach_signature'] = "Attach signature (signatures can be changed in profile)";
$lang['Disable'] = "Disable "; // This is followed by a type, eg. HTML, Smilies, etc. and then 'on this post'
$lang['HTML'] = "HTML";
$lang['BBCode'] = "BBCode";
$lang['Smilies'] = "Smilies";
$lang['in_this_post'] = " in this post";
$lang['Notify'] = "Notify me when a reply is posted"; $lang['Notify'] = "Notify me when a reply is posted";
$lang['Delete_post'] = "Delete this post"; $lang['Delete_post'] = "Delete this post";
$lang['is_ON'] = " is ON"; // this goes after either BBCode or HTML
$lang['is_OFF'] = " is OFF"; // see above
$lang['wrote'] = "wrote"; // proceeds the username and is followed by the quoted text $lang['wrote'] = "wrote"; // proceeds the username and is followed by the quoted text
$lang['Quote'] = "Quote"; // comes before bbcode quote output. $lang['Quote'] = "Quote"; // comes before bbcode quote output.
@ -477,11 +476,6 @@ $lang['Confirm_password'] = "Confirm password";
$lang['password_if_changed'] = "You only need to supply a password if you want to change it"; $lang['password_if_changed'] = "You only need to supply a password if you want to change it";
$lang['password_confirm_if_changed'] = "You only need to confirm your password if you changed it above"; $lang['password_confirm_if_changed'] = "You only need to confirm your password if you changed it above";
$lang['is'] = "is"; // follows HTML or BBCode
$lang['are'] = "are"; // follows Smilies
$lang['OFF'] = "OFF";
$lang['ON'] = "ON";
$lang['Avatar'] = "Avatar"; $lang['Avatar'] = "Avatar";
$lang['Avatar_explain'] = "Displays a small graphic image below your details in posts. Only one image can be displayed at a time, its width can be no greater than " . $board_config['avatar_max_width'] . " pixels, a height no greater than " . $board_config['avatar_max_height'] . " pixels and a file size no more than " . (round($board_config['avatar_filesize'] / 1024)) . " kB."; $lang['Avatar_explain'] = "Displays a small graphic image below your details in posts. Only one image can be displayed at a time, its width can be no greater than " . $board_config['avatar_max_width'] . " pixels, a height no greater than " . $board_config['avatar_max_height'] . " pixels and a file size no more than " . (round($board_config['avatar_filesize'] / 1024)) . " kB.";
$lang['Upload_Avatar_file'] = "Upload Avatar from your machine"; $lang['Upload_Avatar_file'] = "Upload Avatar from your machine";
@ -539,6 +533,18 @@ $lang['No_email_match'] = "The email address you supplied does not match the one
$lang['New_password_activation'] = "New password activation"; $lang['New_password_activation'] = "New password activation";
$lang['Password_activated'] = "Your account has been re-activated. To logon please use the password supplied in the email you received"; $lang['Password_activated'] = "Your account has been re-activated. To logon please use the password supplied in the email you received";
$lang['Send_email_msg'] = "Send an email message";
$lang['No_user_specified'] = "No user was specified";
$lang['User_prevent_email'] = "This user does not wish to receive email. Try sending them a private message";
$lang['User_not_exist'] = "That user does not exist";
$lang['CC_email'] = "Send a copy of this email to yourself";
$lang['Email_message_desc'] = "This message will be sent as plain text, do not include any HTML or BBCode. The return address for this message will be set to your email address.";
$lang['Flood_email_limit'] = "You cannot send another email at this time, try again later";
$lang['Recipient'] = "Recipient";
$lang['Email_sent'] = "The email has been sent";
$lang['Send_email'] = "Send email";
$lang['Empty_subject_email'] = "You must specify a subject for the email";
$lang['Empty_message_email'] = "You must enter a message to be emailed";
// //
// Memberslist // Memberslist

View file

@ -187,8 +187,7 @@ if(($selected_members = $db->sql_numrows($result)) > 0)
if( !empty($members[$i]['user_viewemail']) ) if( !empty($members[$i]['user_viewemail']) )
{ {
$altered_email = str_replace("@", " at ", $members[$i]['user_email']); $email_img = "<a href=\"" . append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL ."=$user_id") . "\"><img src=\"" . $images['icon_email'] . "\" border=\"0\" alt=\"" . $lang['Send_an_email'] . "\" /></a>";
$email_img = "<a href=\"mailto:$altered_email\"><img src=\"" . $images['icon_email'] . "\" border=\"0\" alt=\"" . $lang['Send_an_email'] . "\" /></a>";
} }
else else
{ {

View file

@ -2579,12 +2579,12 @@ if( !$userdata['session_logged_in'] || ( $mode == "editpost" && $post_user_id ==
// //
if( $board_config['allow_html'] ) if( $board_config['allow_html'] )
{ {
$html_status = $lang['ON']; $html_status = $lang['HTML_is_ON'];
$template->assign_block_vars("html_checkbox", array()); $template->assign_block_vars("html_checkbox", array());
} }
else else
{ {
$html_status = $lang['OFF']; $html_status = $lang['HTML_is_OFF'];
} }
// //
@ -2592,12 +2592,12 @@ else
// //
if($board_config['allow_bbcode']) if($board_config['allow_bbcode'])
{ {
$bbcode_status = $lang['ON']; $bbcode_status = $lang['BBCode_is_ON'];
$template->assign_block_vars("bbcode_checkbox", array()); $template->assign_block_vars("bbcode_checkbox", array());
} }
else else
{ {
$bbcode_status = $lang['OFF']; $bbcode_status = $lang['BBCode_is_OFF'];
} }
// //
@ -2605,12 +2605,12 @@ else
// //
if($board_config['allow_smilies']) if($board_config['allow_smilies'])
{ {
$smilies_status = $lang['ON']; $smilies_status = $lang['Smilies_are_ON'];
$template->assign_block_vars("smilies_checkbox", array()); $template->assign_block_vars("smilies_checkbox", array());
} }
else else
{ {
$smilies_status = $lang['OFF']; $smilies_status = $lang['Smilies_are_OFF'];
} }
// //
@ -2717,15 +2717,13 @@ $template->assign_vars(array(
"L_MESSAGE_BODY" => $lang['Message_body'], "L_MESSAGE_BODY" => $lang['Message_body'],
"L_OPTIONS" => $lang['Options'], "L_OPTIONS" => $lang['Options'],
"L_PREVIEW" => $lang['Preview'], "L_PREVIEW" => $lang['Preview'],
"L_SPELLCHECK" => $lang['Specllcheck'],
"L_SUBMIT" => $lang['Submit_post'], "L_SUBMIT" => $lang['Submit_post'],
"L_CANCEL" => $lang['Cancel_post'], "L_CANCEL" => $lang['Cancel_post'],
"L_CONFIRM_DELETE" => $lang['Confirm_delete'], "L_CONFIRM_DELETE" => $lang['Confirm_delete'],
"L_HTML_IS" => $lang['HTML'] . " " . $lang['is'], "L_DISABLE_HTML" => $lang['Disable_HTML_post'],
"L_BBCODE_IS" => $lang['BBCode'] . " " . $lang['is'], "L_DISABLE_BBCODE" => $lang['Disable_BBCode_post'],
"L_SMILIES_ARE" => $lang['Smilies'] . " " . $lang['are'], "L_DISABLE_SMILIES" => $lang['Disable_Smilies_post'],
"L_DISABLE_HTML" => $lang['Disable'] . $lang['HTML'] . $lang['in_this_post'],
"L_DISABLE_BBCODE" => $lang['Disable'] . $lang['BBCode'] . $lang['in_this_post'],
"L_DISABLE_SMILIES" => $lang['Disable'] . $lang['Smilies'] . $lang['in_this_post'],
"L_ATTACH_SIGNATURE" => $lang['Attach_signature'], "L_ATTACH_SIGNATURE" => $lang['Attach_signature'],
"L_NOTIFY_ON_REPLY" => $lang['Notify'], "L_NOTIFY_ON_REPLY" => $lang['Notify'],
"L_DELETE_POST" => $lang['Delete_post'], "L_DELETE_POST" => $lang['Delete_post'],

View file

@ -388,8 +388,7 @@ if( $mode == "read" )
$profile_img = "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$user_id_from") . "\"><img src=\"" . $images['icon_profile'] . "\" alt=\"" . $lang['Read_profile'] . " $username_from\" border=\"0\" /></a>"; $profile_img = "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . "=$user_id_from") . "\"><img src=\"" . $images['icon_profile'] . "\" alt=\"" . $lang['Read_profile'] . " $username_from\" border=\"0\" /></a>";
$email_addr = str_replace("@", " at ", $privmsg['user_email']); $email_img = ( $privmsg['user_viewemail'] ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL ."=$user_id_from") . "\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
$email_img = ($privmsg['user_viewemail'] && $email_addr != "" ) ? "<a href=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $username_from\" border=\"0\" /></a>" : "";
$www_img = ( $privmsg['user_website']) ? "<a href=\"" . $privmsg['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : ""; $www_img = ( $privmsg['user_website']) ? "<a href=\"" . $privmsg['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : "";

View file

@ -260,10 +260,10 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
if( $profiledata['user_viewemail'] && $profiledata['user_email'] != "" ) if( $profiledata['user_viewemail'] && $profiledata['user_email'] != "" )
{ {
// Replace the @ with 'at'. Some anti-spam mesures. $email_profile = append_sid("profile.$phpEx?mode=email&amp;" . POST_USERS_URL . "=" . $profiledata['user_id']);
$email_addr = str_replace("@", " at ", $profiledata['user_email']);
$email = "<a href=\"mailto:$email_addr\">$email_addr</a>"; $email = "<a href=\"$email_profile\">" . $lang['Send_email'] . "</a>";
$email_img = "<a href=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " " . $profiledata['username'] . "\" border=\"0\" /></a>"; $email_img = "<a href=\"$email_profile\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " " . $profiledata['username'] . "\" border=\"0\" /></a>";
} }
else else
{ {
@ -1410,9 +1410,9 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
$selected_template = $board_config['system_template']; $selected_template = $board_config['system_template'];
} }
$html_status = ($userdata['user_allowhtml']) ? $lang['ON'] : $lang['OFF']; $html_status = ($userdata['user_allowhtml']) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
$bbcode_status = ($userdata['user_allowbbcode']) ? $lang['ON'] : $lang['OFF']; $bbcode_status = ($userdata['user_allowbbcode']) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
$smilies_status = ($userdata['user_allowsmile']) ? $lang['ON'] : $lang['OFF']; $smilies_status = ($userdata['user_allowsmile']) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
$signature = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $signature); $signature = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $signature);
@ -1578,10 +1578,6 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
"L_PROFILE_INFO_NOTICE" => $lang['Profile_info_warn'], "L_PROFILE_INFO_NOTICE" => $lang['Profile_info_warn'],
"L_EMAIL_ADDRESS" => $lang['Email_address'], "L_EMAIL_ADDRESS" => $lang['Email_address'],
"L_HTML_IS" => $lang['HTML'] . " " . $lang['is'],
"L_BBCODE_IS" => $lang['BBCode'] . " " . $lang['is'],
"L_SMILIES_ARE" => $lang['Smilies'] . " " . $lang['are'],
"S_ALLOW_AVATAR_UPLOAD" => $board_config['allow_avatar_upload'], "S_ALLOW_AVATAR_UPLOAD" => $board_config['allow_avatar_upload'],
"S_ALLOW_AVATAR_LOCAL" => $board_config['allow_avatar_local'], "S_ALLOW_AVATAR_LOCAL" => $board_config['allow_avatar_local'],
"S_ALLOW_AVATAR_REMOTE" => $board_config['allow_avatar_remote'], "S_ALLOW_AVATAR_REMOTE" => $board_config['allow_avatar_remote'],
@ -1746,10 +1742,11 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{ {
$sql_update_pass = ""; $sql_update_pass = "";
} }
$sql_update = "UPDATE " . USERS_TABLE . "
$sql = "UPDATE " . USERS_TABLE . "
SET user_active = 1, user_actkey = ''" . $sql_update_pass . " SET user_active = 1, user_actkey = ''" . $sql_update_pass . "
WHERE user_id = " . $row['user_id']; WHERE user_id = " . $row['user_id'];
if($result = $db->sql_query($sql_update)) if( $result = $db->sql_query($sql) )
{ {
if( $board_config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == "" ) if( $board_config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == "" )
{ {
@ -1804,6 +1801,184 @@ if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
} }
break; break;
} }
else if( $mode == "email" )
{
if( !empty($HTTP_GET_VARS[POST_USERS_URL]) || !empty($HTTP_POST_VARS[POST_USERS_URL]) )
{
$user_id = ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) ? $HTTP_GET_VARS[POST_USERS_URL] : $HTTP_POST_VARS[POST_USERS_URL];
}
else
{
message_die(GENERAL_MESSAGE, $lang['No_user_specified']);
}
if( !$userdata['session_logged_in'] )
{
header("Location: " . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
}
$sql = "SELECT username, user_email, user_viewemail, user_emailtime, user_sig, user_sig_bbcode_uid
FROM " . USERS_TABLE . "
WHERE user_id = $user_id";
if( $result = $db->sql_query($sql) )
{
$row = $db->sql_fetchrow($result);
$username = $row['username'];
$user_email = $row['user_email'];
$user_sig = $row['user_sig'];
$user_sig_bbcode_uid = $row['user_sig_bbcode_uid'];
if( $row['user_viewemail'] )
{
if( time() - $row['user_emailtime'] < $board_config['flood_interval'] )
{
message_die(GENERAL_MESSAGE, $lang['Flood_email_limit']);
}
if( isset($HTTP_POST_VARS['submit']) )
{
$error = FALSE;
if( !empty($HTTP_POST_VARS['subject']) )
{
$subject = trim(strip_tags($HTTP_POST_VARS['subject']));
}
else
{
$error = TRUE;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Empty_subject_email'] : $lang['Empty_subject_email'];
}
if( !empty($HTTP_POST_VARS['message']) )
{
$message = trim(strip_tags($HTTP_POST_VARS['message']));
}
else
{
$error = TRUE;
$error_msg = ( !empty($error_msg) ) ? $error_msg . "<br />" . $lang['Empty_message_email'] : $lang['Empty_message_email'];
}
if( !$error )
{
$sql = "UPDATE " . USERS_TABLE . "
SET user_emailtime = " . time() . "
WHERE user_id = " . $userdata['user_id'];
if( $result = $db->sql_query($sql) )
{
$server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_SERVER_VARS['SERVER_NAME'];
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
$email_headers = "From: " . $userdata['user_email'] . "\n";
if( !empty($HTTP_POST_VARS['cc_email']) )
{
$email_headers .= "Cc: " . $userdata['user_email'] . "\n";
}
$email_headers .= "Return-Path: " . $userdata['user_email'] . "\n";
$email_headers .= "X-AntiAbuse: Board servername - " . $server_name . "\n";
$email_headers .= "X-AntiAbuse: User_id - " . $user_id . "\n";
$email_headers .= "X-AntiAbuse: Username - " . $username . "\n";
$email_headers .= "X-AntiAbuse: User IP - " . decode_ip($user_ip) . "\r\n";
$emailer->use_template("profile_send_email");
$emailer->email_address($user_email);
$emailer->set_subject($subject);
$emailer->extra_headers($email_headers);
$emailer->assign_vars(array(
"SITENAME" => $board_config['sitename'],
"BOARD_EMAIL" => $board_config['board_email'],
"FROM_USERNAME" => $userdata['username'],
"TO_USERNAME" => $username,
"MESSAGE" => $message)
);
$emailer->send();
$emailer->reset();
$template->assign_vars(array(
"META" => '<meta http-equiv="refresh" content="5;url=' . append_sid("index.$phpEx") . '">')
);
$message = $lang['Email_sent'] . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
message_die(GENERAL_MESSAGE, $message);
}
else
{
message_die(GENERAL_ERROR, "Couldn't update last email time", "", __LINE__, __FILE__, $sql);
}
}
}
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$template->set_filenames(array(
"body" => "profile_send_email.tpl",
"jumpbox" => "jumpbox.tpl")
);
$jumpbox = make_jumpbox();
$template->assign_vars(array(
"L_GO" => $lang['Go'],
"L_JUMP_TO" => $lang['Jump_to'],
"L_SELECT_FORUM" => $lang['Select_forum'],
"S_JUMPBOX_LIST" => $jumpbox,
"S_JUMPBOX_ACTION" => append_sid("viewforum.$phpEx"))
);
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
if( $error )
{
$template->set_filenames(array(
"reg_header" => "error_body.tpl")
);
$template->assign_vars(array(
"ERROR_MESSAGE" => $error_msg)
);
$template->assign_var_from_handle("ERROR_BOX", "reg_header");
}
if( $userdata['user_sig'] != "" )
{
$template->assign_block_vars("signature_checkbox", array());
}
$template->assign_vars(array(
"USERNAME" => $username,
"S_SIGNATURE_CHECKED" => ( $attach_sig ) ? "checked=\"checked\"" : "",
"S_POST_ACTION" => append_sid("profile.$phpEx?&amp;mode=email&amp;" . POST_USERS_URL . "=$user_id"),
"L_SEND_EMAIL_MSG" => $lang['Send_email_msg'],
"L_RECIPIENT" => $lang['Recipient'],
"L_SUBJECT" => $lang['Subject'],
"L_MESSAGE_BODY" => $lang['Message_body'],
"L_MESSAGE_BODY_DESC" => $lang['Email_message_desc'],
"L_OPTIONS" => $lang['Options'],
"L_CC_EMAIL" => $lang['CC_email'],
"L_NOTIFY_ON_REPLY" => $lang['Notify'],
"L_SPELLCHECK" => $lang['Spellcheck'],
"L_SEND_EMAIL" => $lang['Send_email'])
);
$template->pparse("body");
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
else
{
message_die(GENERAL_MESSAGE, $lang['User_prevent_email']);
}
}
else
{
message_die(GENERAL_MESSAGE, $lang['User_not_exist']);
}
}
} }
?> ?>

View file

@ -355,10 +355,7 @@ function bbstyle(formObj, bbnumber) {
</span></td> </span></td>
</tr> </tr>
<tr> <tr>
<td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /> <td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span><br /><span class="gensmall">{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
<span class="gensmall">{L_HTML_IS} <u>{HTML_STATUS}</u><br />
{L_BBCODE_IS} <u>{BBCODE_STATUS}</u><br />
{L_SMILIES_ARE} <u>{SMILIES_STATUS}</u></span></td>
<td class="row2"><span class="gen"> </span> <td class="row2"><span class="gen"> </span>
<table cellspacing="0" cellpadding="1" border="0"> <table cellspacing="0" cellpadding="1" border="0">
<!-- BEGIN html_checkbox --> <!-- BEGIN html_checkbox -->
@ -424,7 +421,7 @@ function bbstyle(formObj, bbnumber) {
<!-- Spell checker option part 2: You must sign up for free at www.spellchecker.net to use this option --> <!-- Spell checker option part 2: You must sign up for free at www.spellchecker.net to use this option -->
<!-- Change the path in the onclick function to point to your files you got once signed up at Spellchecker.net --> <!-- Change the path in the onclick function to point to your files you got once signed up at Spellchecker.net -->
<!-- Remember to uncomment the link to the javascript file at the top of this template --> <!-- Remember to uncomment the link to the javascript file at the top of this template -->
<!-- input type="button" tabindex="4" class="liteoption" name="spellcheck" value="Spell Check" onClick= "doSpell ('uk', document.post.message, document.location.protocol + '//' + document.location.host + '/phpBB/spellcheck/sproxy.php', true);" / --> <!-- input type="button" tabindex="4" class="liteoption" name="spellcheck" value="{L_SPELLCHECK}" onClick= "doSpell ('uk', document.post.message, document.location.protocol + '//' + document.location.host + '/phpBB/spellcheck/sproxy.php', true);" / -->
<!-- End spellchecker option --> <!-- End spellchecker option -->
&nbsp; &nbsp;
<input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" /> <input type="submit" tabindex="5" name="preview" class="mainoption" value="{L_PREVIEW}" />

View file

@ -108,12 +108,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /> <td class="row1"><span class="gen">{L_SIGNATURE}:</span><br /><span class="gensmall">{L_SIGNATURE_EXPLAIN}<br /><br />{HTML_STATUS}<br />{BBCODE_STATUS}<br />{SMILIES_STATUS}</span></td>
<span class="gensmall">{L_SIGNATURE_EXPLAIN}<br />
<br />
{L_HTML_IS} <u>{HTML_STATUS}</u><br />
{L_BBCODE_IS} <u>{BBCODE_STATUS}</u><br />
{L_SMILIES_ARE} <u>{SMILIES_STATUS}</u></span></td>
<td class="row2"> <td class="row2">
<textarea name="signature"style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea> <textarea name="signature"style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>
</td> </td>

View file

@ -0,0 +1,86 @@
<!-- Spell checker option part 1: You must sign up for free at www.spellchecker.net to use this option -->
<!-- Change the path to point to the file you got once signed up at Spellchecker.net -->
<!-- Remember to uncomment the spellchecker button near the end of this template -->
<script type="text/javascript" language="javascript" src=spellcheck/spch.js></script>
<!-- End spellchecker option -->
<script language="JavaScript" type="text/javascript">
<!--
function checkForm(formObj) {
formErrors = false;
if (formObj.message.value.length < 2) {
formErrors = "You must enter a message!";
}
else if ( formObj.subject.value.length < 2)
{
formErrors = "You must enter a subject!";
}
if (formErrors) {
alert(formErrors);
return false;
}
}
//-->
</script>
<form action="{S_POST_ACTION}" method="post" name="post" onSubmit="return checkForm(this)">
{ERROR_BOX}
<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
<tr>
<td align="left"><span class="nav"><a href="{U_INDEX}" class="nav">{SITENAME}&nbsp;{L_INDEX}</a></span></td>
</tr>
</table>
<table border="0" cellpadding="3" cellspacing="1" width="100%" class="forumline">
<tr>
<th class="thHead" colspan="2" height="25"><b>{L_SEND_EMAIL_MSG}</b></th>
</tr>
<tr>
<td class="row1" width="22%"><span class="gen"><b>{L_RECIPIENT}</b></span></td>
<td class="row2" width="78%"><span class="gen"><b>{USERNAME}</b></span> </td>
</tr>
<tr>
<td class="row1" width="22%"><span class="gen"><b>{L_SUBJECT}</b></span></td>
<td class="row2" width="78%"><span class="gen"><input type="text" name="subject" size="45" maxlength="100" style="width:450px" tabindex="2" class="post" value="{SUBJECT}" /></span> </td>
</tr>
<tr>
<td class="row1" valign="top"><span class="gen"><b>{L_MESSAGE_BODY}</b></span><br /><span class="gensmall">{L_MESSAGE_BODY_DESC}</span></td>
<td class="row2"><span class="gen"><textarea name="message" rows="25" cols="40" wrap="virtual" style="width:500px" tabindex="3" class="post">{MESSAGE}</textarea></span></td>
</tr>
<tr>
<td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span></td>
<td class="row2"><table cellspacing="0" cellpadding="1" border="0">
<tr>
<td><input type="checkbox" name="cc_email" value="1" checked="checked" /></td>
<td><span class="gen">{L_CC_EMAIL}</span></td>
</tr>
</table></td>
</tr>
<tr>
<td class="catBottom" colspan="2" align="center" height="28"> {S_HIDDEN_FORM_FIELDS}
<!-- Spell checker option part 2: You must sign up for free at www.spellchecker.net to use this option -->
<!-- Change the path in the onclick function to point to your files you got once signed up at Spellchecker.net -->
<!-- Remember to uncomment the link to the javascript file at the top of this template -->
<input type="button" tabindex="4" class="liteoption" name="spellcheck" value="{L_SPELLCHECK}" onClick= "doSpell ('uk', document.post.message, document.location.protocol + '//' + document.location.host + '/phpBB/spellcheck/sproxy.php', true);" />
<!-- End spellchecker option -->
&nbsp;<input type="submit" tabindex="6" name="submit" class="mainoption" value="{L_SEND_EMAIL}" /></td>
</tr>
</table>
<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
<td align="right" valign="top"><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
</table></form>
<table width="100%" cellspacing="2" border="0" align="center">
<tr>
<td valign="top" align="right">{JUMPBOX}</td>
</tr>
</table>

View file

@ -56,7 +56,7 @@
<table width="100%" border="0" cellspacing="1" cellpadding="3"> <table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr> <tr>
<td valign="middle" align="right"><span class="gen">{L_EMAIL_ADDRESS}:</span></td> <td valign="middle" align="right"><span class="gen">{L_EMAIL_ADDRESS}:</span></td>
<td class="row1" valign="middle" width="100%"><b><span class="gen">{EMAIL}</span></b></td> <td class="row1" valign="middle" width="100%"><b><span class="gen">{EMAIL_IMG}</span></b></td>
</tr> </tr>
<tr> <tr>
<td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_PM}:</span></td> <td valign="middle" nowrap="nowrap" align="right"><span class="gen">{L_PM}:</span></td>