aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_privmsgs.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/functions_privmsgs.php')
-rw-r--r--phpBB/includes/functions_privmsgs.php17
1 files changed, 11 insertions, 6 deletions
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 4926cabf2c..05653f7e3b 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1350,7 +1350,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . '
AND ug.user_pending = 0
AND u.user_id = ug.user_id
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
$sql_allow_pm;
$result = $db->sql_query($sql);
@@ -1571,8 +1571,8 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
if ($space_taken && $files_added)
{
- set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
- set_config('num_files', $config['num_files'] + $files_added, true);
+ set_config_count('upload_dir_size', $space_taken, true);
+ set_config_count('num_files', $files_added, true);
}
}
@@ -1763,8 +1763,14 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
$next_history_pm = $previous_history_pm = $prev_id = 0;
- foreach ($rowset as $id => $row)
+ // Re-order rowset to be able to get the next/prev message rows...
+ $rowset = array_values($rowset);
+
+ for ($i = 0, $size = sizeof($rowset); $i < $size; $i++)
{
+ $row = &$rowset[$i];
+ $id = (int) $row['msg_id'];
+
$author_id = $row['author_id'];
$folder_id = (int) $row['folder_id'];
@@ -1795,8 +1801,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
if ($id == $msg_id)
{
- $next_history_pm = next($rowset);
- $next_history_pm = (sizeof($next_history_pm)) ? (int) $next_history_pm['msg_id'] : 0;
+ $next_history_pm = (isset($rowset[$i + 1])) ? (int) $rowset[$i + 1]['msg_id'] : 0;
$previous_history_pm = $prev_id;
}