MyBB Community Forums

Full Version: Formated Username
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi, whats the code for a formated link to my profile. By this I mean so it would be red, if my rank colour is red. In the box with nothing in.

http://gyazo.com/2e799070b43e502cbf3327070045a24e

Currently i'm using "{$mybb->user['username']}" In that spot and it shows my name, but unformated.

<div class="container">
<div class="row">
<div class="sidebar">
<div class="sideborder">
<div class="tcat" style="padding: 6px;">
<!-- I want it here--><td class="tcat" <strong>{$post['profilelink']}</strong></td>
</div>
<div class="trow1" style="padding: 6px; overflow: show;">
<div class="avatar">
<img src="{$mybb->user['avatar']}" height="75px" width="75px" alt="Your Avatar" title="Your Avatar" />
</div>
<div class="userstats">
Posts<a href="{$mybb->settings['bburl']}/search.php?action=finduser&uid={$mybb->user['uid']}" ><span style="float: right; font-weight: bold;">{$mybb->user['postnum']}</span></a><br />
                        Referrals<span style="float: right; font-weight: bold;">{$mybb->user['referrals']}</span><br />
                         Reputation<a href="{$mybb->settings['bburl']}/reputation.php?uid={$mybb->user['uid']}" ><span style="float: right; font-weight: bold;">{$mybb->user['reputation']}</span></a><br />

</div>
</div>
</div>

<!-- Below-->


<!-- Above -->

<div style="clear: both;"></div>
</div>
<div class="forums">
Thats not what I wanted.

I want this: http://gyazo.com/3a386e004fca9ca3d2c8e03cdbc4d341

To show like

This: http://gyazo.com/524005a88154652a7751150fb605fa40

Where my name is in Red and links to my profile.
If you want to change the colour of the username of a specific group then just go to ACP>Users & Groups>Groups and after that select the group of which you want to change username colour.
After selecting, post the following code in Username Style text box.
<span style="color: red;"><strong><em>{username}</em></strong></span>
Please read what I have said. I'm not trying to change a group colour.
I'm trying to put this:

http://gyazo.com/524005a88154652a7751150fb605fa40

To look like this.

http://gyazo.com/524005a88154652a7751150fb605fa40


It should do it automatically for all users.
Please try to use {$formattedname} in your template.
{$post['profilelink']} variable automatically does what you want (If I read OP correct) and you already have it in your template.
Remember that {$post['profilelink']} variable would only work in postbit template.
(2014-07-06, 04:01 PM)Cube Prime Wrote: [ -> ]Please read what I have said. I'm not trying to change a group colour.
I'm trying to put this:

http://gyazo.com/524005a88154652a7751150fb605fa40

To look like this.

http://gyazo.com/524005a88154652a7751150fb605fa40


It should do it automatically for all users.

Firstly, you format the username for everyone in your usergroup through the Admin CP. (Admin CP -> Users & Groups -> Groups -> usergroup name) like The fire said.
Second, fix this code:
<td class="tcat" <strong>{$post['profilelink']}</strong></td>
to
<td class="tcat"><strong>{$post['profilelink']}</strong></td>

If you want individually formatted names, you'll need a plugin for that like .M. suggested