aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-03-21 19:23:34 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-03-21 19:23:34 +0000
commit21de871aff0392803dd98ab8a895fabac35f4219 (patch)
treeaa052fe762be977462e92b755e59dacb0c4ea559 /phpBB/includes/ucp
parent44c60cff4de351523f950ca7fac114d1a2769b82 (diff)
downloadforums-21de871aff0392803dd98ab8a895fabac35f4219.tar
forums-21de871aff0392803dd98ab8a895fabac35f4219.tar.gz
forums-21de871aff0392803dd98ab8a895fabac35f4219.tar.bz2
forums-21de871aff0392803dd98ab8a895fabac35f4219.tar.xz
forums-21de871aff0392803dd98ab8a895fabac35f4219.zip
- a bunch of bugfixes. :P
git-svn-id: file:///svn/phpbb/trunk@5678 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_main.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm.php9
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php25
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php19
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php10
5 files changed, 43 insertions, 22 deletions
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index 413ec5c1fb..3ee5d01eda 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -573,7 +573,7 @@ class ucp_main
'U_LAST_POST' => $view_topic_url . '&amp;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&amp;mode=viewprofile&amp;u={$row['topic_last_poster_id']}" : '',
'U_VIEW_TOPIC' => $view_topic_url,
- 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f=$forum_id}",
+ 'U_VIEW_FORUM' => "{$phpbb_root_path}viewforum.$phpEx$SID&amp;f={$forum_id}",
'U_MOVE_UP' => ($row['order_id'] != 1) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=main&amp;mode=bookmarks&amp;move_up={$row['order_id']}" : '',
'U_MOVE_DOWN' => ($row['order_id'] != $max_order_id) ? "{$phpbb_root_path}ucp.$phpEx$SID&amp;i=main&amp;mode=bookmarks&amp;move_down={$row['order_id']}" : '')
);
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index b4639c1788..7e2fb0a901 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -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)
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 851c06c2b6..fcdeb65541 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -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 &amp; 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)
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 41475b2f8b..40f8baba7a 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -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&amp;i=pm&amp;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);
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 8b9d4d859d..bb8a89a879 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -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'] = '';