From 49f0ab0ccd1475be2ccd0661714628f40a370efd Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Tue, 27 Jan 2009 00:01:48 +0000 Subject: [PATCH] =?UTF-8?q?Fixed=20bug=20#40325=20=E2=80=93=20Friend/foe?= =?UTF-8?q?=20system=20displays=20posts=20made=20by=20foes=20while=20compo?= =?UTF-8?q?sing=20Authorised=20by:=20acydburn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9305 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_posting.php | 15 ++++++++++++++- .../styles/prosilver/template/posting_review.html | 10 ++++++++-- .../prosilver/template/posting_topic_review.html | 7 +++++++ phpBB/styles/prosilver/theme/content.css | 6 +++++- .../subsilver2/template/posting_review.html | 4 ++++ .../subsilver2/template/posting_topic_review.html | 6 +++++- 7 files changed, 44 insertions(+), 5 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 907dab34c5..fa05bdd3b8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -90,6 +90,7 @@
  • [Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)
  • [Fix] Posts incremented for multiple approval of the same topic (Bug #40495 - Patch by TerraFrost)
  • [Fix] Missing end " in quote bb tag deletes text (Bug #40565 - Patch by TerraFrost)
  • +
  • [Fix] Friend/foe system displays posts made by foes while composing (Bug #40325 - Patch by TerraFrost and Highway of Life)
  • [Fix] Missing read permission from calls to phpbb_chmod()
  • [Fix] Correctly display future dates (Bug #38755)
  • [Change] Allow download of conflicting file for later reference in automatic updater
  • diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 4d96fb9537..f7fe3e5f38 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -963,13 +963,20 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id } $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*', + 'SELECT' => 'u.username, u.user_id, u.user_colour, p.*, z.friend, z.foe', 'FROM' => array( USERS_TABLE => 'u', POSTS_TABLE => 'p', ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(ZEBRA_TABLE => 'z'), + 'ON' => 'z.user_id = ' . $user->data['user_id'] . ' AND z.zebra_id = p.poster_id' + ) + ), + 'WHERE' => $db->sql_in_set('p.post_id', $post_list) . ' AND u.user_id = p.poster_id' )); @@ -1060,6 +1067,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id $post_subject = censor_text($post_subject); + $post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id']; + $u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&t=$topic_id&p={$row['post_id']}&view=show#p{$row['post_id']}"); + $template->assign_block_vars($mode . '_row', array( 'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), 'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), @@ -1067,6 +1077,9 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id 'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), 'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false, + 'S_FRIEND' => ($row['friend']) ? true : false, + 'S_IGNORE_POST' => ($row['foe']) ? true : false, + 'L_IGNORE_POST' => ($row['foe']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), "", '') : '', 'POST_SUBJECT' => $post_subject, 'MINI_POST_IMG' => $user->img('icon_post_target', $user->lang['POST']), diff --git a/phpBB/styles/prosilver/template/posting_review.html b/phpBB/styles/prosilver/template/posting_review.html index 10616901b6..78b994c989 100644 --- a/phpBB/styles/prosilver/template/posting_review.html +++ b/phpBB/styles/prosilver/template/posting_review.html @@ -3,10 +3,16 @@

    {L_POST_REVIEW_EXPLAIN}

    -
    + +
    + {post_review_row.L_IGNORE_POST} + +
    +
    + -
    +

    {post_review_row.POST_SUBJECT}

    {post_review_row.MINI_POST_IMG}{post_review_row.MINI_POST_IMG} {L_POST_BY_AUTHOR} {post_review_row.POST_AUTHOR_FULL} » {post_review_row.POST_DATE}

    {post_review_row.MESSAGE}
    diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index 3f9c25cb2a..428a830ef3 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -6,8 +6,15 @@
    + + +
    +
    + {topic_review_row.L_IGNORE_POST} +
    +
    diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css index 00342604bb..b6d3efa8a3 100644 --- a/phpBB/styles/prosilver/theme/content.css +++ b/phpBB/styles/prosilver/theme/content.css @@ -280,6 +280,10 @@ div[class].topic-actions { border-bottom-width: 0; } +.post-ignore .postbody { + display: none; +} + /* Content container styles ----------------------------------------*/ .content { @@ -750,4 +754,4 @@ dl.pmlist dt textarea { dl.pmlist dd { margin-left: 61% !important; margin-bottom: 2px; -} +} \ No newline at end of file diff --git a/phpBB/styles/subsilver2/template/posting_review.html b/phpBB/styles/subsilver2/template/posting_review.html index c3a7f7aead..13e895e95a 100644 --- a/phpBB/styles/subsilver2/template/posting_review.html +++ b/phpBB/styles/subsilver2/template/posting_review.html @@ -19,6 +19,9 @@ + + {post_review_row.L_IGNORE_POST} + @@ -82,6 +85,7 @@
    + diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html index 9ac6f90d9e..d1af72b522 100644 --- a/phpBB/styles/subsilver2/template/posting_topic_review.html +++ b/phpBB/styles/subsilver2/template/posting_topic_review.html @@ -15,6 +15,9 @@ + + {topic_review_row.L_IGNORE_POST} + @@ -81,6 +84,7 @@
    + @@ -91,4 +95,4 @@ -
    +
    \ No newline at end of file