mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-07 17:27:16 +02:00
- a bunch of bugfixes. :P
git-svn-id: file:///svn/phpbb/trunk@5678 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -573,7 +573,7 @@ class ucp_main
|
||||
'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#' . $row['topic_last_post_id'],
|
||||
'U_LAST_POST_AUTHOR'=> ($row['topic_last_poster_id'] != ANONYMOUS && $row['topic_last_poster_id']) ? "{$phpbb_root_path}memberlist.$phpEx$SID&mode=viewprofile&u={$row['topic_last_poster_id']}" : '',
|
||||
'U_VIEW_TOPIC' => $view_topic_url,
|
||||
'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f=$forum_id}",
|
||||
'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&f={$forum_id}",
|
||||
'U_MOVE_UP' => ($row['order_id'] != 1) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks&move_up={$row['order_id']}" : '',
|
||||
'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&i=main&mode=bookmarks&move_down={$row['order_id']}" : '')
|
||||
);
|
||||
|
@@ -107,7 +107,7 @@ class ucp_pm
|
||||
case 'compose':
|
||||
$action = request_var('action', 'post');
|
||||
|
||||
get_folder($user->data['user_id'], $folder);
|
||||
get_folder($user->data['user_id']);
|
||||
|
||||
if (!$auth->acl_get('u_sendpm'))
|
||||
{
|
||||
@@ -130,7 +130,7 @@ class ucp_pm
|
||||
|
||||
$user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
|
||||
|
||||
get_folder($user->data['user_id'], $folder);
|
||||
get_folder($user->data['user_id']);
|
||||
|
||||
include($phpbb_root_path . 'includes/ucp/ucp_pm_options.'.$phpEx);
|
||||
message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions);
|
||||
@@ -139,7 +139,8 @@ class ucp_pm
|
||||
break;
|
||||
|
||||
case 'drafts':
|
||||
get_folder($user->data['user_id'], $folder);
|
||||
|
||||
get_folder($user->data['user_id']);
|
||||
$this->p_name = 'pm';
|
||||
|
||||
// Call another module... please do not try this at home... Hoochie Coochie Man
|
||||
@@ -300,7 +301,7 @@ class ucp_pm
|
||||
update_unread_status($message_row['unread'], $message_row['msg_id'], $user->data['user_id'], $folder_id);
|
||||
}
|
||||
|
||||
get_folder($user->data['user_id'], $folder, $folder_id);
|
||||
$folder = get_folder($user->data['user_id'], $folder_id);
|
||||
|
||||
$s_folder_options = $s_to_folder_options = '';
|
||||
foreach ($folder as $f_id => $folder_ary)
|
||||
|
@@ -342,7 +342,7 @@ function compose_pm($id, $mode, $action)
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if ($action == 'edit' || $action == 'forward')
|
||||
if ($action == 'edit')
|
||||
{
|
||||
$message_parser->bbcode_uid = $bbcode_uid;
|
||||
}
|
||||
@@ -444,20 +444,8 @@ function compose_pm($id, $mode, $action)
|
||||
// Parse Attachments - before checksum is calculated
|
||||
$message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true);
|
||||
|
||||
// Grab md5 'checksum' of new message
|
||||
$message_md5 = md5($message_parser->message);
|
||||
|
||||
// Check checksum ... don't re-parse message if the same
|
||||
$update_message = ($action != 'edit' || $message_md5 != $message_checksum || $status_switch || $preview) ? true : false;
|
||||
|
||||
if ($update_message)
|
||||
{
|
||||
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
$message_parser->bbcode_bitfield = $bbcode_bitfield;
|
||||
}
|
||||
$message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $img_status, $flash_status, true);
|
||||
|
||||
if ($action != 'edit' && !$preview && !$refresh && $config['flood_interval'] && !$auth->acl_get('u_ignoreflood'))
|
||||
{
|
||||
@@ -504,7 +492,6 @@ function compose_pm($id, $mode, $action)
|
||||
'enable_bbcode' => (bool) $enable_bbcode,
|
||||
'enable_smilies' => (bool) $enable_smilies,
|
||||
'enable_urls' => (bool) $enable_urls,
|
||||
'message_md5' => (int) $message_md5,
|
||||
'bbcode_bitfield' => (int) $message_parser->bbcode_bitfield,
|
||||
'bbcode_uid' => $message_parser->bbcode_uid,
|
||||
'message' => $message_parser->message,
|
||||
@@ -787,7 +774,11 @@ function compose_pm($id, $mode, $action)
|
||||
|
||||
'S_POST_ACTION' => $s_action,
|
||||
'S_HIDDEN_ADDRESS_FIELD'=> $s_hidden_address_field,
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields)
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
|
||||
'S_CLOSE_PROGRESS_WINDOW' => isset($_POST['add_file']),
|
||||
'U_PROGRESS_BAR' => "{$phpbb_root_path}posting.$phpEx$SID&f=0&mode=popup", // do NOT replace & with & here
|
||||
)
|
||||
);
|
||||
|
||||
// Build custom bbcodes array
|
||||
@@ -821,7 +812,7 @@ function compose_pm($id, $mode, $action)
|
||||
*/
|
||||
function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_to, $add_bcc)
|
||||
{
|
||||
global $auth;
|
||||
global $auth, $db;
|
||||
|
||||
// Delete User [TO/BCC]
|
||||
if ($remove_u)
|
||||
|
@@ -281,6 +281,10 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||
$sql = 'INSERT INTO ' . PRIVMSGS_RULES_TABLE . ' ' . $db->sql_build_array('INSERT', $rule_ary);
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Update users message rules
|
||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_message_rules = 1 WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
|
||||
$message = $user->lang['RULE_ADDED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $redirect_url . '">', '</a>');
|
||||
meta_refresh(3, $redirect_url);
|
||||
trigger_error($message);
|
||||
@@ -308,6 +312,21 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
|
||||
$meta_info = "{$phpbb_root_path}ucp.$phpEx$SID&i=pm&mode=$mode";
|
||||
$message = $user->lang['RULE_DELETED'];
|
||||
|
||||
// Reset user_message_rules if no more assigned
|
||||
$sql = 'SELECT rule_id
|
||||
FROM ' . PRIVMSGS_RULES_TABLE . '
|
||||
WHERE user_id = ' . $user->data['user_id'];
|
||||
$result = $db->sql_query_limit($sql, 1);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// Update users message rules
|
||||
if ($row)
|
||||
{
|
||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET user_message_rules = 0 WHERE user_id = ' . $user->data['user_id'];
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
meta_refresh(3, $meta_info);
|
||||
$message .= '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $meta_info . '">', '</a>');
|
||||
trigger_error($message);
|
||||
|
@@ -118,6 +118,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
// Assign inline attachments
|
||||
if (isset($attachments) && sizeof($attachments))
|
||||
{
|
||||
$update_count = array();
|
||||
$unset_attachments = parse_inline_attachments($message, $attachments, $update_count, 0);
|
||||
|
||||
// Needed to let not display the inlined attachments at the end of the message again
|
||||
@@ -125,6 +126,15 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
|
||||
{
|
||||
unset($attachments[$index]);
|
||||
}
|
||||
|
||||
// Update the attachment download counts
|
||||
if (sizeof($update_count))
|
||||
{
|
||||
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
|
||||
SET download_count = download_count + 1
|
||||
WHERE attach_id IN (' . implode(', ', array_unique($update_count)) . ')';
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
$user_info['sig'] = '';
|
||||
|
Reference in New Issue
Block a user