MyBB Community Forums

Full Version: User Color Legend Mod request
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Hello there, use this version it is easier.

open ./index.php


eval("\$whosonline = \"".$templates->get("index_whosonline")."\";"); 

above it add
$query = $db->query("SELECT title, namestyle FROM ".TABLE_PREFIX."usergroups");
$usertitles = "";
while($usertitle = $db->fetch_array($query)) {
$usertitles .= "[".str_replace("{username}", $usertitle['title'] , $usertitle['namestyle'])."] "; 

now in the Admin CP >Templates > Modify / delete > expand > index page templates > index_whosonline


<td class="trow1"><span class="smalltext">$lang->online_note<br />$onlinemembers</span></td>

below it add

 <tr> <td class="tcat">Group Legend</td></tr>
<tr> <td class="trow1">$usertitles</td></tr>

Hench, thats what i was looking for ^_^ cheers dude
Where are those classes called from? That is, the tcat and trowl?

BTW, I prefer the text to be a bit smaller for the legend since I have many altering it this way:

<tr> <td class="tcat">Group Legend</td></tr>
<tr> <td class="trow1"><span class="smalltext">$usertitles</span></td></tr>

Works a bit better. Now I have to run and setup my colors Big Grin
the tcat and trow1 is in the global css theme in your admin CP.
Well Ive maded What zaher told.. But Look How the Legend look:
[Image: 45a78e57e0.jpg]
You also need to add a colspan (seems like you already modified the template adding some columns)

<tr> <td class="tcat" colspan="2">Group Legend</td></tr>
<tr> <td class="trow1" colspan="2">$usertitles</td></tr> 

Thank you verry much ZAHER !!!
Is there any way to alphabatize the usertitle list??
$query = $db->query("SELECT title, namestyle FROM ".TABLE_PREFIX."usergroups");
$query = $db->query("SELECT title, namestyle FROM ".TABLE_PREFIX."usergroups ORDER BY title ASC");
Pages: 1 2 3 4