Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: ILUXA on September 19, 2018, 09:21:20 AM

Title: Hide "Reply" and "Quote" next to your own PMs in conversation
Post by: ILUXA on September 19, 2018, 09:21:20 AM
There was a mod (http://custom.simplemachines.org/mods/index.php?mod=3823), that sets default look of private messages to conversation (dialog),
it was called "PM Settings", probably it was deleted by the author, but I have a copy, attaching it to this post,
it is very useful, because in SMF by default PMs are shown in pretty old way, after installing this mod,
you'll be able to set default PM look for all users in Admin -- Modification settings.

In conversation, you'll see "Reply" and "Quote" buttons even next to your PMs, and if you'll click it,
you'll write an answer to yourself :) and not to conversation, so user with whom you have a conversation with,
will never see it, some users are confused with this. I found out how to change this appearance,
edit /Themes/Theme/PersonalMessage.template.php, search for "reply_button" and "quote_button" inside of "<li>"
echo '
<li class="reply_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $txt['reply'], '</a></li>
<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>';

And add "if ($message['member']['id'] != $context['user']['id'])" before "echo":
if ($message['member']['id'] != $context['user']['id'])
echo '
<li class="reply_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';u=', $message['member']['id'], '">', $txt['reply'], '</a></li>
<li class="quote_button"><a href="', $scripturl, '?action=pm;sa=send;f=', $context['folder'], $context['current_label_id'] != -1 ? ';l=' . $context['current_label_id'] : '', ';pmsg=', $message['id'], ';quote', $context['folder'] == 'sent' ? '' : ';u=' . $message['member']['id'], '">', $txt['quote'], '</a></li>';


Then you won't see any "Reply" or "Quote" buttons next to your own PMs —
(https://i.imgur.com/VFzyXf2.png)
Title: Re: Hide "Reply" and "Quote" next to your own PMs in conversation
Post by: Steve on September 28, 2018, 07:21:02 PM
I've approved this topic.