News:

Wondering if this will always be free?  See why free is better.

Main Menu

Adding message author name to user posts list

Started by ILUXA, October 18, 2018, 06:47:49 PM

Previous topic - Next topic

ILUXA

Hello all SMF power users!
Please, help. I want to add message author name (something like $message['member']['name'])
to user post list (template_showPosts), I know that I need to edit /Themes/default/Profile.template.php,
I want to add it to message date, so I need to edit this part of that function:

<span class="smalltext">&#171;&nbsp;<strong>', $txt['on'], ':</strong> ', $post['time'], '&nbsp;&#187;</span>

I want to change it to:

<span class="smalltext"><strong>', $txt['on'], ':</strong> ', $post['time'], '.&nbsp;', $txt['poster'], ': ', $MESSAGE_AUTHOR_NAME, '</span>

What variable should "MESSAGE_AUTHOR_NAME" be? For last several hours I tried to `grep` and `google` some solutions, like "$post['poster']['link']", but neither of them are working...
Any tips are very appreciated.

Arantor

Fairly sure if you're in the profile, the person you're looking at is available in $context['member']

Try $context['member']['name'] or $context['member']['member_name']

Advertisement: