Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Topic started by: shadav on August 24, 2019, 11:20:44 PM

Title: Show Image Instead of Membergroup Title, or Show Title if no image
Post by: shadav on August 24, 2019, 11:20:44 PM
so I saw a lot of posts about how to replace the member group title with an image
but  :-\ what happens if one of your groups doesn't have an image  :P

so for 2.0.15 (sorry can't help with any other versions)
this is only for the default (curve) theme, so you'll need to figure out on an edited theme/different theme

open Display.template.php (theme/default/Display.template.php)

find
Code: [Select]
// Show the member's primary group (like 'Administrator') if they have one.
if (!empty($message['member']['group']))
echo '
<li class="membergroup">', $message['member']['group'], '</li>';
replace
Code: [Select]
// Show the member's primary group (like 'Administrator') if they have one.
if (!empty($message['member']['group_stars']))
echo '
<li class="stars">', $message['member']['group_stars'], '</li>';
else
if (!empty($message['member']['group']))
echo '
<li class="membergroup">', $message['member']['group'], '</li>';

then find and remove (to stop it from showing up twice)
Code: [Select]
echo '
<li class="stars">', $message['member']['group_stars'], '</li>';

if this has been posted, sorry I didn't see it.....