Current time: 05-20-2012, 09:17 AM Hello There, Guest! (LoginRegister)




MySubscriptions, Donation Bar, MyDownloads, MyAchievements and support for our free and paid plugins. All that for $7!

Advertise Here!
Are you looking to advertise on this forum? Please read this announcement thread.

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with some edit...
10-18-2010, 05:34 AM
Post: #1
Help with some edit...
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.
Find all posts by this user
Quote this message in a reply

10-18-2010, 06:52 AM
Post: #2
RE: Help with some edit...
$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.

[Image: s.png]
Find all posts by this user
Quote this message in a reply
10-18-2010, 06:24 PM
Post: #3
RE: Help with some edit...
Ah... ok. There's a plugin that enables php in templates but I've heard is dangerous, it can be exploited easily...
Find all posts by this user
Quote this message in a reply
10-19-2010, 03:47 AM
Post: #4
RE: Help with some edit...
If you allow other people to edit the templates then yes it's dangerous

[Image: s.png]
Find all posts by this user
Quote this message in a reply

10-25-2010, 01:00 AM
Post: #5
RE: Help with some edit...
(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 ?
Find all posts by this user
Quote this message in a reply
10-25-2010, 05:25 AM
Post: #6
RE: Help with some edit...
(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']) 

[Image: s.png]
Find all posts by this user
Quote this message in a reply
10-25-2010, 06:30 AM
Post: #7
RE: Help with some edit...
Thx, it worked Smile
Find all posts by this user
Quote this message in a reply

10-25-2010, 07:10 AM
Post: #8
RE: Help with some edit...
Great to hear that!

[Image: s.png]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)