MyBB Community Forums

Full Version: Code Help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello! Big Grin I need help on a code I made (regarding to user profiles.)

<font face="SANS-SERIF"><b><font size="6"><center>{$mybb->user['username']}</center></font></b></font>

The point of this code is to have the user's username appear on the top of their profile, for fancy purposes. Toungue

As it does work when the user enters their profile, they will find that their username also appears on other profiles. That is a no-no.

How do I make it so this code doesn't repeat when a user goes on another user's profile?

Thanks. Smile
(2013-01-14, 03:26 AM)DaedricPrince Wrote: [ -> ]Hello! Big Grin I need help on a code I made (regarding to user profiles.)

<font face="SANS-SERIF"><b><font size="6"><center>{$mybb->user['username']}</center></font></b></font>

The point of this code is to have the user's username appear on the top of their profile, for fancy purposes. Toungue

As it does work when the user enters their profile, they will find that their username also appears on other profiles. That is a no-no.

How do I make it so this code doesn't repeat when a user goes on another user's profile?

Thanks. Smile

Well it only makes sense. You're calling the current logged in users username...not the username from the profile page.

My only idea is to use the {$formattedname} in place of {$mybb->user['username']} and then reformat that to whatever you'd like using !important stylesheet rules.

Also, please try to refrain from using the center tag. It is deprecated. Also, tags should be lowercase...not uppercase.
(2013-01-14, 03:41 AM)Jason L. Wrote: [ -> ]
(2013-01-14, 03:26 AM)DaedricPrince Wrote: [ -> ]Hello! Big Grin I need help on a code I made (regarding to user profiles.)

<font face="SANS-SERIF"><b><font size="6"><center>{$mybb->user['username']}</center></font></b></font>

The point of this code is to have the user's username appear on the top of their profile, for fancy purposes. Toungue

As it does work when the user enters their profile, they will find that their username also appears on other profiles. That is a no-no.

How do I make it so this code doesn't repeat when a user goes on another user's profile?

Thanks. Smile

Well it only makes sense. You're calling the current logged in users username...not the username from the profile page.

My only idea is to use the {$formattedname} in place of {$mybb->user['username']} and then reformat that to whatever you'd like using !important stylesheet rules.

Also, please try to refrain from using the center tag. It is deprecated. Also, tags should be lowercase...not uppercase.

Though, I am not a professional coder and have no knowledge whatsoever regarding to !important rules, I'll study a bit.