General Community > Scripting Help

Hiding Avatar on first post only ??

(1/3) > >>

Mick.:
So i'm redesigning how my display.template looks in my forum. The idea is to hide the avatar on first post only but still show the avatars from users when there are replies. (Mind you, I'm the only one who creates topics. All my boards are reply only.)

I cant seem to crack the formula so i post here...

I added an (if) so it takes care of the first post thingy... but as expected, it shows the avatar in first post only while the the other avatars are gone.  How can we do this backwards?


--- Code: --- // Show the user's avatar.
if ($message['id'] == $context['topic_first_message'])
{
if (!empty($modSettings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

echo '
<li class="avatar">
<a href="', $message['member']['href'], '">', $message['member']['avatar']['image'], '</a>';
echo '
', $message['member']['link'];
echo '
on <a href="', $message['href'], '" rel="nofollow" title="', !empty($message['counter']) ? sprintf($txt['reply_number'], $message['counter'], ' - ') : '', $message['subject'], '" class="smalltext">', $message['time'], '</a>
</li>';
}
--- End code ---

Sir Osis of Liver:

--- Code: ---
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

if ($message['id'] != $context['topic_first_message'])

echo '
<li class="avatar">
<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
', $message['member']['avatar']['image'], '
</a>
</li>';


--- End code ---

Mick.:

--- Quote from: Sir Osis of Liver on December 22, 2020, 06:07:08 PM ---
--- Code: ---
if (!empty($settings['show_user_images']) && empty($options['show_no_avatars']) && !empty($message['member']['avatar']['image']))

if ($message['id'] != $context['topic_first_message'])

echo '
<li class="avatar">
<a href="', $scripturl, '?action=profile;u=', $message['member']['id'], '">
', $message['member']['avatar']['image'], '
</a>
</li>';


--- End code ---

--- End quote ---
This hides everything. Ive been there lol

Sir Osis of Liver:
Works on test install, avatar is blocked only on topic starter.

http://www.thekrashsite.com/smf20/index.php?topic=4.msg19#new

Mick.:

--- Quote from: Sir Osis of Liver on December 22, 2020, 06:17:12 PM ---Works on test install, avatar is blocked only on topic starter.

--- End quote ---
What it did was remove the avatar on first post and replies thereafter only leaving the names intact. The idea is to "hide" the avatar on first post while avatars are visible after replies.

Navigation

[0] Message Index

[#] Next page

Go to full version