|
From: Paul S. O. <ps...@us...> - 2001-11-15 16:26:43
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv12929
Modified Files:
privmsg.php posting.php memberlist.php profile.php groupcp.php
Log Message:
Email form - free with purchase of any two other items
Index: privmsg.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/privmsg.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** privmsg.php 2001/11/13 16:07:42 1.41
--- privmsg.php 2001/11/15 16:26:41 1.42
***************
*** 389,398 ****
$profile_img = "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . 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'] && $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>" : "";
! if($privmsg['user_icq'])
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $privmsg['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $privmsg['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
--- 389,397 ----
$profile_img = "<a href=\"" . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=$user_id_from") . "\"><img src=\"" . $images['icon_profile'] . "\" alt=\"" . $lang['Read_profile'] . " $username_from\" border=\"0\" /></a>";
! $email_img = ( $privmsg['user_viewemail'] ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=$user_id_from") . "\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" 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>" : "";
! if( $privmsg['user_icq'] )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $privmsg['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $privmsg['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.92
retrieving revision 1.93
diff -C2 -r1.92 -r1.93
*** posting.php 2001/11/12 12:02:26 1.92
--- posting.php 2001/11/15 16:26:41 1.93
***************
*** 2580,2589 ****
if( $board_config['allow_html'] )
{
! $html_status = $lang['ON'];
$template->assign_block_vars("html_checkbox", array());
}
else
{
! $html_status = $lang['OFF'];
}
--- 2580,2589 ----
if( $board_config['allow_html'] )
{
! $html_status = $lang['HTML_is_ON'];
$template->assign_block_vars("html_checkbox", array());
}
else
{
! $html_status = $lang['HTML_is_OFF'];
}
***************
*** 2593,2602 ****
if($board_config['allow_bbcode'])
{
! $bbcode_status = $lang['ON'];
$template->assign_block_vars("bbcode_checkbox", array());
}
else
{
! $bbcode_status = $lang['OFF'];
}
--- 2593,2602 ----
if($board_config['allow_bbcode'])
{
! $bbcode_status = $lang['BBCode_is_ON'];
$template->assign_block_vars("bbcode_checkbox", array());
}
else
{
! $bbcode_status = $lang['BBCode_is_OFF'];
}
***************
*** 2606,2615 ****
if($board_config['allow_smilies'])
{
! $smilies_status = $lang['ON'];
$template->assign_block_vars("smilies_checkbox", array());
}
else
{
! $smilies_status = $lang['OFF'];
}
--- 2606,2615 ----
if($board_config['allow_smilies'])
{
! $smilies_status = $lang['Smilies_are_ON'];
$template->assign_block_vars("smilies_checkbox", array());
}
else
{
! $smilies_status = $lang['Smilies_are_OFF'];
}
***************
*** 2718,2730 ****
"L_OPTIONS" => $lang['Options'],
"L_PREVIEW" => $lang['Preview'],
"L_SUBMIT" => $lang['Submit_post'],
"L_CANCEL" => $lang['Cancel_post'],
"L_CONFIRM_DELETE" => $lang['Confirm_delete'],
! "L_HTML_IS" => $lang['HTML'] . " " . $lang['is'],
! "L_BBCODE_IS" => $lang['BBCode'] . " " . $lang['is'],
! "L_SMILIES_ARE" => $lang['Smilies'] . " " . $lang['are'],
! "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_NOTIFY_ON_REPLY" => $lang['Notify'],
--- 2718,2728 ----
"L_OPTIONS" => $lang['Options'],
"L_PREVIEW" => $lang['Preview'],
+ "L_SPELLCHECK" => $lang['Specllcheck'],
"L_SUBMIT" => $lang['Submit_post'],
"L_CANCEL" => $lang['Cancel_post'],
"L_CONFIRM_DELETE" => $lang['Confirm_delete'],
! "L_DISABLE_HTML" => $lang['Disable_HTML_post'],
! "L_DISABLE_BBCODE" => $lang['Disable_BBCode_post'],
! "L_DISABLE_SMILIES" => $lang['Disable_Smilies_post'],
"L_ATTACH_SIGNATURE" => $lang['Attach_signature'],
"L_NOTIFY_ON_REPLY" => $lang['Notify'],
Index: memberlist.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/memberlist.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** memberlist.php 2001/10/14 18:22:32 1.22
--- memberlist.php 2001/11/15 16:26:41 1.23
***************
*** 188,193 ****
if( !empty($members[$i]['user_viewemail']) )
{
! $altered_email = str_replace("@", " at ", $members[$i]['user_email']);
! $email_img = "<a href=\"mailto:$altered_email\"><img src=\"" . $images['icon_email'] . "\" border=\"0\" alt=\"" . $lang['Send_an_email'] . "\" /></a>";
}
else
--- 188,192 ----
if( !empty($members[$i]['user_viewemail']) )
{
! $email_img = "<a href=\"" . append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=$user_id") . "\"><img src=\"" . $images['icon_email'] . "\" border=\"0\" alt=\"" . $lang['Send_an_email'] . "\" /></a>";
}
else
Index: profile.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/profile.php,v
retrieving revision 1.127
retrieving revision 1.128
diff -C2 -r1.127 -r1.128
*** profile.php 2001/11/09 13:15:35 1.127
--- profile.php 2001/11/15 16:26:41 1.128
***************
*** 261,268 ****
if( $profiledata['user_viewemail'] && $profiledata['user_email'] != "" )
{
! // Replace the @ with 'at'. Some anti-spam mesures.
! $email_addr = str_replace("@", " at ", $profiledata['user_email']);
! $email = "<a href=\"mailto:$email_addr\">$email_addr</a>";
! $email_img = "<a href=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " " . $profiledata['username'] . "\" border=\"0\" /></a>";
}
else
--- 261,268 ----
if( $profiledata['user_viewemail'] && $profiledata['user_email'] != "" )
{
! $email_profile = append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL . "=" . $profiledata['user_id']);
!
! $email = "<a href=\"$email_profile\">" . $lang['Send_email'] . "</a>";
! $email_img = "<a href=\"$email_profile\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " " . $profiledata['username'] . "\" border=\"0\" /></a>";
}
else
***************
*** 1411,1417 ****
}
! $html_status = ($userdata['user_allowhtml']) ? $lang['ON'] : $lang['OFF'];
! $bbcode_status = ($userdata['user_allowbbcode']) ? $lang['ON'] : $lang['OFF'];
! $smilies_status = ($userdata['user_allowsmile']) ? $lang['ON'] : $lang['OFF'];
$signature = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $signature);
--- 1411,1417 ----
}
! $html_status = ($userdata['user_allowhtml']) ? $lang['HTML_is_ON'] : $lang['HTML_is_OFF'];
! $bbcode_status = ($userdata['user_allowbbcode']) ? $lang['BBCode_is_ON'] : $lang['BBCode_is_OFF'];
! $smilies_status = ($userdata['user_allowsmile']) ? $lang['Smilies_are_ON'] : $lang['Smilies_are_OFF'];
$signature = preg_replace("/\:[0-9a-z\:]*?\]/si", "]", $signature);
***************
*** 1579,1586 ****
"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_LOCAL" => $board_config['allow_avatar_local'],
--- 1579,1582 ----
***************
*** 1619,1623 ****
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
! else if($mode == "sendpassword")
{
if( isset($HTTP_POST_VARS['submit']) )
--- 1615,1619 ----
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
! else if( $mode == "sendpassword" )
{
if( isset($HTTP_POST_VARS['submit']) )
***************
*** 1730,1734 ****
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
! else if($mode == "activate")
{
$sql = "SELECT user_id, user_email, user_newpasswd
--- 1726,1730 ----
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
}
! else if( $mode == "activate" )
{
$sql = "SELECT user_id, user_email, user_newpasswd
***************
*** 1747,1754 ****
$sql_update_pass = "";
}
! $sql_update = "UPDATE " . USERS_TABLE . "
SET user_active = 1, user_actkey = ''" . $sql_update_pass . "
WHERE user_id = " . $row['user_id'];
! if($result = $db->sql_query($sql_update))
{
if( $board_config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == "" )
--- 1743,1751 ----
$sql_update_pass = "";
}
!
! $sql = "UPDATE " . USERS_TABLE . "
SET user_active = 1, user_actkey = ''" . $sql_update_pass . "
WHERE user_id = " . $row['user_id'];
! if( $result = $db->sql_query($sql) )
{
if( $board_config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == "" )
***************
*** 1804,1807 ****
--- 1801,1982 ----
}
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?&mode=email&" . 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']);
+ }
}
}
Index: groupcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/groupcp.php,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** groupcp.php 2001/11/09 08:57:36 1.18
--- groupcp.php 2001/11/15 16:26:41 1.19
***************
*** 726,731 ****
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=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
}
else
--- 726,730 ----
if( !empty($group_members[$i]['user_viewemail']) )
{
! $email_img = ( $group_members[$i]['user_viewemail'] ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_members[$i]['user_id']) . "\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
}
else
***************
*** 882,887 ****
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=\"mailto:$email_addr\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
}
else
--- 881,885 ----
if( !empty($modgroup_pending_list[$i]['user_viewemail']) )
{
! $email_img = ( $modgroup_pending_list[$i]['user_viewemail'] ) ? "<a href=\"" . append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $modgroup_pending_list[$i]['user_id']) . "\"><img src=\"" . $images['icon_email'] . "\" alt=\"" . $lang['Send_email'] . " $poster\" border=\"0\" /></a>" : "";
}
else
|