|
From: Paul S. O. <ps...@us...> - 2002-01-27 22:13:20
|
Update of /cvsroot/phpbb/phpBB2
In directory usw-pr-cvs1:/tmp/cvs-serv24416
Modified Files:
groupcp.php posting.php privmsg.php profile.php viewtopic.php
Log Message:
Various updates related to email creation ... should fix various bugs and errors, in theory
Index: groupcp.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/groupcp.php,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** groupcp.php 2002/01/25 02:41:09 1.38
--- groupcp.php 2002/01/27 22:13:16 1.39
***************
*** 58,61 ****
--- 58,107 ----
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
+ //
+ // Set default email variables
+ //
+ if( isset($HTTP_SERVER_VARS['PHP_SELF']) || isset($HTTP_ENV_VARS['PHP_SELF']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['PHP_SELF']) ) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_ENV_VARS['PHP_SELF'];
+ }
+ else if( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) || isset($HTTP_ENV_VARS['SCRIPT_NAME']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) ) ? $HTTP_SERVER_VARS['SCRIPT_NAME'] : $HTTP_ENV_VARS['SCRIPT_NAME'];
+ }
+ else if( isset($HTTP_SERVER_VARS['PATH_INFO']) || isset($HTTP_ENV_VARS['PATH_INFO']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['PATH_INFO']) ) ? $HTTP_SERVER_VARS['PATH_INFO'] : $HTTP_ENV_VARS['PATH_INFO'];
+ }
+ else
+ {
+ $script_name = "groupcp.$phpEx";
+ }
+
+ if( isset($HTTP_SERVER_VARS['SERVER_NAME']) || isset($HTTP_ENV_VARS['SERVER_NAME']) )
+ {
+ $server_name = ( isset($HTTP_SERVER_VARS['SERVER_NAME']) ) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME'];
+ }
+ else if( isset($HTTP_SERVER_VARS['HTTP_HOST']) || isset($HTTP_ENV_VARS['HTTP_HOST']) )
+ {
+ $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST'];
+ }
+ else
+ {
+ $server_name = "";
+ }
+
+ if ( !empty($HTTP_SERVER_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else if ( !empty($HTTP_ENV_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_ENV_VARS['HTTPS']) ) ? ( ( $HTTP_ENV_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else
+ {
+ $protocol = "http://";
+ }
+
$is_moderator = FALSE;
***************
*** 70,74 ****
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id";
-
if( !$result = $db->sql_query($sql) )
{
--- 116,119 ----
***************
*** 128,159 ****
message_die(GENERAL_ERROR, "Couldn't obtain user and group information", "", __LINE__, __FILE__, $sql);
}
-
- $rowset = $db->sql_fetchrowset($result);
! if( $rowset[0]['group_type'] == GROUP_OPEN )
{
! for($i = 0; $i < count($rowset); $i++ )
{
! if( $userdata['user_id'] == $rowset[$i]['user_id'] )
{
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
! );
! $message = $lang["Already_member_group"] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
! message_die(GENERAL_MESSAGE, $message);
! }
}
}
else
{
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
! );
!
! $message = $lang["This_closed_group"] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
}
--- 173,209 ----
message_die(GENERAL_ERROR, "Couldn't obtain user and group information", "", __LINE__, __FILE__, $sql);
}
! if( $row = $db->sql_fetchrow($result) )
{
! if( $row['group_type'] == GROUP_OPEN )
{
! do
{
! if( $userdata['user_id'] == $row['user_id'] )
! {
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
! );
! $message = $lang["Already_member_group"] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
! message_die(GENERAL_MESSAGE, $message);
! }
! } while ( $row = $db->sql_fetchrow($result) );
! }
! else
! {
! $template->assign_vars(array(
! "META" => '<meta http-equiv="refresh" content="3;url=' . append_sid("index.$phpEx") . '">')
! );
!
! $message = $lang["This_closed_group"] . "<br /><br />" . sprintf($lang['Click_return_group'], "<a href=\"" . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id") . "\">", "</a>") . "<br /><br />" . sprintf($lang['Click_return_index'], "<a href=\"" . append_sid("index.$phpEx") . "\">", "</a>");
!
! message_die(GENERAL_MESSAGE, $message);
}
}
else
{
! message_die(GENERAL_MESSAGE, $lang['No_groups_exist']);
}
***************
*** 181,199 ****
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- if( isset($HTTP_SERVER_VARS['PATH_INFO']) && dirname($HTTP_SERVER_VARS['PATH_INFO']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['PATH_INFO']);
- }
- else if( dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['SCRIPT_NAME']);
- }
- else
- {
- $path = '';
- }
- $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_SERVER_VARS['SERVER_NAME'];
- $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
-
$emailer->use_template("group_request", $moderator['user_lang']);
$emailer->email_address($moderator['user_email']);
--- 231,234 ----
***************
*** 206,210 ****
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_GROUPCP" => $protocol . $server_name . $path . "/groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id&validate=true")
);
$emailer->send();
--- 241,245 ----
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_GROUPCP" => $protocol . $server_name . $script_name . "?" . POST_GROUPS_URL . "=$group_id&validate=true")
);
$emailer->send();
***************
*** 402,420 ****
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- if( isset($HTTP_SERVER_VARS['PATH_INFO']) && dirname($HTTP_SERVER_VARS['PATH_INFO']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['PATH_INFO']);
- }
- else if( dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['SCRIPT_NAME']);
- }
- else
- {
- $path = '';
- }
- $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_SERVER_VARS['SERVER_NAME'];
- $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
-
$emailer->use_template("group_added", $row['user_lang']);
$emailer->email_address($row['user_email']);
--- 437,440 ----
***************
*** 427,431 ****
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_GROUPCP" => $protocol . $server_name . $path . "/groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
--- 447,451 ----
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_GROUPCP" => $protocol . $server_name . $script_name . "?" . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
***************
*** 471,475 ****
WHERE user_id IN ($sql_in)";
}
! else if( isset($HTTP_POST_VARS['deny']) || isset($HTTP_POST_VARS['remove']) )
{
$sql = "DELETE FROM
--- 491,495 ----
WHERE user_id IN ($sql_in)";
}
! else if ( isset($HTTP_POST_VARS['deny']) || isset($HTTP_POST_VARS['remove']) )
{
$sql = "DELETE FROM
***************
*** 479,483 ****
}
! if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update user group table.", "Error", __LINE__, __FILE__, $sql);
--- 499,503 ----
}
! if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Could not update user group table.", "Error", __LINE__, __FILE__, $sql);
***************
*** 487,500 ****
// Email users when they are approved
//
! if( isset($HTTP_POST_VARS['approve']) )
{
! if( !$result = $db->sql_query($sql_select) )
{
message_die(GENERAL_ERROR, "Could not get user email information", "Error", __LINE__, __FILE__, $sql);
}
- $email_rowset = $db->sql_fetchrowset($result);
! $members_count = $db->sql_numrows($result);
!
//
// Get the group name
--- 507,527 ----
// Email users when they are approved
//
! if ( isset($HTTP_POST_VARS['approve']) )
{
! if ( !$result = $db->sql_query($sql_select) )
{
message_die(GENERAL_ERROR, "Could not get user email information", "Error", __LINE__, __FILE__, $sql);
}
! $email_addresses = "";
! while( $row = $db->sql_fetchrow($result) )
! {
! if( $i > 0 )
! {
! $email_addresses .= ", ";
! }
! $email_addresses .= $row['user_email'];
! }
!
//
// Get the group name
***************
*** 503,524 ****
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id";
! if(!$result = $db->sql_query($group_sql))
{
message_die(GENERAL_ERROR, "Could not get group information", "Error", __LINE__, __FILE__, $group_sql);
}
- $group_name_row = $db->sql_fetchrow($result);
$group_name = $group_name_row['group_name'];
- $email_addresses = "";
- for($i = 0; $i < $members_count; $i++)
- {
- if($i > 0)
- {
- $email_addresses .= ", ";
- }
- $email_addresses .= $email_rowset[$i]['user_email'];
- }
-
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
--- 530,541 ----
FROM " . GROUPS_TABLE . "
WHERE group_id = $group_id";
! if ( !($result = $db->sql_query($group_sql)) )
{
message_die(GENERAL_ERROR, "Could not get group information", "Error", __LINE__, __FILE__, $group_sql);
}
+ $group_name_row = $db->sql_fetchrow($result);
$group_name = $group_name_row['group_name'];
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
***************
*** 526,544 ****
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- if( isset($HTTP_SERVER_VARS['PATH_INFO']) && dirname($HTTP_SERVER_VARS['PATH_INFO']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['PATH_INFO']);
- }
- else if( dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['SCRIPT_NAME']);
- }
- else
- {
- $path = '';
- }
- $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_SERVER_VARS['SERVER_NAME'];
- $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
-
$emailer->use_template("group_approved");
$emailer->email_address($email_addresses);
--- 543,546 ----
***************
*** 551,555 ****
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_GROUPCP" => $protocol . $server_name . $path . "/groupcp.$phpEx?" . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
--- 553,557 ----
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_GROUPCP" => $protocol . $server_name . $script_name . "?" . POST_GROUPS_URL . "=$group_id")
);
$emailer->send();
***************
*** 616,628 ****
AND ug.user_id <> " . $group_moderator['user_id'] . "
ORDER BY u.username";
! if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Error getting user list for group", "", __LINE__, __FILE__, $sql);
}
! if( $members_count = $db->sql_numrows($result) )
! {
! $group_members = $db->sql_fetchrowset($result);
! }
$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm
--- 618,629 ----
AND ug.user_id <> " . $group_moderator['user_id'] . "
ORDER BY u.username";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Error getting user list for group", "", __LINE__, __FILE__, $sql);
}
! $group_members = $db->sql_fetchrowset($result);
! $modgroup_pending_count = count($group_members);
! $db->sql_freeresult($result);
$sql = "SELECT u.username, u.user_id, u.user_viewemail, u.user_posts, u.user_regdate, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_msnm
***************
*** 633,652 ****
AND u.user_id = ug.user_id
ORDER BY u.username";
! if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Error getting user pending information", "", __LINE__, __FILE__, $sql);
}
! if( $modgroup_pending_count = $db->sql_numrows($result) )
! {
! $modgroup_pending_list = $db->sql_fetchrowset($result);
! }
$is_group_member = 0;
! if( $members_count )
{
for($i = 0; $i < $members_count; $i++)
{
! if( $group_members[$i]['user_id'] == $userdata['user_id'] && $userdata['session_logged_in'] )
{
$is_group_member = TRUE;
--- 634,652 ----
AND u.user_id = ug.user_id
ORDER BY u.username";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Error getting user pending information", "", __LINE__, __FILE__, $sql);
}
! $modgroup_pending_list = $db->sql_fetchrowset($result);
! $modgroup_pending_count = count($modgroup_pending_list);
! $db->sql_freeresult($result);
$is_group_member = 0;
! if ( $members_count )
{
for($i = 0; $i < $members_count; $i++)
{
! if ( $group_members[$i]['user_id'] == $userdata['user_id'] && $userdata['session_logged_in'] )
{
$is_group_member = TRUE;
***************
*** 656,664 ****
$is_group_pending_member = 0;
! if( $modgroup_pending_count )
{
for($i = 0; $i < $modgroup_pending_count; $i++)
{
! if( $modgroup_pending_list[$i]['user_id'] == $userdata['user_id'] && $userdata['session_logged_in'] )
{
$is_group_pending_member = TRUE;
--- 656,664 ----
$is_group_pending_member = 0;
! if ( $modgroup_pending_count )
{
for($i = 0; $i < $modgroup_pending_count; $i++)
{
! if ( $modgroup_pending_list[$i]['user_id'] == $userdata['user_id'] && $userdata['session_logged_in'] )
{
$is_group_pending_member = TRUE;
***************
*** 667,676 ****
}
! if( $userdata['user_level'] == ADMIN )
{
$is_moderator = TRUE;
}
! if( $userdata['user_id'] == $group_info['group_moderator'] )
{
$is_moderator = TRUE;
--- 667,676 ----
}
! if ( $userdata['user_level'] == ADMIN )
{
$is_moderator = TRUE;
}
! if ( $userdata['user_id'] == $group_info['group_moderator'] )
{
$is_moderator = TRUE;
***************
*** 680,684 ****
$s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_GROUPS_URL . "\" value=\"$group_id\" />";
}
! else if( $is_group_member || $is_group_pending_member )
{
$template->assign_block_vars("switch_unsubscribe_group_input", array());
--- 680,684 ----
$s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_GROUPS_URL . "\" value=\"$group_id\" />";
}
! else if ( $is_group_member || $is_group_pending_member )
{
$template->assign_block_vars("switch_unsubscribe_group_input", array());
***************
*** 688,692 ****
$s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_GROUPS_URL . "\" value=\"$group_id\" />";
}
! else if( $userdata['user_id'] == ANONYMOUS )
{
$group_details = $lang['Login_to_join'];
--- 688,692 ----
$s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_GROUPS_URL . "\" value=\"$group_id\" />";
}
! else if ( $userdata['user_id'] == ANONYMOUS )
{
$group_details = $lang['Login_to_join'];
***************
*** 695,699 ****
else
{
! if( $group_info['group_type'] == GROUP_OPEN )
{
$template->assign_block_vars("switch_subscribe_group_input", array());
--- 695,699 ----
else
{
! if ( $group_info['group_type'] == GROUP_OPEN )
{
$template->assign_block_vars("switch_subscribe_group_input", array());
***************
*** 702,711 ****
$s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_GROUPS_URL . "\" value=\"$group_id\" />";
}
! else if( $group_info['group_type'] == GROUP_CLOSED )
{
$group_details = $lang['This_closed_group'];
$s_hidden_fields = "";
}
! else if( $group_info['group_type'] == GROUP_HIDDEN )
{
$group_details = $lang['This_hidden_group'];
--- 702,711 ----
$s_hidden_fields = "<input type=\"hidden\" name=\"" . POST_GROUPS_URL . "\" value=\"$group_id\" />";
}
! else if ( $group_info['group_type'] == GROUP_CLOSED )
{
$group_details = $lang['This_closed_group'];
$s_hidden_fields = "";
}
! else if ( $group_info['group_type'] == GROUP_HIDDEN )
{
$group_details = $lang['This_hidden_group'];
***************
*** 752,756 ****
$pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id") . "\"><img src=\"". $images['icon_pm'] . "\" alt=\"" . $lang['Private_messaging'] . "\" border=\"0\" /></a>";
! if( !empty($group_moderator['user_viewemail']) )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_moderator['user_id']) : "mailto:" . $group_moderator['user_email'];
--- 752,756 ----
$pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id") . "\"><img src=\"". $images['icon_pm'] . "\" alt=\"" . $lang['Private_messaging'] . "\" border=\"0\" /></a>";
! if ( !empty($group_moderator['user_viewemail']) )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_moderator['user_id']) : "mailto:" . $group_moderator['user_email'];
***************
*** 765,769 ****
$www_img = ( $group_moderator['user_website'] ) ? "<a href=\"" . $group_moderator['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : " ";
! if( !empty($group_moderator['user_icq']) )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $group_moderator['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $group_moderator['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
--- 765,769 ----
$www_img = ( $group_moderator['user_website'] ) ? "<a href=\"" . $group_moderator['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : " ";
! if ( !empty($group_moderator['user_icq']) )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $group_moderator['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $group_moderator['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
***************
*** 878,882 ****
$pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id") . "\"><img src=\"". $images['icon_pm'] . "\" alt=\"" . $lang['Private_messaging'] . "\" border=\"0\" /></a>";
! if( !empty($group_members[$i]['user_viewemail']) )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_members[$i]['user_id']) : "mailto:" . $group_members[$i]['user_email'];
--- 878,882 ----
$pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id") . "\"><img src=\"". $images['icon_pm'] . "\" alt=\"" . $lang['Private_messaging'] . "\" border=\"0\" /></a>";
! if ( !empty($group_members[$i]['user_viewemail']) )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $group_members[$i]['user_id']) : "mailto:" . $group_members[$i]['user_email'];
***************
*** 891,896 ****
$www_img = ( $group_members[$i]['user_website'] ) ? "<a href=\"" . $group_members[$i]['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : " ";
! if( !empty($group_members[$i]['user_icq']) )
! {
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $group_members[$i]['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $group_members[$i]['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
$icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=" . $group_members[$i]['user_icq'] . "\"><img src=\"" . $images['icon_icq'] . "\" alt=\"" . $lang['ICQ'] . "\" border=\"0\" /></a>";
--- 891,896 ----
$www_img = ( $group_members[$i]['user_website'] ) ? "<a href=\"" . $group_members[$i]['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : " ";
! if ( !empty($group_members[$i]['user_icq']) )
! {
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $group_members[$i]['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $group_members[$i]['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
$icq_add_img = "<a href=\"http://wwp.icq.com/scripts/search.dll?to=" . $group_members[$i]['user_icq'] . "\"><img src=\"" . $images['icon_icq'] . "\" alt=\"" . $lang['ICQ'] . "\" border=\"0\" /></a>";
***************
*** 910,914 ****
$search_img = "<a href=\"" . append_sid("search.$phpEx?search_author=" . urlencode($group_members[$i]['username']) . "&showresults=topics") . "\"><img src=\"" . $images['icon_search'] . "\" border=\"0\" alt=\"" . $lang['Search_user_posts'] . "\" /></a>";
! if( $group_info['group_type'] != GROUP_HIDDEN || $is_group_member || $is_moderator )
{
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
--- 910,914 ----
$search_img = "<a href=\"" . append_sid("search.$phpEx?search_author=" . urlencode($group_members[$i]['username']) . "&showresults=topics") . "\"><img src=\"" . $images['icon_search'] . "\" border=\"0\" alt=\"" . $lang['Search_user_posts'] . "\" /></a>";
! if ( $group_info['group_type'] != GROUP_HIDDEN || $is_group_member || $is_moderator )
{
$row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
***************
*** 938,942 ****
);
! if( $is_moderator )
{
$template->assign_block_vars("member_row.switch_mod_option", array());
--- 938,942 ----
);
! if ( $is_moderator )
{
$template->assign_block_vars("member_row.switch_mod_option", array());
***************
*** 945,949 ****
}
! if( !$members_count )
{
//
--- 945,949 ----
}
! if ( !$members_count )
{
//
***************
*** 964,968 ****
);
! if( $group_info['group_type'] == GROUP_HIDDEN && !$is_group_member && !$is_moderator )
{
//
--- 964,968 ----
);
! if ( $group_info['group_type'] == GROUP_HIDDEN && !$is_group_member && !$is_moderator )
{
//
***************
*** 980,989 ****
// do that pending memebers...
//
! if( $is_moderator )
{
//
// Users pending in ONLY THIS GROUP (which is moderated by this user)
//
! if( $modgroup_pending_count )
{
for($i = 0; $i < $modgroup_pending_count; $i++)
--- 980,989 ----
// do that pending memebers...
//
! if ( $is_moderator )
{
//
// Users pending in ONLY THIS GROUP (which is moderated by this user)
//
! if ( $modgroup_pending_count )
{
for($i = 0; $i < $modgroup_pending_count; $i++)
***************
*** 1002,1006 ****
$pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id") . "\"><img src=\"". $images['icon_pm'] . "\" alt=\"" . $lang['Private_messaging'] . "\" border=\"0\" /></a>";
! if( !empty($modgroup_pending_list[$i]['user_viewemail']) )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $modgroup_pending_list[$i]['user_id']) : "mailto:" . $modgroup_pending_list[$i]['user_email'];
--- 1002,1006 ----
$pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post&" . POST_USERS_URL . "=$user_id") . "\"><img src=\"". $images['icon_pm'] . "\" alt=\"" . $lang['Private_messaging'] . "\" border=\"0\" /></a>";
! if ( !empty($modgroup_pending_list[$i]['user_viewemail']) )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $modgroup_pending_list[$i]['user_id']) : "mailto:" . $modgroup_pending_list[$i]['user_email'];
***************
*** 1015,1019 ****
$www_img = ( $modgroup_pending_list[$i]['user_website'] ) ? "<a href=\"" . $modgroup_pending_list[$i]['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : "";
! if( !empty($modgroup_pending_list[$i]['user_icq']) )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $modgroup_pending_list[$i]['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $modgroup_pending_list[$i]['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
--- 1015,1019 ----
$www_img = ( $modgroup_pending_list[$i]['user_website'] ) ? "<a href=\"" . $modgroup_pending_list[$i]['user_website'] . "\" target=\"_userwww\"><img src=\"" . $images['icon_www'] . "\" alt=\"" . $lang['Visit_website'] . "\" border=\"0\" /></a>" : "";
! if ( !empty($modgroup_pending_list[$i]['user_icq']) )
{
$icq_status_img = "<a href=\"http://wwp.icq.com/" . $modgroup_pending_list[$i]['user_icq'] . "#pager\"><img src=\"http://web.icq.com/whitepages/online?icq=" . $modgroup_pending_list[$i]['user_icq'] . "&img=5\" width=\"18\" height=\"18\" border=\"0\" /></a>";
***************
*** 1076,1080 ****
}
! if( $is_moderator )
{
$template->assign_block_vars("switch_mod_option", array());
--- 1076,1080 ----
}
! if ( $is_moderator )
{
$template->assign_block_vars("switch_mod_option", array());
***************
*** 1090,1155 ****
else
{
! $sql = "SELECT group_id, group_name
! FROM " . GROUPS_TABLE . "
! WHERE group_single_user <> " . TRUE . "
! ORDER BY group_name";
! if(!$result = $db->sql_query($sql))
! {
! message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
! }
!
! if( !$db->sql_numrows($result) )
! {
! message_die(GENERAL_MESSAGE, $lang['No_groups_exist']);
! }
! $group_list = $db->sql_fetchrowset($result);
!
! $sql = "SELECT g.group_id, g.group_name, ug.user_pending
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
! WHERE ug.user_id = " . $userdata['user_id'] . "
! AND g.group_id = ug.group_id
AND g.group_single_user <> " . TRUE . "
! ORDER BY g.group_name";
! if(!$result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
}
- if($db->sql_numrows($result))
- {
- $membergroup_list = $db->sql_fetchrowset($result);
- }
-
- $s_member_groups = '<select name="' . POST_GROUPS_URL . '">';
$s_member_groups_opt = "";
- $s_pending_groups = '<select name="' . POST_GROUPS_URL . '">';
$s_pending_groups_opt = "";
!
! for($i = 0; $i < count($membergroup_list); $i++)
{
! if( $membergroup_list[$i]['user_pending'] )
{
! $s_pending_groups_opt .= '<option value="' . $membergroup_list[$i]['group_id'] . '">' . $membergroup_list[$i]['group_name'] . '</option>';
}
else
{
! $s_member_groups_opt .= '<option value="' . $membergroup_list[$i]['group_id'] . '">' . $membergroup_list[$i]['group_name'] . '</option>';
}
}
! $s_pending_groups .= $s_pending_groups_opt . "</select>";
! $s_member_groups .= $s_member_groups_opt . "</select>";
! //
! // Remaining groups
! //
! $s_group_list = '<select name="' . POST_GROUPS_URL . '">';
! for($i = 0; $i < count($group_list); $i++)
{
! if( !strstr($s_pending_groups, $group_list[$i]['group_name']) && !strstr($s_member_groups, $group_list[$i]['group_name']) )
! {
! $s_group_list_opt .= '<option value="' . $group_list[$i]['group_id'] . '">' . $group_list[$i]['group_name'] . '</option>';
! }
}
! $s_group_list .= $s_group_list_opt . "</select>";
//
--- 1090,1137 ----
else
{
! $sql = "SELECT g.group_id, g.group_name, ug.user_pending
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
! WHERE ug.user_id = " . $userdata['user_id'] . "
! AND ug.group_id = g.group_id
AND g.group_single_user <> " . TRUE . "
! ORDER BY g.group_name, ug.user_id";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
}
$s_member_groups_opt = "";
$s_pending_groups_opt = "";
! while( $row = $db->sql_fetchrow($result) )
{
! if ( $row['user_pending'] )
{
! $s_pending_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
}
else
{
! $s_member_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
}
}
! $s_pending_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_pending_groups_opt . "</select>";
! $s_member_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_member_groups_opt . "</select>";
! $sql = "SELECT DISTINCT g.group_id, g.group_name
! FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
! WHERE ug.user_id <> " . $userdata['user_id'] . "
! AND ug.group_id = g.group_id
! AND g.group_single_user <> " . TRUE . "
! ORDER BY g.group_name";
! if ( !($result = $db->sql_query($sql)) )
{
! message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
! }
!
! $s_group_list_opt = "";
! while( $row = $db->sql_fetchrow($result) )
! {
! $s_group_list_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
}
! $s_group_list = '<select name="' . POST_GROUPS_URL . '">' . $s_group_list_opt . "</select>";
//
***************
*** 1174,1193 ****
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
! if($s_pending_groups_opt != "" || $s_member_groups_opt != "")
{
$template->assign_block_vars("groups_joined", array() );
}
! if( $s_member_groups_opt != "" )
{
$template->assign_block_vars("groups_joined.groups_member", array() );
}
! if( $s_pending_groups_opt != "" )
{
$template->assign_block_vars("groups_joined.groups_pending", array() );
}
! if( $s_group_list_opt != "")
{
$template->assign_block_vars("groups_remaining", array() );
--- 1156,1175 ----
$template->assign_var_from_handle("JUMPBOX", "jumpbox");
! if ( $s_pending_groups_opt != "" || $s_member_groups_opt != "" )
{
$template->assign_block_vars("groups_joined", array() );
}
! if ( $s_member_groups_opt != "" )
{
$template->assign_block_vars("groups_joined.groups_member", array() );
}
! if ( $s_pending_groups_opt != "" )
{
$template->assign_block_vars("groups_joined.groups_pending", array() );
}
! if ( $s_group_list_opt != "")
{
$template->assign_block_vars("groups_remaining", array() );
Index: posting.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/posting.php,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -r1.138 -r1.139
*** posting.php 2002/01/25 12:58:24 1.138
--- posting.php 2002/01/27 22:13:16 1.139
***************
*** 81,105 ****
//
- // Go ahead and pull all data for this topic
- //
- $sql = "SELECT u.username, u.user_id, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
- FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
- WHERE p.topic_id = $topic_id
- AND p.poster_id = u.user_id
- AND p.post_id = pt.post_id
- ORDER BY p.post_time DESC
- LIMIT " . $board_config['posts_per_page'];
- if(!$result = $db->sql_query($sql))
- {
- message_die(GENERAL_ERROR, "Couldn't obtain post/user information.", "", __LINE__, __FILE__, $sql);
- }
-
- if(!$total_posts = $db->sql_numrows($result))
- {
- message_die(GENERAL_ERROR, "There don't appear to be any posts for this topic.", "", __LINE__, __FILE__, $sql);
- }
- $postrow = $db->sql_fetchrowset($result);
-
- //
// Define censored word matches
//
--- 81,84 ----
***************
*** 111,114 ****
--- 90,94 ----
}
+
//
// Dump out the page header and load viewtopic body template
***************
*** 127,205 ****
//
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
! for($i = 0; $i < $total_posts; $i++)
{
! $poster_id = $postrow[$i]['user_id'];
! $poster = $postrow[$i]['username'];
! $post_date = create_date($board_config['default_dateformat'], $postrow[$i]['post_time'], $board_config['board_timezone']);
! $mini_post_img = '<img src="' . $images['icon_minipost'] . '" alt="' . $lang['Post'] . '" />';
! //
! // Handle anon users posting with usernames
! //
! if( $poster_id == ANONYMOUS && $postrow[$i]['post_username'] != '' )
! {
! $poster = $postrow[$i]['post_username'];
! $poster_rank = $lang['Guest'];
! }
! $post_subject = ( $postrow[$i]['post_subject'] != "" ) ? $postrow[$i]['post_subject'] : "";
! $message = $postrow[$i]['post_text'];
! $bbcode_uid = $postrow[$i]['bbcode_uid'];
! //
! // If the board has HTML off but the post has HTML
! // on then we process it, else leave it alone
! //
! if( !$board_config['allow_html'] )
! {
! if( $postrow[$i]['enable_html'] )
{
! $message = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $message);
}
- }
! if( $bbcode_uid != "" )
! {
! $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $message);
! }
! $message = make_clickable($message);
! if( count($orig_word) )
! {
! $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
! $message = preg_replace($orig_word, $replacement_word, $message);
! }
! if( $board_config['allow_smilies'] && $postrow[$i]['enable_smilies'] )
! {
! $message = smilies_pass($message);
! }
! $message = str_replace("\n", "<br />", $message);
! //
! // Again this will be handled by the templating
! // code at some point
! //
! $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
! $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
! $template->assign_block_vars("postrow", array(
! "ROW_COLOR" => "#" . $row_color,
! "ROW_CLASS" => $row_class,
!
! "MINI_POST_IMG" => $mini_post_img,
! "POSTER_NAME" => $poster,
! "POST_DATE" => $post_date,
! "POST_SUBJECT" => $post_subject,
! "MESSAGE" => $message)
! );
}
--- 107,208 ----
//
+ // Go ahead and pull all data for this topic
+ //
+ $sql = "SELECT u.username, u.user_id, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid
+ FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
+ WHERE p.topic_id = $topic_id
+ AND p.poster_id = u.user_id
+ AND p.post_id = pt.post_id
+ ORDER BY p.post_time DESC
+ LIMIT " . $board_config['posts_per_page'];
+ if( !($result = $db->sql_query($sql)) )
+ {
+ message_die(GENERAL_ERROR, "Couldn't obtain post/user information.", "", __LINE__, __FILE__, $sql);
+ }
+
+ //
// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...
//
! if ( $row = $db->sql_fetchrow($result) )
{
! do
! {
! $poster_id = $row['user_id'];
! $poster = $row['username'];
! $post_date = create_date($board_config['default_dateformat'], $row['post_time'], $board_config['board_timezone']);
! $mini_post_img = '<img src="' . $images['icon_minipost'] . '" alt="' . $lang['Post'] . '" />';
! //
! // Handle anon users posting with usernames
! //
! if( $poster_id == ANONYMOUS && $row['post_username'] != '' )
! {
! $poster = $row['post_username'];
! $poster_rank = $lang['Guest'];
! }
! $post_subject = ( $row['post_subject'] != "" ) ? $row['post_subject'] : "";
! $message = $row['post_text'];
! $bbcode_uid = $row['bbcode_uid'];
! //
! // If the board has HTML off but the post has HTML
! // on then we process it, else leave it alone
! //
! if( !$board_config['allow_html'] )
{
! if( $row['enable_html'] )
! {
! $message = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $message);
! }
}
! if( $bbcode_uid != "" )
! {
! $message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $message);
! }
! $message = make_clickable($message);
! if( count($orig_word) )
! {
! $post_subject = preg_replace($orig_word, $replacement_word, $post_subject);
! $message = preg_replace($orig_word, $replacement_word, $message);
! }
! if( $board_config['allow_smilies'] && $row['enable_smilies'] )
! {
! $message = smilies_pass($message);
! }
! $message = str_replace("\n", "<br />", $message);
! //
! // Again this will be handled by the templating
! // code at some point
! //
! $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2'];
! $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2'];
! $template->assign_block_vars("postrow", array(
! "ROW_COLOR" => "#" . $row_color,
! "ROW_CLASS" => $row_class,
!
! "MINI_POST_IMG" => $mini_post_img,
! "POSTER_NAME" => $poster,
! "POST_DATE" => $post_date,
! "POST_SUBJECT" => $post_subject,
! "MESSAGE" => $message)
! );
! }
! while( $row = $db->sql_fetchrow($result) );
! }
! else
! {
! message_die(GENERAL_MESSAGE, 'Topic_post_not_exist', "", __LINE__, __FILE__, $sql);
}
***************
*** 457,483 ****
if( $is_first_post_topic && $post_has_poll )
{
! $sql = "SELECT vd.vote_id, vr.vote_result
FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
WHERE vd.topic_id = $topic_id
! AND vr.vote_id = vd.vote_id";
! if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't obtain vote data for this topic", "", __LINE__, __FILE__, $sql);
}
! if( $vote_rows = $db->sql_numrows($result) )
{
! $rowset = $db->sql_fetchrowset($result);
!
! $vote_id = $rowset[0]['vote_id'];
!
! $vote_results_sum = 0;
! for($i = 0; $i < $vote_rows; $i++ )
! {
! $vote_results_sum += $rowset[$i]['vote_result'];
! }
!
! $can_edit_poll = ( !$vote_results_sum ) ? TRUE : 0;
}
}
else
--- 460,480 ----
if( $is_first_post_topic && $post_has_poll )
{
! $sql = "SELECT vd.vote_id, SUM(vr.vote_result) AS vote_sum
FROM " . VOTE_DESC_TABLE . " vd, " . VOTE_RESULTS_TABLE . " vr
WHERE vd.topic_id = $topic_id
! AND vr.vote_id = vd.vote_id
! GROUP BY vd.vote_id";
! if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain vote data for this topic", "", __LINE__, __FILE__, $sql);
}
! $vote_results_sum = 0;
! if( $row = $db->sql_fetchrow($result) )
{
! $vote_id = $row['vote_id'];
! $vote_results_sum = $row['vote_sum'];
}
+ $can_edit_poll = ( !$vote_results_sum ) ? TRUE : 0;
}
else
***************
*** 980,1019 ****
if( $result = $db->sql_query($sql) )
{
- $email_set = $db->sql_fetchrowset($result);
- $update_watched_sql = "";
-
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
! $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
! if( isset($HTTP_SERVER_VARS['PATH_INFO']) && dirname($HTTP_SERVER_VARS['PATH_INFO']) != '/')
{
! $path = dirname($HTTP_SERVER_VARS['PATH_INFO']);
}
! else if( dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) != '/')
{
! $path = dirname($HTTP_SERVER_VARS['SCRIPT_NAME']);
}
else
{
! $path = '';
}
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
! $topic_title = preg_replace($orig_word, $replacement_word, $email_set[0]['topic_title']);
!
! $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_SERVER_VARS['SERVER_NAME'];
! $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
! for($i = 0; $i < count($email_set); $i++)
{
! if( $email_set[$i]['user_email'] != "")
{
! $emailer->use_template("topic_notify", $email_set[$i]['user_lang']);
! $emailer->email_address($email_set[$i]['user_email']);
$emailer->set_subject($lang['Topic_reply_notification']);
$emailer->extra_headers($email_headers);
--- 977,1044 ----
if( $result = $db->sql_query($sql) )
{
include($phpbb_root_path . 'includes/emailer.'.$phpEx);
$emailer = new emailer($board_config['smtp_delivery']);
! if( isset($HTTP_SERVER_VARS['PHP_SELF']) || isset($HTTP_ENV_VARS['PHP_SELF']) )
! {
! $script_name = ( isset($HTTP_SERVER_VARS['PHP_SELF']) ) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_ENV_VARS['PHP_SELF'];
! }
! else if( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) || isset($HTTP_ENV_VARS['SCRIPT_NAME']) )
! {
! $script_name = ( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) ) ? $HTTP_SERVER_VARS['SCRIPT_NAME'] : $HTTP_ENV_VARS['SCRIPT_NAME'];
! }
! else if( isset($HTTP_SERVER_VARS['PATH_INFO']) || isset($HTTP_ENV_VARS['PATH_INFO']) )
! {
! $script_name = ( isset($HTTP_SERVER_VARS['PATH_INFO']) ) ? $HTTP_SERVER_VARS['PATH_INFO'] : $HTTP_ENV_VARS['PATH_INFO'];
! }
! else
! {
! $script_name = "viewtopic.$phpEx";
! }
! if( isset($HTTP_SERVER_VARS['SERVER_NAME']) || isset($HTTP_ENV_VARS['SERVER_NAME']) )
{
! $server_name = ( isset($HTTP_SERVER_VARS['SERVER_NAME']) ) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME'];
}
! else if( isset($HTTP_SERVER_VARS['HTTP_HOST']) || isset($HTTP_ENV_VARS['HTTP_HOST']) )
{
! $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST'];
}
else
{
! $server_name = "";
}
+ if ( !empty($HTTP_SERVER_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else if ( !empty($HTTP_ENV_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_ENV_VARS['HTTPS']) ) ? ( ( $HTTP_ENV_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else
+ {
+ $protocol = "http://";
+ }
+
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
! $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
! $update_watched_sql = "";
! while( $row = $db->sql_fetchrow($result) )
{
! if( empty($topic_title) )
! {
! $topic_title = preg_replace($orig_word, $replacement_word, $row['topic_title']);
! }
!
! if( $row['user_email'] != "")
{
! $emailer->use_template("topic_notify", $row['user_lang']);
! $emailer->email_address($row['user_email']);
$emailer->set_subject($lang['Topic_reply_notification']);
$emailer->extra_headers($email_headers);
***************
*** 1021,1030 ****
$emailer->assign_vars(array(
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "USERNAME" => $email_set[$i]['username'],
"SITENAME" => $board_config['sitename'],
"TOPIC_TITLE" => $topic_title,
! "U_TOPIC" => $protocol . $server_name . $path . "/viewtopic.$phpEx?" . POST_POST_URL . "=$new_post_id#$new_post_id",
! "U_STOP_WATCHING_TOPIC" => $protocol . $server_name . $path . "/viewtopic.$phpEx?" . POST_TOPIC_URL . "=$new_topic_id&unwatch=topic")
);
--- 1046,1055 ----
$emailer->assign_vars(array(
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "USERNAME" => $row['username'],
"SITENAME" => $board_config['sitename'],
"TOPIC_TITLE" => $topic_title,
! "U_TOPIC" => $protocol . $server_name . $script_name . "?" . POST_POST_URL . "=$new_post_id#$new_post_id",
! "U_STOP_WATCHING_TOPIC" => $protocol . $server_name . $script_name . "?" . POST_TOPIC_URL . "=$new_topic_id&unwatch=topic")
);
***************
*** 1036,1040 ****
$update_watched_sql .= ", ";
}
! $update_watched_sql .= $email_set[$i]['user_id'];
}
}
--- 1061,1065 ----
$update_watched_sql .= ", ";
}
! $update_watched_sql .= $row['user_id'];
}
}
Index: privmsg.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/privmsg.php,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -r1.74 -r1.75
*** privmsg.php 2002/01/24 03:39:00 1.74
--- privmsg.php 2002/01/27 22:13:16 1.75
***************
*** 1064,1082 ****
if( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) )
{
! if( isset($HTTP_SERVER_VARS['PATH_INFO']) && dirname($HTTP_SERVER_VARS['PATH_INFO']) != '/')
{
! $path = dirname($HTTP_SERVER_VARS['PATH_INFO']);
}
! else if( dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) != '/')
{
! $path = dirname($HTTP_SERVER_VARS['SCRIPT_NAME']);
}
else
{
! $path = '';
}
- $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_SERVER_VARS['SERVER_NAME'];
- $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
--- 1064,1110 ----
if( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) )
{
! if( isset($HTTP_SERVER_VARS['PHP_SELF']) || isset($HTTP_ENV_VARS['PHP_SELF']) )
{
! $script_name = ( isset($HTTP_SERVER_VARS['PHP_SELF']) ) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_ENV_VARS['PHP_SELF'];
}
! else if( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) || isset($HTTP_ENV_VARS['SCRIPT_NAME']) )
{
! $script_name = ( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) ) ? $HTTP_SERVER_VARS['SCRIPT_NAME'] : $HTTP_ENV_VARS['SCRIPT_NAME'];
}
+ else if( isset($HTTP_SERVER_VARS['PATH_INFO']) || isset($HTTP_ENV_VARS['PATH_INFO']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['PATH_INFO']) ) ? $HTTP_SERVER_VARS['PATH_INFO'] : $HTTP_ENV_VARS['PATH_INFO'];
+ }
+ else
+ {
+ $script_name = "privmsg.$phpEx";
+ }
+
+ if( isset($HTTP_SERVER_VARS['SERVER_NAME']) || isset($HTTP_ENV_VARS['SERVER_NAME']) )
+ {
+ $server_name = ( isset($HTTP_SERVER_VARS['SERVER_NAME']) ) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME'];
+ }
+ else if( isset($HTTP_SERVER_VARS['HTTP_HOST']) || isset($HTTP_ENV_VARS['HTTP_HOST']) )
+ {
+ $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST'];
+ }
else
{
! $server_name = "";
}
+ if ( !empty($HTTP_SERVER_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else if ( !empty($HTTP_ENV_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_ENV_VARS['HTTPS']) ) ? ( ( $HTTP_ENV_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else
+ {
+ $protocol = "http://";
+ }
+
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
***************
*** 1088,1092 ****
//
$emailer->use_template("privmsg_notify", $to_userdata['user_lang']);
-
$emailer->extra_headers($email_headers);
$emailer->email_address($to_userdata['user_email']);
--- 1116,1119 ----
***************
*** 1098,1102 ****
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_INBOX" => $protocol . $server_name . $path . "/privmsg.$phpEx?folder=inbox")
);
--- 1125,1129 ----
"EMAIL_SIG" => str_replace("<br />", "\n", "-- \n" . $board_config['board_email_sig']),
! "U_INBOX" => $protocol . $server_name . $script_name . "?folder=inbox")
);
***************
*** 1585,1591 ****
"L_FIND_USERNAME" => $lang['Find_username'],
"L_FIND" => $lang['Find'],
! "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'],
--- 1612,1618 ----
"L_FIND_USERNAME" => $lang['Find_username'],
"L_FIND" => $lang['Find'],
! "L_DISABLE_HTML" => $lang['Disable_HTML_pm'],
! "L_DISABLE_BBCODE" => $lang['Disable_BBCode_pm'],
! "L_DISABLE_SMILIES" => $lang['Disable_Smilies_pm'],
"L_ATTACH_SIGNATURE" => $lang['Attach_signature'],
Index: profile.php
===================================================================
RCS file: /cvsroot/phpbb/phpBB2/profile.php,v
retrieving revision 1.174
retrieving revision 1.175
diff -C2 -r1.174 -r1.175
*** profile.php 2002/01/27 14:13:55 1.174
--- profile.php 2002/01/27 22:13:16 1.175
***************
*** 36,40 ****
--- 36,85 ----
//
+ //
+ // Set default email variables
+ //
+ if( isset($HTTP_SERVER_VARS['PHP_SELF']) || isset($HTTP_ENV_VARS['PHP_SELF']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['PHP_SELF']) ) ? $HTTP_SERVER_VARS['PHP_SELF'] : $HTTP_ENV_VARS['PHP_SELF'];
+ }
+ else if( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) || isset($HTTP_ENV_VARS['SCRIPT_NAME']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['SCRIPT_NAME']) ) ? $HTTP_SERVER_VARS['SCRIPT_NAME'] : $HTTP_ENV_VARS['SCRIPT_NAME'];
+ }
+ else if( isset($HTTP_SERVER_VARS['PATH_INFO']) || isset($HTTP_ENV_VARS['PATH_INFO']) )
+ {
+ $script_name = ( isset($HTTP_SERVER_VARS['PATH_INFO']) ) ? $HTTP_SERVER_VARS['PATH_INFO'] : $HTTP_ENV_VARS['PATH_INFO'];
+ }
+ else
+ {
+ $script_name = "profile.$phpEx";
+ }
+ if( isset($HTTP_SERVER_VARS['SERVER_NAME']) || isset($HTTP_ENV_VARS['SERVER_NAME']) )
+ {
+ $server_name = ( isset($HTTP_SERVER_VARS['SERVER_NAME']) ) ? $HTTP_SERVER_VARS['SERVER_NAME'] : $HTTP_ENV_VARS['SERVER_NAME'];
+ }
+ else if( isset($HTTP_SERVER_VARS['HTTP_HOST']) || isset($HTTP_ENV_VARS['HTTP_HOST']) )
+ {
+ $server_name = ( isset($HTTP_SERVER_VARS['HTTP_HOST']) ) ? $HTTP_SERVER_VARS['HTTP_HOST'] : $HTTP_ENV_VARS['HTTP_HOST'];
+ }
+ else
+ {
+ $server_name = "";
+ }
+
+ if ( !empty($HTTP_SERVER_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_SERVER_VARS['HTTPS']) ) ? ( ( $HTTP_SERVER_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else if ( !empty($HTTP_ENV_VARS['HTTPS']) )
+ {
+ $protocol = ( !empty($HTTP_ENV_VARS['HTTPS']) ) ? ( ( $HTTP_ENV_VARS['HTTPS'] == "on" ) ? "https://" : "http://" ) : "http://";
+ }
+ else
+ {
+ $protocol = "http://";
+ }
+
// -----------------------
// Page specific functions
***************
*** 188,195 ****
// Begin page proper
//
! if( $mode == "viewprofile" )
{
! if( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
--- 233,240 ----
// Begin page proper
//
! if ( $mode == "viewprofile" )
{
! if ( empty($HTTP_GET_VARS[POST_USERS_URL]) || $HTTP_GET_VARS[POST_USERS_URL] == ANONYMOUS )
{
message_die(GENERAL_MESSAGE, $lang['No_user_id_specified']);
***************
*** 200,208 ****
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
! if(!$ranks_result = $db->sql_query($sql))
{
message_die(GENERAL_ERROR, "Couldn't obtain ranks information.", "", __LINE__, __FILE__, $sql);
}
! $ranksrow = $db->sql_fetchrowset($ranksresult);
//
--- 245,255 ----
FROM " . RANKS_TABLE . "
ORDER BY rank_special, rank_min";
! if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Couldn't obtain ranks information.", "", __LINE__, __FILE__, $sql);
}
!
! $ranksrow = $db->sql_fetchrowset($result);
! $db->sql_freeresult($result);
//
***************
*** 239,243 ****
// Get the users percentage of total posts
! if( $profiledata['user_posts'] != 0 )
{
$total_posts = get_db_stat("postcount");
--- 286,290 ----
// Get the users percentage of total posts
! if ( $profiledata['user_posts'] != 0 )
{
$total_posts = get_db_stat("postcount");
***************
*** 249,253 ****
}
! if( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $profiledata['user_id']) : "mailto:" . $profiledata['user_email'];
--- 296,300 ----
}
! if ( !empty($profiledata['user_viewemail']) || $userdata['user_level'] == ADMIN )
{
$email_uri = ( $board_config['board_email_form'] ) ? append_sid("profile.$phpEx?mode=email&" . POST_USERS_URL ."=" . $profiledata['user_id']) : "mailto:" . $profiledata['user_email'];
***************
*** 263,267 ****
$avatar_img = "";
! if( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
switch( $profiledata['user_avatar_type'] )
--- 310,314 ----
$avatar_img = "";
! if ( $profiledata['user_avatar_type'] && $profiledata['user_allowavatar'] )
{
switch( $profiledata['user_avatar_type'] )
***************
*** 281,289 ****
$poster_rank = "";
$rank_image = "";
! if( $profiledata['user_rank'] )
{
for($i = 0; $i < count($ranksrow); $i++)
{
! if( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
--- 328,336 ----
$poster_rank = "";
$rank_image = "";
! if ( $profiledata['user_rank'] )
{
for($i = 0; $i < count($ranksrow); $i++)
{
! if ( $profiledata['user_rank'] == $ranksrow[$i]['rank_id'] && $ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
***************
*** 296,300 ****
for($i = 0; $i < count($ranksrow); $i++)
{
! if( $profiledata['user_posts'] > $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
--- 343,347 ----
for($i = 0; $i < count($ranksrow); $i++)
{
! if ( $profiledata['user_posts'] > $ranksrow[$i]['rank_min'] && !$ranksrow[$i]['rank_special'] )
{
$poster_rank = $ranksrow[$i]['rank_title'];
***************
*** 304,308 ****
}
! if( !empty($profiledata['user_icq']) )
{
$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
--- 351,355 ----
}
! if ( !empty($profiledata['user_icq']) )
{
$icq_status_img = '<a href="http://wwp.icq.com/' . $profiledata['user_icq'] . '#pager"><img src="http://web.icq.com/whitepages/online?icq=' . $profiledata['user_icq'] . '&img=5" width="18" height="18" border="0" /></a>';
***************
*** 392,399 ****
}
! else if( $mode == "editprofile" || $mode == "register" )
{
! if( !$userdata['session_logged_in'] && $mode == "editprofile" )
{
header("Location: " . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
--- 439,446 ----
}
! else if ( $mode == "editprofile" || $mode == "register" )
{
! if ( !$userdata['session_logged_in'] && $mode == "editprofile" )
{
header("Location: " . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
***************
*** 405,409 ****
// Start processing for output
//
! if( $mode == "register" && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
{
if( !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
--- 452,456 ----
// Start processing for output
//
! if ( $mode == "register" && !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
{
if( !isset($HTTP_POST_VARS['agreed']) && !isset($HTTP_GET_VARS['agreed']) )
***************
*** 1048,1066 ****
$email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n";
- if( isset($HTTP_SERVER_VARS['PATH_INFO']) && dirname($HTTP_SERVER_VARS['PATH_INFO']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['PATH_INFO']);
- }
- else if( dirname($HTTP_SERVER_VARS['SCRIPT_NAME']) != '/')
- {
- $path = dirname($HTTP_SERVER_VARS['SCRIPT_NAME']);
- }
- else
- {
- $path = '';
- }
- $server_name = ( isset($HTTP_SERVE...
[truncated message content] |