MyBB Community Forums

Full Version: [Request] Username color in Forumdisplay the same as Showthread
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Could be awesome if group colors in ShowThread.php could be used in Forumdisplay.php too...

Is there some kind of tutorial to do this?


Thanks
This shows lastposter in usergroupcolor
Open forumdisplay.php


Search for:
$lastposterlink = build_profile_link($lastposter, $lastposteruid);

replace with:
$lastpostgroup='';
$lastpostgroup=$db->fetch_field($db->query("SELECT usergroup FROM ".TABLE_PREFIX."users WHERE uid='$lastposteruid'"),"usergroup");
$lastposterlink = "<a href='member.php?action=profile&amp;uid=$lastposteruid'>".format_name($lastposter, $lastpostgroup)."</a>";

Regards NetHunter
how do you get it to show on the forum index aswell?
open ./inc/functions_forumlist.php

search
$lastpost_profilelink = build_profile_link($lastpost_data['lastposter'], $lastpost_data['lastposteruid']);

replace with:
global $db;
                    $lastposter_query = $db->query("SELECT username, usergroup, displaygroup FROM ".TABLE_PREFIX."users WHERE uid='".$lastpost_data['lastposteruid']."'");
                       $lastposter_format = $db->fetch_array($lastposter_query);
                     $lastposter = format_name($lastposter_format['username'], $lastposter_format['usergroup'], $lastposter_format['displaygroup']); 
                    $lastpost_profilelink = build_profile_link($lastposter, $lastpost_data['lastposteruid']); 

mod by Lex-
thank you!!!! works perfect!
Thanks!