MyBB Community Forums

Full Version: Changing Post Author Colour to Group colour
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi how would i go about changing the Author Colour for a post to a group colour as my links are currently blue and i want to change them to a group colour, e.g. green for admins, red for moderators etc. So members know what group the users belong to.
In which page exactly?

forumdisplay, portal, index?
ACP >> USERS and Groups (See the Left Bar) . Here is the option Groups. Open it and there will be list of groups. Click on any group for which you want to change color. Then there is a option to change color.[ May be the group name dont remember exact option name, but the field has something like this {username} ]
(2011-08-28, 07:51 AM)Sama34 Wrote: [ -> ]In which page exactly?

forumdisplay, portal, index?

The Forum Display Page

(2011-08-28, 07:58 AM)sunjava1 Wrote: [ -> ]ACP >> USERS and Groups (See the Left Bar) . Here is the option Groups. Open it and there will be list of groups. Click on any group for which you want to change color. Then there is a option to change color.[ May be the group name dont remember exact option name, but the field has something like this {username} ]
How can i make the post author look like this
[Image: captur11.png]

instead of this

[Image: captur10.png]
I've tried editing that but it doesn't work

I want it to look like this on the Forum Display Page
[Image: captur12.png]
File: forumdisplay.php
Find:
// Don't link to guest's profiles (they have no profile).
if($lastposteruid == 0)
{
$lastposterlink = $lastposter;
}
else
{
$lastposterlink = build_profile_link($lastposter, $lastposteruid);
}

Replace:
if($lastposteruid == 0)
        {
            $lastposterlink = $lastposter;
        }
        else
        {
            $user_lastpost = get_user($lastposteruid);
            $lastposter_formar = format_name($user_lastpost['username'], $user_lastpost['usergroup'], $user_lastpost['displaygroup']);
            $lastposterlink = build_profile_link($lastposter_formar, $user_lastpost['uid']);
        }
Find:
$thread['author'] = $thread['uid'];
if(!$thread['username'])
{
$thread['username'] = $thread['threadusername'];
$thread['profilelink'] = $thread['threadusername'];
}
else
{
$thread['profilelink'] = build_profile_link($thread['username'], $thread['uid']);
}

Replace:
$thread['author'] = $thread['uid'];
        if(!$thread['username'])
        {
            $thread['username'] = $thread['threadusername'];
            $thread['profilelink'] = $thread['threadusername'];
        }
        else
        {
            $userformat = get_user($thread['uid']);
            $thread_format = format_name($userformat['username'], $userformat['usergroup'], $userformat['displaygroup']);
            $thread['profilelink'] = build_profile_link($thread_format, $thread['uid']);
        }

Source: http://www.mybb-es.com/Hilo-formato-del-...das-partes

Thanks to Edson Ordaz.
Sorry for up this thread, but i have question. How it make this on View New Posts | View Today's Posts? Because there is not colored post author names...
This plugin may be what you are looking for

http://community.mybb.com/thread-88052.html
(2013-02-11, 12:15 PM)Leefish Wrote: [ -> ]This plugin may be what you are looking for

http://community.mybb.com/thread-88052.html
But if i dont want use any plugins(because i have it much)? is posible to make that by hands what i want? Im sure that need change something in search.php and usercp.php

im talking about colored names on this links:

/search.php?action=getdaily
/search.php?action=getnew
/usercp.php

EDIT: ok, im almost finished usercp.php, just have 1 problem. On my first Your Latest Thread i dont see my name. What im missed?

$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);
$thread['author'] = build_profile_link($thread_format, $thread['uid']);
$userformat = get_user($thread['uid']);
$thread_format = format_name($userformat['username'], $userformat['usergroup'], $userformat['displaygroup']);

screen: http://img854.imageshack.us/img854/5665/82849218.jpg


EDIT2: fixed usercp.php

$thread['replies'] = my_number_format($thread['replies']);
$thread['views'] = my_number_format($thread['views']);
$userformat = get_user($thread['uid']);
$thread_format = format_name($userformat['username'], $userformat['usergroup'], $userformat['displaygroup']);
$thread['author'] = build_profile_link($thread_format, $thread['uid']);

EDIT3:
thanks, i finished it by self on search.php and on usercp.php Smile was not so hard Toungue