Member Legends[unsolved]

Started by BigBoi, August 07, 2005, 12:12:24 PM

Previous topic - Next topic

BigBoi

is there a way to put sumthing like this

i searched for it did not find much info...

Thantos

Been away for a little while so there might be a better way.  Not sure if an array of all the member groups is created or not.

Open BoardIndex.php (In Sources directory) and add this to the bottom of the file right before ?>
function Legend( $delimit = ' - ')
{
global $db_prefix;
$IgnoreGroups = array( 3 );
$arr = array();
$res = db_query("
SELECT groupName, onlineColor
FROM
{$db_prefix}membergroups
WHERE !FIND_IN_SET('"
. implode(',',$IgnoreGroups) . "', ID_GROUP)
AND onlineColor != ''
ORDER BY ID_GROUP ASC
"
, __FILE__, __LINE__);
while ( $row = mysql_fetch_assoc($res) )
$arr[] = '<span style="color: ' . $row['onlineColor'] . ';">' . $row['groupName'] . '</span>';
mysql_free_result($res);
return implode($delimit, $arr);
}


Then open BoardIndex.template.php
Find:
echo '
       <tr>
               <td class="catbg" colspan="2">'
, $txt[158], '</td>


Replace with
echo '
       <tr>
               <td class="catbg" colspan="2">'
, $txt[158], ' - ', Legend(), '</td>

[Unknown]

You might also just use $context['online_groups']...?

-[Unknown]

Thantos

Well I was assuming they'd want to show all since thats what their picture showed :)

BigBoi

isnt there a way to just insert HTML and type the colors and names of groups... cuz when u use the method above it shows Newbie, Jr.Member etc...  and the font is too big

BigBoi


[Unknown]

Find:

', Legend(), '

Replace:

<span class="smalltext">', Legend(), '</span>

Find:

WHERE !FIND_IN_SET('" . implode(',',$IgnoreGroups) . "', ID_GROUP)
AND onlineColor != ''


Replace:

WHERE ID_GROUP NOT IN (" . implode(', ', $IgnoreGroups) . ")
AND onlineColor != ''
AND minPosts = -1


-[Unknown]

Thantos

Hmm I added in the onlineColor != '' just to avoid getting those other ones but oh well

Advertisement: