aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2009-06-26 10:07:59 +0000
committerJoas Schilling <nickvergessen@gmx.de>2009-06-26 10:07:59 +0000
commitd39d8481cfd6a9cd1e418aaff14833a149770e71 (patch)
tree99e61f1a8e686215f41c254cd0c7c1218073eda5
parentf4fb682bbb329145686a88bdb3031b8b74f698f2 (diff)
downloadforums-d39d8481cfd6a9cd1e418aaff14833a149770e71.tar
forums-d39d8481cfd6a9cd1e418aaff14833a149770e71.tar.gz
forums-d39d8481cfd6a9cd1e418aaff14833a149770e71.tar.bz2
forums-d39d8481cfd6a9cd1e418aaff14833a149770e71.tar.xz
forums-d39d8481cfd6a9cd1e418aaff14833a149770e71.zip
Change bug #39505 - Pm history only shows pms of the receipts you currently reply to
Authorised by: acydburn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9677 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/functions_privmsgs.php19
2 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 0fd40d26db..0d09c5dc00 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -148,6 +148,7 @@
<li>[Change] Ability to fetch moderators with get_moderators() even if load_moderators setting is off. (Bug #35955)</li>
<li>[Change] Add WAI-ARIA landmarks for easier accessibility to the prosilver template (Bug #45715 - Patch by MarcoZ)</li>
<li>[Change] &quot;Post details&quot; links with image in MCP. (Bug #39845 - Patch by leviatan21)</li>
+ <li>[Change] Pm history only shows pms of the receipts you currently reply to (Bug #39505 - Patch by nickvergessen)</li>
<li>[Change] Add quote-button for own pm's in pm-history (Bug #37285 - Patch by nickvergessen)</li>
<li>[Feature] Add confirmation for deactivating styles (Bug #14304 - Patch by leviatan21)</li>
<li>[Feature] Add language selection on the registration terms page (Bug #15085 - Patch by leviatan21)</li>
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 271cce9f42..8851b53680 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1691,12 +1691,29 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
{
global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
+ // Select all receipts and the author from the pm we currently view, to only display their pm-history
+ $sql = 'SELECT author_id, user_id
+ FROM ' . PRIVMSGS_TO_TABLE . "
+ WHERE msg_id = $msg_id
+ AND folder_id <> " . PRIVMSGS_HOLD_BOX;
+ $result = $db->sql_query($sql);
+
+ $recipients = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $recipients[] = $row['user_id'];
+ $recipients[] = $row['author_id'];
+ }
+ $db->sql_freeresult($result);
+ $recipients = array_unique($recipients);
+
// Get History Messages (could be newer)
$sql = 'SELECT t.*, p.*, u.*
FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . ' t, ' . USERS_TABLE . ' u
WHERE t.msg_id = p.msg_id
AND p.author_id = u.user_id
- AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ")
+ AND t.folder_id NOT IN (' . PRIVMSGS_NO_BOX . ', ' . PRIVMSGS_HOLD_BOX . ')
+ AND ' . $db->sql_in_set('t.author_id', $recipients) . "
AND t.user_id = $user_id";
if (!$message_row['root_level'])