MyBB-Plugins Forums

Full Version: Help with some edit...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm editing in v1.4 the header_welcomeblock_member for a custom theme and I want to get the user name with style too.

I have for example now: {$mybb->user['username']} and it shows only his name.

But I want to display his group style too... red, blue or whatever his group color and style is.

Please Help. Thx.
$mybb->user['username'] is just the name of the user. You can't style it without running a PHP function.

This does not work like that.
Ah... ok. There's a plugin that enables php in templates but I've heard is dangerous, it can be exploited easily...
If you allow other people to edit the templates then yes it's dangerous
(10-19-2010, 03:47 AM)Pirata Nervo Wrote: [ -> ]If you allow other people to edit the templates then yes it's dangerous

I'm the only admin so it's ok then.

How could I get the users style using php then ?
(10-25-2010, 01:00 AM)m3krip Wrote: [ -> ]
(10-19-2010, 03:47 AM)Pirata Nervo Wrote: [ -> ]If you allow other people to edit the templates then yes it's dangerous

I'm the only admin so it's ok then.

How could I get the users style using php then ?

You'd need to use something like:
PHP Code:
format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']) 
Thx, it worked Smile
Great to hear that!