MyBB Community Forums
[Request] Username color in Forumdisplay the same as Showthread - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Requests (https://community.mybb.com/forum-65.html)
+---- Thread: [Request] Username color in Forumdisplay the same as Showthread (/thread-35312.html)



[Request] Username color in Forumdisplay the same as Showthread - aglioeolio - 2008-08-08

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


RE: [Request] Username color in Forumdisplay the same as Showthread - NetHunter - 2008-08-11

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


RE: [Request] Username color in Forumdisplay the same as Showthread - topps - 2008-08-11

how do you get it to show on the forum index aswell?


RE: [Request] Username color in Forumdisplay the same as Showthread - mister_don - 2008-08-12

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-


RE: [Request] Username color in Forumdisplay the same as Showthread - topps - 2008-08-12

thank you!!!! works perfect!


RE: [Request] Username color in Forumdisplay the same as Showthread - Snorlaxative - 2008-08-12

Thanks!


RE: [Request] Username color in Forumdisplay the same as Showthread - Phenomenon - 2008-08-22

Username Style plugin: http://community.mybboard.net/thread-35653.html