News:

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

Main Menu

Custom CSS in membergroup

Started by PaxDax, May 14, 2018, 11:22:45 PM

Previous topic - Next topic

PaxDax

Hi guys, i want something like this:



I just want to add like that, custom CSS to my Admin Group and Mod Group, with different colors to look like that in posts.

This is the code they are using that i don't know where to put:

<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">Fundador</li>

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Sir Osis of Liver

Actually, it's not an image, it's html/css.

Display.template.php



echo '
<li class="stars">', $message['member']['group_stars'], '</li>';

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;">Fundador</li>';


// Show avatars, images, etc.?



Something like that, you can play with the formatting.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

PaxDax

Quote from: Sir Osis of Liver on May 15, 2018, 01:05:54 AM
Actually, it's not an image, it's html/css.

Display.template.php



echo '
<li class="stars">', $message['member']['group_stars'], '</li>';

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;">Fundador</li>';


// Show avatars, images, etc.?



Something like that, you can play with the formatting.

Hey, thanks for the support, the problem is that depending on the user group they change color, title and design. If is Mods Group, design changes to green with other shadows, Admins Group it changes again, etc. With this code the design changes for all groups, not only Mods or Admins or only one.

Sir Osis of Liver

You'd have to use if statements that identify primary membergroup and display the appropriate badge.  Like this -



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



You can clean it up by putting most of the formatting in 'membergroup' class in index.css, just leave the color and title in template code.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

PaxDax

Quote from: Sir Osis of Liver on May 15, 2018, 05:06:05 PM
You'd have to use if statements that identify primary membergroup and display the appropriate badge.  Like this -



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



You can clean it up by putting most of the formatting in 'membergroup' class in index.css, just leave the color and title in template code.

Working, thanks for helping me, appreciate it.

Advertisement: