MyBB Community Forums

Full Version: PHP in Username Style?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Would it somehow be able to put a PHP code inside the Username Style?

Or do I have to find everywhere where the username is shown in the templates and the put it there?
what exactly are you trying to do?
Same as brad. If you're asking username style, theres a plugin for it.
(2012-05-27, 07:40 PM)crazy4cs Wrote: [ -> ]Same as brad. If you're asking username style, theres a plugin for it.

Really! Where?!?!?! Big Grin
(2012-05-27, 08:00 PM)vernier Wrote: [ -> ]http://mods.mybb.com/view/username-style

Hmm. Well, it was not really that I wanted.

I wanted to use php to do like this:

if $mybb->user['addiation_usergroup'] include "Supporter" then {
echo "S";
}else{
echo "";
}

I need this to put up an "S" in the front of each member which are in the group "Supporters".

And it should also check addiational usergroups, and not only the main usergroup.

Any ideas if this can be done somehow?
Just add an "S" in front of the Supporter username style.
(2012-05-27, 08:09 PM)Fábio Maia Wrote: [ -> ]Just add an "S" in front of the Supporter username style.

But what if they dont have that usergroup set to default?
The easiest way to do this would be with ZingaBurga's Template conditional plugin. The code you would need would be something like:

<if (stripos(','.$post['additionalgroups'].',', ',10,') !== false) then>
woot					
</if>

Where 10 is the additional usergroup and woot is what you want to display.

If you wanted to have that for users who have the usergroup set as their main user then you can put an or in:

<if (stripos(','.$post['additionalgroups'].',', ',15,') !== false || $post['usergroup'] == 10 ) then>
woot					
</if>