diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-25 13:22:46 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2002-03-25 13:22:46 +0000 |
| commit | 03543d2ee66529c4fd05e5540793791d2f035684 (patch) | |
| tree | 33e71a9734e9ee4bef6481ec2368caa23fb96c05 /phpBB/privmsg.php | |
| parent | 854e832a044f8e5827f1603b0e3881202c49695a (diff) | |
| download | forums-03543d2ee66529c4fd05e5540793791d2f035684.tar forums-03543d2ee66529c4fd05e5540793791d2f035684.tar.gz forums-03543d2ee66529c4fd05e5540793791d2f035684.tar.bz2 forums-03543d2ee66529c4fd05e5540793791d2f035684.tar.xz forums-03543d2ee66529c4fd05e5540793791d2f035684.zip | |
Fix non-sending of email notifications ... user_active hadn't been added to the SQL query yet was being checked before email was sent
git-svn-id: file:///svn/phpbb/trunk@2429 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/privmsg.php')
| -rw-r--r-- | phpBB/privmsg.php | 311 |
1 files changed, 148 insertions, 163 deletions
diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index 3ac33748ba..6e2300454e 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -30,7 +30,7 @@ include($phpbb_root_path . 'includes/functions_post.'.$phpEx); // // Is PM disabled? // -if( !empty($board_config['privmsg_disable']) ) +if ( !empty($board_config['privmsg_disable']) ) { message_die(GENERAL_MESSAGE, 'PM_disabled'); } @@ -57,11 +57,11 @@ $refresh = $preview || $submit_search; $mark_list = ( !empty($HTTP_POST_VARS['mark']) ) ? $HTTP_POST_VARS['mark'] : 0; -if( isset($HTTP_POST_VARS['folder']) || isset($HTTP_GET_VARS['folder']) ) +if ( isset($HTTP_POST_VARS['folder']) || isset($HTTP_GET_VARS['folder']) ) { $folder = ( isset($HTTP_POST_VARS['folder']) ) ? $HTTP_POST_VARS['folder'] : $HTTP_GET_VARS['folder']; - if( $folder != 'inbox' && $folder != 'outbox' && $folder != 'sentbox' && $folder != 'savebox' ) + if ( $folder != 'inbox' && $folder != 'outbox' && $folder != 'sentbox' && $folder != 'savebox' ) { $folder = 'inbox'; } @@ -74,7 +74,7 @@ else // // Cancel // -if( $cancel ) +if ( $cancel ) { header('Location: ' . append_sid("privmsg.$phpEx?folder=$folder", true)); } @@ -91,7 +91,7 @@ init_userprefs($userdata); // // Var definitions // -if( !empty($HTTP_POST_VARS['mode']) || !empty($HTTP_GET_VARS['mode']) ) +if ( !empty($HTTP_POST_VARS['mode']) || !empty($HTTP_GET_VARS['mode']) ) { $mode = ( !empty($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } @@ -102,7 +102,7 @@ else $start = ( !empty($HTTP_GET_VARS['start']) ) ? $HTTP_GET_VARS['start'] : 0; -if( isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL]) ) +if ( isset($HTTP_POST_VARS[POST_POST_URL]) || isset($HTTP_GET_VARS[POST_POST_URL]) ) { $privmsg_id = ( isset($HTTP_POST_VARS[POST_POST_URL]) ) ? $HTTP_POST_VARS[POST_POST_URL] : $HTTP_GET_VARS[POST_POST_URL]; } @@ -131,7 +131,7 @@ $savebox_url = ($folder != "savebox" || $mode != "") ? '<a href="' . append_sid( // ---------- // Start main // -if( $mode == "newpm" ) +if ( $mode == "newpm" ) { $gen_simple_header = TRUE; @@ -142,9 +142,9 @@ if( $mode == "newpm" ) "body" => "privmsgs_popup.tpl") ); - if( $userdata['session_logged_in'] ) + if ( $userdata['session_logged_in'] ) { - if( $userdata['user_new_privmsg'] ) + if ( $userdata['user_new_privmsg'] ) { $l_new_message = ( $userdata['user_new_privmsg'] == 1 ) ? $lang['You_new_pm'] : $lang['You_new_pms']; } @@ -170,9 +170,9 @@ if( $mode == "newpm" ) include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } -else if( $mode == "read" ) +else if ( $mode == "read" ) { - if( !empty($HTTP_GET_VARS[POST_POST_URL]) ) + if ( !empty($HTTP_GET_VARS[POST_POST_URL]) ) { $privmsgs_id = $HTTP_GET_VARS[POST_POST_URL]; } @@ -181,19 +181,19 @@ else if( $mode == "read" ) message_die(GENERAL_ERROR, $lang['No_post_id']); } - if( !$userdata['session_logged_in'] ) + if ( !$userdata['session_logged_in'] ) { $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true)); } - if( $folder ) + if ( $folder ) { // // SQL to pull appropriate message, prevents nosey people // reading other peoples messages ... hopefully! // - if($folder == "inbox") + if ($folder == "inbox") { $l_box_name = $lang['Inbox']; @@ -202,7 +202,7 @@ else if( $mode == "read" ) OR pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " )"; } - else if($folder == "outbox") + else if ($folder == "outbox") { $l_box_name = $lang['Outbox']; @@ -210,14 +210,14 @@ else if( $mode == "read" ) AND ( pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) "; } - else if($folder == "sentbox") + else if ($folder == "sentbox") { $l_box_name = $lang['Sentbox']; $pm_sql_user = "AND pm.privmsgs_from_userid = " . $userdata['user_id'] . " AND pm.privmsgs_type = " . PRIVMSGS_SENT_MAIL; } - else if($folder == "savebox") + else if ($folder == "savebox") { $l_box_name = $lang['Savebox']; @@ -247,7 +247,7 @@ else if( $mode == "read" ) $pm_sql_user AND u.user_id = pm.privmsgs_from_userid AND u2.user_id = pm.privmsgs_to_userid"; - if( !$pm_status = $db->sql_query($sql) ) + if ( !$pm_status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not query private message post information.", "", __LINE__, __FILE__, $sql); } @@ -255,7 +255,7 @@ else if( $mode == "read" ) // // Did the query return any data? // - if( !( $privmsg = $db->sql_fetchrow($pm_status) ) ) + if ( !( $privmsg = $db->sql_fetchrow($pm_status) ) ) { $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); @@ -267,12 +267,12 @@ else if( $mode == "read" ) // Is this a new message in the inbox? If it is then save // a copy in the posters sent box // - if( ( $privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL ) && $folder == "inbox" ) + if ( ( $privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL ) && $folder == "inbox" ) { $sql = "UPDATE " . PRIVMSGS_TABLE . " SET privmsgs_type = " . PRIVMSGS_READ_MAIL . " WHERE privmsgs_id = " . $privmsg['privmsgs_id']; - if( !$pm_upd_status = $db->sql_query($sql) ) + if ( !$pm_upd_status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update private message read status.", "", __LINE__, __FILE__, $sql); } @@ -280,7 +280,7 @@ else if( $mode == "read" ) $sql = "UPDATE " . USERS_TABLE . " SET user_unread_privmsg = user_unread_privmsg - 1 WHERE user_id = " . $userdata['user_id']; - if( !$user_upd_status = $db->sql_query($sql) ) + if ( !$user_upd_status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update private message read status for user.", "", __LINE__, __FILE__, $sql); } @@ -292,24 +292,24 @@ else if( $mode == "read" ) FROM " . PRIVMSGS_TABLE . " WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . " AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid']; - if( !$result = $db->sql_query($sql) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql); } $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ""; - if( $db->sql_numrows($result) ) + if ( $db->sql_numrows($result) ) { $sent_info = $db->sql_fetchrow($result); - if( $sent_info['sent_items'] >= $board_config['max_sentbox_privmsgs'] ) + if ( $sent_info['sent_items'] >= $board_config['max_sentbox_privmsgs'] ) { $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " WHERE privmsgs_type = " . PRIVMSGS_SENT_MAIL . " AND privmsgs_date = " . $sent_info['oldest_post_time'] . " AND privmsgs_from_userid = " . $privmsg['privmsgs_from_userid']; - if( !$result = $db->sql_query($sql) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql); } @@ -326,7 +326,7 @@ else if( $mode == "read" ) // $sql = "INSERT $sql_priority INTO " . PRIVMSGS_TABLE . " (privmsgs_type, privmsgs_subject, privmsgs_from_userid, privmsgs_to_userid, privmsgs_date, privmsgs_ip, privmsgs_enable_html, privmsgs_enable_bbcode, privmsgs_enable_smilies, privmsgs_attach_sig) VALUES (" . PRIVMSGS_SENT_MAIL . ", '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_subject'])) . "', " . $privmsg['privmsgs_from_userid'] . ", " . $privmsg['privmsgs_to_userid'] . ", " . $privmsg['privmsgs_date'] . ", '" . $privmsg['privmsgs_ip'] . "', " . $privmsg['privmsgs_enable_html'] . ", " . $privmsg['privmsgs_enable_bbcode'] . ", " . $privmsg['privmsgs_enable_smilies'] . ", " . $privmsg['privmsgs_attach_sig'] . ")"; - if( !$pm_sent_status = $db->sql_query($sql) ) + if ( !$pm_sent_status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not insert private message sent info.", "", __LINE__, __FILE__, $sql); } @@ -336,7 +336,7 @@ else if( $mode == "read" ) $sql = "INSERT $sql_priority INTO " . PRIVMSGS_TEXT_TABLE . " (privmsgs_text_id, privmsgs_bbcode_uid, privmsgs_text) VALUES ($privmsg_sent_id, '" . $privmsg['privmsgs_bbcode_uid'] . "', '" . str_replace("\'", "''", addslashes($privmsg['privmsgs_text'])) . "')"; - if(!$pm_sent_text_status = $db->sql_query($sql)) + if (!$pm_sent_text_status = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not insert private message sent text.<BR>$sql", "", __LINE__, __FILE__, $sql); } @@ -347,7 +347,7 @@ else if( $mode == "read" ) // Pick a folder, any folder, so long as it's one // below ... // - if( $folder == "inbox" ) + if ( $folder == "inbox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsg_id") . "\"><img src=\"" . $images['pm_replymsg'] . "\" alt=\"" . $lang['Post_reply_pm'] . "\" border=\"0\"></a>"; @@ -355,7 +355,7 @@ else if( $mode == "read" ) $edit_pm_img = ""; $l_box_name = $lang['Inbox']; } - else if( $folder == "outbox" ) + else if ( $folder == "outbox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = ""; @@ -363,9 +363,9 @@ else if( $mode == "read" ) $edit_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=edit&" . POST_POST_URL . "=$privmsg_id") . "\"><img src=\"" . $images['pm_editmsg'] . "\" alt=\"" . $lang['Edit_pm'] . "\" border=\"0\"></a>"; $l_box_name = $lang['Outbox']; } - else if( $folder == "savebox" ) + else if ( $folder == "savebox" ) { - if( $privmsg['privmsgs_type'] == PRIVMSGS_SAVED_IN_MAIL ) + if ( $privmsg['privmsgs_type'] == PRIVMSGS_SAVED_IN_MAIL ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsg_id") . "\"><img src=\"" . $images['pm_replymsg'] . "\" alt=\"" . $lang['Post_reply_pm'] . "\" border=\"0\"></a>"; @@ -381,7 +381,7 @@ else if( $mode == "read" ) } $l_box_name = $lang['Saved']; } - else if( $folder == "sentbox" ) + else if ( $folder == "sentbox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = ""; @@ -470,7 +470,7 @@ else if( $mode == "read" ) $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( !empty($privmsg['user_icq']) ) + if ( !empty($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>'; $icq_add_img = '<a href="http://wwp.icq.com/scripts/search.dll?to=' . $privmsg['user_icq'] . '"><img src="' . $images['icon_icq'] . '" alt="' . $lang['ICQ'] . '" title="' . $lang['ICQ'] . '" border="0" /></a>'; @@ -497,7 +497,7 @@ else if( $mode == "read" ) $private_message = $privmsg['privmsgs_text']; $bbcode_uid = $privmsg['privmsgs_bbcode_uid']; - if( $board_config['allow_sig'] ) + if ( $board_config['allow_sig'] ) { $user_sig = ( $privmsg['privmsgs_from_userid'] == $userdata['user_id'] ) ? $userdata['user_sig'] : $privmsg['user_sig']; } @@ -511,43 +511,43 @@ else if( $mode == "read" ) // 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 ( !$board_config['allow_html'] ) { - if( $user_sig != "" && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] ) + if ( $user_sig != "" && $privmsg['privmsgs_enable_sig'] && $userdata['user_allowhtml'] ) { $user_sig = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $user_sig); } - if( $privmsg['privmsgs_enable_html'] ) + if ( $privmsg['privmsgs_enable_html'] ) { $private_message = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $private_message); } } - if( $user_sig != "" && $privmsg['privmsgs_attach_sig'] && $user_sig_bbcode_uid != "" ) + if ( $user_sig != "" && $privmsg['privmsgs_attach_sig'] && $user_sig_bbcode_uid != "" ) { $user_sig = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($user_sig, $user_sig_bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $user_sig); } - if( $bbcode_uid != "" ) + if ( $bbcode_uid != "" ) { $private_message = ( $board_config['allow_bbcode'] ) ? bbencode_second_pass($private_message, $bbcode_uid) : preg_replace("/\:[0-9a-z\:]+\]/si", "]", $private_message); } $private_message = make_clickable($private_message); - if( $privmsg['privmsgs_attach_sig'] && $user_sig != "" ) + if ( $privmsg['privmsgs_attach_sig'] && $user_sig != "" ) { $private_message .= "<br /><br />_________________<br />" . make_clickable($user_sig); } - if( count($orig_word) ) + if ( count($orig_word) ) { $post_subject = preg_replace($orig_word, $replacement_word, $post_subject); $private_message = preg_replace($orig_word, $replacement_word, $private_message); } - if( $board_config['allow_smilies'] && $privmsg['privmsgs_enable_smilies'] ) + if ( $board_config['allow_smilies'] && $privmsg['privmsgs_enable_smilies'] ) { $private_message = smilies_pass($private_message); } @@ -586,20 +586,20 @@ else if( $mode == "read" ) include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } -else if( ( $delete && $mark_list ) || $delete_all ) +else if ( ( $delete && $mark_list ) || $delete_all ) { - if(!$userdata['session_logged_in']) + if (!$userdata['session_logged_in']) { $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); } - if( isset($mark_list) && !is_array($mark_list) ) + if ( isset($mark_list) && !is_array($mark_list) ) { // Set to empty array instead of '0' if nothing is selected. $mark_list = array(); } - if( !$confirm ) + if ( !$confirm ) { $s_hidden_fields = '<input type="hidden" name="mode" value="' . $mode . '" />'; $s_hidden_fields .= (isset($HTTP_POST_VARS['delete'])) ? '<input type="hidden" name="delete" value="true" />' : '<input type="hidden" name="deleteall" value="true" />'; @@ -632,9 +632,9 @@ else if( ( $delete && $mark_list ) || $delete_all ) include($phpbb_root_path . 'includes/page_tail.'.$phpEx); } - else if( $confirm ) + else if ( $confirm ) { - if( $delete_all ) + if ( $delete_all ) { switch($folder) { @@ -771,21 +771,21 @@ else if( ( $delete && $mark_list ) || $delete_all ) break; } - if( !$db->sql_query($delete_sql, BEGIN_TRANSACTION) ) + if ( !$db->sql_query($delete_sql, BEGIN_TRANSACTION) ) { message_die(GENERAL_ERROR, "Could not delete private message info.", "", __LINE__, __FILE__, $delete_sql); } - if( !$db->sql_query($delete_text_sql, END_TRANSACTION) ) + if ( !$db->sql_query($delete_text_sql, END_TRANSACTION) ) { message_die(GENERAL_ERROR, "Could not delete private message text.", "", __LINE__, __FILE__, $delete_text_sql); } } } } -else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox") +else if ( $save && $mark_list && $folder != "savebox" && $folder != "outbox") { - if( !$userdata['session_logged_in'] ) + if ( !$userdata['session_logged_in'] ) { $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); @@ -800,16 +800,16 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox") AND privmsgs_type = " . PRIVMSGS_SAVED_IN_MAIL . " ) OR ( privmsgs_from_userid = " . $userdata['user_id'] . " AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") )"; - if( !$result = $db->sql_query($sql) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not obtain sent message info for sendee.", "", __LINE__, __FILE__, $sql); } $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ""; - if( $saved_info = $db->sql_fetchrow($result) ) + if ( $saved_info = $db->sql_fetchrow($result) ) { - if( $saved_info['savebox_items'] >= $board_config['max_savebox_privmsgs'] ) + if ( $saved_info['savebox_items'] >= $board_config['max_savebox_privmsgs'] ) { $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " WHERE ( ( privmsgs_to_userid = " . $userdata['user_id'] . " @@ -817,7 +817,7 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox") OR ( privmsgs_from_userid = " . $userdata['user_id'] . " AND privmsgs_type = " . PRIVMSGS_SAVED_OUT_MAIL . ") ) AND privmsgs_date = " . $saved_info['oldest_post_time']; - if( !$result = $db->sql_query($sql) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql); } @@ -858,7 +858,7 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox") $saved_sql_id = ""; for($i = 0; $i < count($mark_list); $i++) { - if( $saved_sql_id != "" ) + if ( $saved_sql_id != "" ) { $saved_sql_id .= ", "; } @@ -867,17 +867,17 @@ else if( $save && $mark_list && $folder != "savebox" && $folder != "outbox") $saved_sql .= " AND privmsgs_id IN ($saved_sql_id)"; - if( !$save_status = $db->sql_query($saved_sql) ) + if ( !$save_status = $db->sql_query($saved_sql) ) { message_die(GENERAL_ERROR, "Could not save private messages.", "", __LINE__, __FILE__, $saved_sql); } } } -else if( $submit || $refresh || $mode != "" ) +else if ( $submit || $refresh || $mode != "" ) { - if(!$userdata['session_logged_in']) + if (!$userdata['session_logged_in']) { $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? "&" . POST_USERS_URL . "=" . $HTTP_GET_VARS[POST_USERS_URL] : ""; $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; @@ -887,7 +887,7 @@ else if( $submit || $refresh || $mode != "" ) // // Toggles // - if( !$board_config['allow_html'] ) + if ( !$board_config['allow_html'] ) { $html_on = 0; } @@ -896,7 +896,7 @@ else if( $submit || $refresh || $mode != "" ) $html_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_html']) ) ? 0 : TRUE ) : $userdata['user_allowhtml']; } - if( !$board_config['allow_bbcode'] ) + if ( !$board_config['allow_bbcode'] ) { $bbcode_on = 0; } @@ -905,7 +905,7 @@ else if( $submit || $refresh || $mode != "" ) $bbcode_on = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['disable_bbcode']) ) ? 0 : TRUE ) : $userdata['user_allowbbcode']; } - if( !$board_config['allow_smilies'] ) + if ( !$board_config['allow_smilies'] ) { $smilies_on = 0; } @@ -917,7 +917,7 @@ else if( $submit || $refresh || $mode != "" ) $attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : $userdata['user_attachsig']; $user_sig = ( $userdata['user_sig'] != "" && $board_config['allow_sig'] ) ? $userdata['user_sig'] : ""; - if( $submit && $mode != "edit" ) + if ( $submit && $mode != "edit" ) { // // Flood control @@ -925,14 +925,14 @@ else if( $submit || $refresh || $mode != "" ) $sql = "SELECT MAX(privmsgs_date) AS last_post_time FROM " . PRIVMSGS_TABLE . " WHERE privmsgs_from_userid = " . $userdata['user_id']; - if( $result = $db->sql_query($sql) ) + if ( $result = $db->sql_query($sql) ) { $db_row = $db->sql_fetchrow($result); $last_post_time = $db_row['last_post_time']; $current_time = time(); - if( ( $current_time - $last_post_time ) < $board_config['flood_interval']) + if ( ( $current_time - $last_post_time ) < $board_config['flood_interval']) { message_die(GENERAL_MESSAGE, $lang['Flood_Error']); } @@ -942,17 +942,17 @@ else if( $submit || $refresh || $mode != "" ) // } - if( $submit ) + if ( $submit ) { - if( !empty($HTTP_POST_VARS['username']) ) + if ( !empty($HTTP_POST_VARS['username']) ) { $to_username = $HTTP_POST_VARS['username']; - $sql = "SELECT user_id, user_notify_pm, user_email, user_lang + $sql = "SELECT user_id, user_notify_pm, user_email, user_lang, user_active FROM " . USERS_TABLE . " WHERE username = '" . str_replace("\'", "''", $to_username) . "' AND user_id <> " . ANONYMOUS; - if(!$result = $db->sql_query($sql)) + if (!($result = $db->sql_query($sql))) { $error = TRUE; $error_msg = $lang['No_such_user']; @@ -965,29 +965,21 @@ else if( $submit || $refresh || $mode != "" ) else { $error = TRUE; - if(isset($error_msg)) - { - $error_msg .= "<br />"; - } - $error_msg .= $lang['No_to_user']; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['No_to_user']; } $privmsg_subject = trim(strip_tags($HTTP_POST_VARS['subject'])); - if( empty($privmsg_subject) ) + if ( empty($privmsg_subject) ) { $error = TRUE; - if( !empty($error_msg) ) - { - $error_msg .= "<br />"; - } - $error_msg .= $lang['Empty_subject']; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_subject']; } - if( !empty($HTTP_POST_VARS['message']) ) + if ( !empty($HTTP_POST_VARS['message']) ) { - if( !$error ) + if ( !$error ) { - if( $bbcode_on ) + if ( $bbcode_on ) { $bbcode_uid = make_bbcode_uid(); } @@ -999,20 +991,16 @@ else if( $submit || $refresh || $mode != "" ) else { $error = TRUE; - if(!empty($error_msg)) - { - $error_msg .= "<br />"; - } - $error_msg .= $lang['Empty_message']; + $error_msg .= ( ( !empty($error_msg) ) ? '<br />' : '' ) . $lang['Empty_message']; } } - if( $submit && !$error ) + if ( $submit && !$error ) { // // Has admin prevented user from sending PM's? // - if( !$userdata['user_allow_pm'] ) + if ( !$userdata['user_allow_pm'] ) { $message = $lang['Cannot_send_privmsg']; message_die(GENERAL_MESSAGE, $message); @@ -1020,7 +1008,7 @@ else if( $submit || $refresh || $mode != "" ) $msg_time = time(); - if( $mode != "edit" ) + if ( $mode != "edit" ) { // // See if recipient is at their inbox limit @@ -1031,18 +1019,16 @@ else if( $submit || $refresh || $mode != "" ) OR privmsgs_type = " . PRIVMSGS_READ_MAIL . " OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) AND privmsgs_to_userid = " . $to_userdata['user_id']; - if( !$result = $db->sql_query($sql) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_MESSAGE, $lang['No_such_user']); } $sql_priority = (SQL_LAYER == "mysql") ? "LOW_PRIORITY" : ""; - if( $db->sql_numrows($result) ) + if ( $inbox_info = $db->sql_fetchrow($result) ) { - $inbox_info = $db->sql_fetchrow($result); - - if( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] ) + if ( $inbox_info['inbox_items'] >= $board_config['max_inbox_privmsgs'] ) { $sql = "DELETE $sql_priority FROM " . PRIVMSGS_TABLE . " WHERE ( privmsgs_type = " . PRIVMSGS_NEW_MAIL . " @@ -1050,7 +1036,7 @@ else if( $submit || $refresh || $mode != "" ) OR privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) AND privmsgs_date = " . $inbox_info['oldest_post_time'] . " AND privmsgs_to_userid = " . $to_userdata['user_id']; - if( !$result = $db->sql_query($sql) ) + if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, "Could not delete oldest privmsgs.", "", __LINE__, __FILE__, $sql); } @@ -1075,13 +1061,13 @@ else if( $submit || $refresh || $mode != "" ) WHERE privmsgs_id = $privmsg_id"; } - if( !$pm_sent_status = $db->sql_query($sql_info, BEGIN_TRANSACTION) ) + if ( !$pm_sent_status = $db->sql_query($sql_info, BEGIN_TRANSACTION) ) { message_die(GENERAL_ERROR, "Could not insert/update private message sent info.", "", __LINE__, __FILE__, $sql_info); } else { - if( $mode != "edit" ) + if ( $mode != "edit" ) { $privmsg_sent_id = $db->sql_nextid(); @@ -1095,25 +1081,24 @@ else if( $submit || $refresh || $mode != "" ) WHERE privmsgs_text_id = $privmsg_id"; } - if( !$pm_sent_text_status = $db->sql_query($sql, END_TRANSACTION) ) + if ( !($pm_sent_text_status = $db->sql_query($sql, END_TRANSACTION)) ) { message_die(GENERAL_ERROR, "Could not insert/update private message sent text.", "", __LINE__, __FILE__, $sql_info); } - else if( $mode != "edit" ) + else if ( $mode != "edit" ) { - // // Add to the users new pm counter // $sql = "UPDATE " . USERS_TABLE . " SET user_new_privmsg = user_new_privmsg + 1, user_last_privmsg = " . time() . " WHERE user_id = " . $to_userdata['user_id']; - if( !$status = $db->sql_query($sql) ) + if ( !$status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update private message new/read status for user.", "", __LINE__, __FILE__, $sql); } - if( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] == 1) + if ( $to_userdata['user_notify_pm'] && !empty($to_userdata['user_email']) && $to_userdata['user_active'] ) { $email_headers = "From: " . $board_config['board_email'] . "\nReturn-Path: " . $board_config['board_email'] . "\r\n"; @@ -1156,7 +1141,7 @@ else if( $submit || $refresh || $mode != "" ) message_die(GENERAL_MESSAGE, $msg); } } - else if( $preview || $refresh || $error ) + else if ( $preview || $refresh || $error ) { // @@ -1168,7 +1153,7 @@ else if( $submit || $refresh || $mode != "" ) $privmsg_subject = ( isset($HTTP_POST_VARS['subject']) ) ? trim(strip_tags(stripslashes($HTTP_POST_VARS['subject']))) : ""; $privmsg_message = ( isset($HTTP_POST_VARS['message']) ) ? trim($HTTP_POST_VARS['message']) : ""; $privmsg_message = preg_replace('#<textarea>#si', '<textarea>', $privmsg_message); - if( !$preview ) + if ( !$preview ) { $privmsg_message = stripslashes($privmsg_message); } @@ -1176,21 +1161,21 @@ else if( $submit || $refresh || $mode != "" ) // // Do mode specific things // - if( $mode == "post" ) + if ( $mode == "post" ) { $page_title = $lang['Send_new_privmsg']; $user_sig = ( $userdata['user_sig'] != "" && $board_config['allow_sig'] ) ? $userdata['user_sig'] : ""; } - else if( $mode == "reply" ) + else if ( $mode == "reply" ) { $page_title = $lang['Reply_privmsg']; $user_sig = ( $userdata['user_sig'] != "" && $board_config['allow_sig'] ) ? $userdata['user_sig'] : ""; } - else if( $mode == "edit" ) + else if ( $mode == "edit" ) { $page_title = $lang['Edit_privmsg']; @@ -1198,11 +1183,11 @@ else if( $submit || $refresh || $mode != "" ) FROM " . PRIVMSGS_TABLE . " pm, " . USERS_TABLE . " u WHERE pm.privmsgs_id = $privmsg_id AND u.user_id = pm.privmsgs_from_userid"; - if($result = $db->sql_query($sql)) + if ($result = $db->sql_query($sql)) { $postrow = $db->sql_fetchrow($result); - if( $userdata['user_id'] != $postrow['user_id'] ) + if ( $userdata['user_id'] != $postrow['user_id'] ) { message_die(GENERAL_MESSAGE, $lang['Sorry_edit_own_posts']); } @@ -1217,12 +1202,12 @@ else if( $submit || $refresh || $mode != "" ) } else { - if( !$privmsg_id && ( $mode == "reply" || $mode == "edit" || $mode == "quote" ) ) + if ( !$privmsg_id && ( $mode == "reply" || $mode == "edit" || $mode == "quote" ) ) { message_die(GENERAL_ERROR, $lang['No_post_id']); } - if( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) + if ( !empty($HTTP_GET_VARS[POST_USERS_URL]) ) { $user_id = $HTTP_GET_VARS[POST_USERS_URL]; @@ -1230,7 +1215,7 @@ else if( $submit || $refresh || $mode != "" ) FROM " . USERS_TABLE . " WHERE user_id = $user_id AND user_id <> " . ANONYMOUS; - if(!$result = $db->sql_query($sql)) + if (!($result = $db->sql_query($sql))) { $error = TRUE; $error_msg = $lang['No_such_user']; @@ -1246,7 +1231,7 @@ else if( $submit || $refresh || $mode != "" ) // Obtain list of groups/users is // this user is a group moderator // - if( $mode == "post" ) + if ( $mode == "post" ) { unset($mod_group_list); $sql = "SELECT g.group_id, g.group_name, g.group_moderator, g.group_single_user, u.username @@ -1254,17 +1239,17 @@ else if( $submit || $refresh || $mode != "" ) WHERE g.group_moderator = " . $userdata['user_id'] ." AND ug.group_id = g.group_id AND u.user_id = ug.user_id"; - if(!$group_status = $db->sql_query($sql)) + if (!$group_status = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not obtain group moderator list.", "", __LINE__, __FILE__, $sql); } - if($db->sql_numrows($group_status)) + if ($db->sql_numrows($group_status)) { $mod_group_list = $db->sql_fetchrowset($group_status); } } - if( $mode == "edit" ) + if ( $mode == "edit" ) { $sql = "SELECT pm.*, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text, u.username, u.user_id, u.user_sig FROM " . PRIVMSGS_TABLE . " pm, " . PRIVMSGS_TEXT_TABLE . " pmt, " . USERS_TABLE . " u @@ -1274,7 +1259,7 @@ else if( $submit || $refresh || $mode != "" ) AND ( pm.privmsgs_type = " . PRIVMSGS_NEW_MAIL . " OR pm.privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " ) AND u.user_id = pm.privmsgs_to_userid"; - if( !$pm_edit_status = $db->sql_query($sql) ) + if ( !$pm_edit_status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql); } @@ -1303,7 +1288,7 @@ else if( $submit || $refresh || $mode != "" ) $to_userid = $privmsg['user_id']; } - else if( $mode == "reply" || $mode == "quote" ) + else if ( $mode == "reply" || $mode == "quote" ) { $sql = "SELECT pm.privmsgs_subject, pm.privmsgs_date, pmt.privmsgs_bbcode_uid, pmt.privmsgs_text, u.username, u.user_id @@ -1312,12 +1297,12 @@ else if( $submit || $refresh || $mode != "" ) AND pmt.privmsgs_text_id = pm.privmsgs_id AND pm.privmsgs_to_userid = " . $userdata['user_id'] . " AND u.user_id = pm.privmsgs_from_userid"; - if(!$pm_reply_status = $db->sql_query($sql)) + if (!$pm_reply_status = $db->sql_query($sql)) { message_die(GENERAL_ERROR, "Could not obtain private message for editing.", "", __LINE__, __FILE__, $sql); } - if( !($privmsg = $db->sql_fetchrow($pm_reply_status)) ) + if ( !($privmsg = $db->sql_fetchrow($pm_reply_status)) ) { $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); @@ -1328,7 +1313,7 @@ else if( $submit || $refresh || $mode != "" ) $to_username = $privmsg['username']; $to_userid = $privmsg['user_id']; - if( $mode == "quote" ) + if ( $mode == "quote" ) { $privmsg_message = $privmsg['privmsgs_text']; $privmsg_bbcode_uid = $privmsg['privmsgs_bbcode_uid']; @@ -1349,7 +1334,7 @@ else if( $submit || $refresh || $mode != "" ) // // Has admin prevented user from sending PM's? // - if( !$userdata['user_allow_pm'] && $mode != "edit" ) + if ( !$userdata['user_allow_pm'] && $mode != "edit" ) { $message = $lang['Cannot_send_privmsg']; message_die(GENERAL_MESSAGE, $message); @@ -1362,13 +1347,13 @@ else if( $submit || $refresh || $mode != "" ) $page_title = $lang['Send_private_message']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); - if( $preview && !$error ) + if ( $preview && !$error ) { $orig_word = array(); $replacement_word = array(); obtain_word_list($orig_word, $replacement_word); - if( $bbcode_on ) + if ( $bbcode_on ) { $bbcode_uid = make_bbcode_uid(); } @@ -1379,30 +1364,30 @@ else if( $submit || $refresh || $mode != "" ) // // Finalise processing as per viewtopic // - if( !$html_on ) + if ( !$html_on ) { - if( $user_sig != "" || !$userdata['user_allowhtml'] ) + if ( $user_sig != "" || !$userdata['user_allowhtml'] ) { $user_sig = preg_replace("#(<)([\/]?.*?)(>)#is", "<\\2>", $user_sig); } } - if( $attach_sig && $user_sig != "" && $userdata['user_sig_bbcode_uid'] ) + if ( $attach_sig && $user_sig != "" && $userdata['user_sig_bbcode_uid'] ) { $user_sig = bbencode_second_pass($user_sig, $userdata['user_sig_bbcode_uid']); } - if( $bbcode_on ) + if ( $bbcode_on ) { $preview_message = bbencode_second_pass($preview_message, $bbcode_uid); } - if( $attach_sig && $user_sig != "" ) + if ( $attach_sig && $user_sig != "" ) { $preview_message = $preview_message . "<br /><br />_________________<br />" . $user_sig; } - if( count($orig_word) ) + if ( count($orig_word) ) { $preview_subject = preg_replace($orig_word, $replacement_word, $privmsg_subject); $preview_message = preg_replace($orig_word, $replacement_word, $preview_message); @@ -1412,7 +1397,7 @@ else if( $submit || $refresh || $mode != "" ) $preview_subject = $privmsg_subject; } - if( $smilies_on ) + if ( $smilies_on ) { $preview_message = smilies_pass($preview_message); } @@ -1423,7 +1408,7 @@ else if( $submit || $refresh || $mode != "" ) $s_hidden_fields = "<input type=\"hidden\" name=\"folder\" value=\"$folder\" />"; $s_hidden_fields .= "<input type=\"hidden\" name=\"mode\" value=\"$mode\" />"; - if( isset($privmsg_id) ) + if ( isset($privmsg_id) ) { $s_hidden_fields .= "<input type=\"hidden\" name=\"" . POST_POST_URL . "\" value=\"$privmsg_id\" />"; } @@ -1454,7 +1439,7 @@ else if( $submit || $refresh || $mode != "" ) // // Start error handling // - if($error) + if ($error) { $template->set_filenames(array( "reg_header" => "error_body.tpl") @@ -1499,7 +1484,7 @@ else if( $submit || $refresh || $mode != "" ) // // HTML toggle selection // - if($board_config['allow_html']) + if ($board_config['allow_html']) { $html_status = $lang['HTML_is_ON']; $template->assign_block_vars("html_checkbox", array()); @@ -1512,7 +1497,7 @@ else if( $submit || $refresh || $mode != "" ) // // BBCode toggle selection // - if($board_config['allow_bbcode']) + if ($board_config['allow_bbcode']) { $bbcode_status = $lang['BBCode_is_ON']; $template->assign_block_vars("bbcode_checkbox", array()); @@ -1525,7 +1510,7 @@ else if( $submit || $refresh || $mode != "" ) // // Smilies toggle selection // - if($board_config['allow_smilies']) + if ($board_config['allow_smilies']) { $smilies_status = $lang['Smilies_are_ON']; $template->assign_block_vars("smilies_checkbox", array()); @@ -1539,16 +1524,16 @@ else if( $submit || $refresh || $mode != "" ) // Signature toggle selection - only show if // the user has a signature // - if( $user_sig != "" ) + if ( $user_sig != "" ) { $template->assign_block_vars("signature_checkbox", array()); } - if($mode == 'post') + if ($mode == 'post') { $post_a = $lang['Send_a_new_message']; } - else if($mode == 'reply') + else if ($mode == 'reply') { $post_a = $lang['Send_a_reply']; // @@ -1558,14 +1543,14 @@ else if( $submit || $refresh || $mode != "" ) // $mode = "post"; } - else if($mode == 'edit') + else if ($mode == 'edit') { $post_a = $lang['Edit_message']; } $s_hidden_fields = "<input type=\"hidden\" name=\"folder\" value=\"$folder\" />"; $s_hidden_fields .= "<input type=\"hidden\" name=\"mode\" value=\"$mode\" />"; - if($mode == "edit") + if ($mode == "edit") { $s_hidden_fields .= "<input type=\"hidden\" name=\"" . POST_POST_URL . "\" value=\"$privmsg_id\" />"; } @@ -1671,7 +1656,7 @@ else if( $submit || $refresh || $mode != "" ) // // Default page // -if( !$userdata['session_logged_in'] ) +if ( !$userdata['session_logged_in'] ) { $header_location = ( @preg_match("/Microsoft|WebSTAR/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); @@ -1683,7 +1668,7 @@ if( !$userdata['session_logged_in'] ) $sql = "UPDATE " . USERS_TABLE . " SET user_unread_privmsg = user_unread_privmsg + user_new_privmsg, user_new_privmsg = 0, user_last_privmsg = " . $userdata['session_start'] . " WHERE user_id = " . $userdata['user_id']; -if( !$status = $db->sql_query($sql) ) +if ( !$status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update private message new/read status for user.", "", __LINE__, __FILE__, $sql); } @@ -1692,7 +1677,7 @@ $sql = "UPDATE " . PRIVMSGS_TABLE . " SET privmsgs_type = " . PRIVMSGS_UNREAD_MAIL . " WHERE privmsgs_type = " . PRIVMSGS_NEW_MAIL . " AND privmsgs_to_userid = " . $userdata['user_id']; -if( !$status = $db->sql_query($sql) ) +if ( !$status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not update private message new/read status (2) for user.", "", __LINE__, __FILE__, $sql); } @@ -1797,7 +1782,7 @@ switch($folder) // // Show messages over previous x days/months // -if( $submit_msgdays && ( !empty($HTTP_POST_VARS['msgdays']) || !empty($HTTP_GET_VARS['msgdays']) ) ) +if ( $submit_msgdays && ( !empty($HTTP_POST_VARS['msgdays']) || !empty($HTTP_GET_VARS['msgdays']) ) ) { $msg_days = (!empty($HTTP_POST_VARS['msgdays'])) ? $HTTP_POST_VARS['msgdays'] : $HTTP_GET_VARS['msgdays']; $min_msg_time = time() - ($msg_days * 86400); @@ -1805,7 +1790,7 @@ if( $submit_msgdays && ( !empty($HTTP_POST_VARS['msgdays']) || !empty($HTTP_GET_ $limit_msg_time_total = " AND privmsgs_date > $min_msg_time"; $limit_msg_time = " AND pm.privmsgs_date > $min_msg_time "; - if(!empty($HTTP_POST_VARS['msgdays'])) + if (!empty($HTTP_POST_VARS['msgdays'])) { $start = 0; } @@ -1823,33 +1808,33 @@ $sql_tot .= $limit_msg_time_total; // // Get messages // -if( !$pm_tot_status = $db->sql_query($sql_tot) ) +if ( !$pm_tot_status = $db->sql_query($sql_tot) ) { message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot); } else { - if( $db->sql_numrows($pm_tot_status) ) + if ( $db->sql_numrows($pm_tot_status) ) { $row = $db->sql_fetchrow($pm_tot_status); $pm_total = $row['total']; } } -if( !$pm_all_status = $db->sql_query($sql_all_tot) ) +if ( !$pm_all_status = $db->sql_query($sql_all_tot) ) { message_die(GENERAL_ERROR, "Could not query private message information.", "", __LINE__, __FILE__, $sql_tot); } else { - if( $db->sql_numrows($pm_all_status) ) + if ( $db->sql_numrows($pm_all_status) ) { $row = $db->sql_fetchrow($pm_all_status); $pm_all_total = $row['total']; } } -if( !$pm_status = $db->sql_query($sql) ) +if ( !$pm_status = $db->sql_query($sql) ) { message_die(GENERAL_ERROR, "Could not query private messages.", "", __LINE__, __FILE__, $sql); } @@ -1873,7 +1858,7 @@ for($i = 0; $i < count($previous_days); $i++) // // Define correct icons // -if( $folder == "inbox" ) +if ( $folder == "inbox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsg_id") . "\"><img src=\"" . $images['pm_replymsg'] . "\" alt=\"" . $lang['Post_reply_pm'] . "\" border=\"0\"></a>"; @@ -1882,7 +1867,7 @@ if( $folder == "inbox" ) $l_box_name = $lang['Inbox']; } -else if( $folder == "outbox" ) +else if ( $folder == "outbox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = ""; @@ -1891,7 +1876,7 @@ else if( $folder == "outbox" ) $l_box_name = $lang['Outbox']; } -else if( $folder == "savebox" ) +else if ( $folder == "savebox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=reply&" . POST_POST_URL . "=$privmsg_id") . "\"><img src=\"" . $images['pm_replymsg'] . "\" alt=\"" . $lang['Post_reply_pm'] . "\" border=\"0\"></a>"; @@ -1900,7 +1885,7 @@ else if( $folder == "savebox" ) $l_box_name = $lang['Savedbox']; } -else if( $folder == "sentbox" ) +else if ( $folder == "sentbox" ) { $post_pm_img = "<a href=\"" . append_sid("privmsg.$phpEx?mode=post") . "\"><img src=\"" . $images['pm_postmsg'] . "\" alt=\"" . $lang['Post_new_pm'] . "\" border=\"0\"></a>"; $reply_pm_img = ""; @@ -1913,7 +1898,7 @@ else if( $folder == "sentbox" ) // // Output data for inbox status // -if( $folder != "outbox" ) +if ( $folder != "outbox" ) { $inbox_limit_pct = round(( $pm_all_total / $board_config['max_' . $folder . '_privmsgs'] ) * 100); $inbox_limit_img_length = round(( $pm_all_total / $board_config['max_' . $folder . '_privmsgs'] ) * $board_config['privmsg_graphic_length']); @@ -1988,7 +1973,7 @@ $template->assign_vars(array( // // Okay, let's build the correct folder // -if( $pm_count ) +if ( $pm_count ) { for($i = 0; $i < $pm_count; $i++) { @@ -2004,7 +1989,7 @@ if( $pm_count ) $msg_subject = $pm_list[$i]['privmsgs_subject']; - if( count($orig_word) ) + if ( count($orig_word) ) { $msg_subject = preg_replace($orig_word, $replacement_word, $msg_subject); } @@ -2013,7 +1998,7 @@ if( $pm_count ) $msg_date = create_date($board_config['default_dateformat'], $pm_list[$i]['privmsgs_date'], $board_config['board_timezone']); - if( $flag == PRIVMSGS_NEW_MAIL && $folder == "inbox" ) + if ( $flag == PRIVMSGS_NEW_MAIL && $folder == "inbox" ) { $msg_subject = "<b>" . $msg_subject . "</b>"; $msg_date = "<b>" . $msg_date . "</b>"; |
