MyBB Community Forums

Full Version: How can I go about adding the users username + username style to a custom page?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I've gone and created a custom page and I've been able to get the users username, but have yet to find a way to find the users username style and apply that to the username. Any help would be appreciated!

http://forums.roleplayresurgence.com/donate.php
(I know nothing shows up for your username if you are using the page as a guest, I'm working on that.)
Can you please paste the query you are using to fetch user information ?
(2017-06-16, 02:32 PM)WallBB Wrote: [ -> ]Can you please paste the query you are using to fetch user information ?

Hello {$mybb->user[username]}!
Add in the donate.php file:
(add it before the output of the template)

$formatted_username = format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']);

And use:

{$formatted_username}

in the template.
Would I make the same edits as above if I wanted the formatted usernames to show up using the Page Manager pages?
Not sure how the page manager works but any custom page that includes global.php should be able to be formatted like the example given.
I'm using OUGC Pages and Style Username and I simply can't get the usernames to colour using the above information.

This is the page: Link

All of the profile links should be coloured, but no matter what combination I try to use the code in, it just won't work. Any advice?
It could be your styles are getting overridden. This is in your global.css"
a:hover, a:active {
    color: #F7B913;
}
and is the color all your links are.

Edit: That's the link color when you hover/click them, this is the color they all normally are:
!important;
color: #FA7810;
text-decoration: none;
Sorry to hijack...How would you apply this to portal latest threads -> lastposter, where you have:

$lastposterlink = build_profile_link($lastposter, $thread['lastposteruid']);
@ThistleProse:

I already posted a possible solution right here => https://community.mybb.com/thread-209523...pid1277001