[Request] Username color in Forumdisplay the same as Showthread
#1
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
Reply
#2
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
Everything is relative
Reply
#3
how do you get it to show on the forum index aswell?
Reply
#4
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-
Reply
#5
thank you!!!! works perfect!
Reply
#6
Thanks!
Reply
#7
Username Style plugin: http://community.mybboard.net/thread-35653.html
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)