News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Custom CSS in membergroup

Started by gecitli, October 31, 2019, 08:02:58 AM

Previous topic - Next topic

gecitli

Hi how do I adapt these codes to smf 2.1


if ($user_info['groups']['0'] == 1)
echo '
<li class="membergroup" style="color: #FFF; text-shadow: 0 1px 0 #000; border-radius: 4px;width: 136px;line-height: 19px;margin-bottom: 3px;background-color: #FF0000; text-align: center;">Admin</li>';


if ($user_info['groups']['0'] == 3)
echo '
<li class="membergroup" style="color: #FFF; text-shadow: 0 1px 0 #000; border-radius: 4px;width: 136px;line-height: 19px;margin-bottom: 3px;background-color: #00FF00; text-align: center;">Moderator</li>';


related topic https://www.simplemachines.org/community/index.php?topic=560356.msg3972667#msg3972667
http://www.webtiryaki.com
webmaster forumu
Free & Premium Responsive Themes for SMF.

Antes

Instead going that route change

// 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>';


with
// Show the member's primary group (like 'Administrator') if they have one.
if (!empty($message['member']['group']))
echo '
<li class="membergroup" id="', $message['member']['group'], '">', $message['member']['group'], '</li>';


now you can push your custom CSS to header (either with custom CSS file or in-built CSS method) with specific ID.

gecitli

http://www.webtiryaki.com
webmaster forumu
Free & Premium Responsive Themes for SMF.

Advertisement: