MyBB-Plugins Forums
Help with some edit... - Printable Version

+- MyBB-Plugins Forums (http://forums.mybb-plugins.com)
+-- Forum: Archived Forums (http://forums.mybb-plugins.com/Forum-Archived-Forums)
+--- Forum: MyBB 1.4.x (http://forums.mybb-plugins.com/Forum-MyBB-1-4-x)
+---- Forum: General (http://forums.mybb-plugins.com/Forum-General)
+---- Thread: Help with some edit... (/Thread-Help-with-some-edit)



Help with some edit... - m3krip - 10-18-2010

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.


RE: Help with some edit... - Diogo Parrinha - 10-18-2010

$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.


RE: Help with some edit... - m3krip - 10-18-2010

Ah... ok. There's a plugin that enables php in templates but I've heard is dangerous, it can be exploited easily...


RE: Help with some edit... - Diogo Parrinha - 10-19-2010

If you allow other people to edit the templates then yes it's dangerous


RE: Help with some edit... - m3krip - 10-25-2010

(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 ?


RE: Help with some edit... - Diogo Parrinha - 10-25-2010

(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']) 



RE: Help with some edit... - m3krip - 10-25-2010

Thx, it worked Smile


RE: Help with some edit... - Diogo Parrinha - 10-25-2010

Great to hear that!