News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Show Image Instead of Membergroup Title, or Show Title if no image

Started by shadav, August 24, 2019, 11:20:44 PM

Previous topic - Next topic

shadav

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
// 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
// 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)
echo '
<li class="stars">', $message['member']['group_stars'], '</li>';


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

Advertisement: