News:

Wondering if this will always be free?  See why free is better.

Main Menu

Coloured Names

Started by Gamer-4Life, January 03, 2005, 06:39:46 AM

Previous topic - Next topic

Gamer-4Life

How can i get staff or member groups to have colour names everywhere other then the info center?

Thanks

[nofollow]
http://gfxplanet.suddenlaunch3.com [nofollow]


Jerry

that mod shows what color they are, not thier colors everywhere thier name is shown ;)


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Kirby

There is a topic on how to do this in topic display in Feature Requests. You could do it in whos viewing this topic/board too, but that would require some minor modification of the sources.

Nidoking

Do you know how to modify the sources in order to have the latter done?

Kirby

#5
Sure do :)
In Display.php, find:

// Let's get nosey, who is viewing this topic?
if (!empty($settings['display_who_viewing']))
{
// Start out with no one at all viewing it.
$context['view_members'] = array();
$context['view_members_list'] = array();
$context['view_num_hidden'] = 0;

// Search for members who have this topic set in their GET data.
$request = db_query("
SELECT mem.ID_MEMBER, IFNULL(mem.realName, 0) AS realName, mem.showOnline
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
WHERE lo.url LIKE '%s:5:\"topic\";i:$topic;%'", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
if (!empty($row['ID_MEMBER']))
{
// Add them both to the list and to the more detailed list.
if (!empty($row['showOnline']) || allowedTo('moderate_forum'))
$context['view_members_list'][] = empty($row['showOnline']) ? '<i><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></i>' : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';
$context['view_members'][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'hidden' => empty($row['showOnline']),
);

if (empty($row['showOnline']))
$context['view_num_hidden']++;
}

// The number of guests is equal to the rows minus the ones we actually used ;).
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);
}


Replace with:

// Let's get nosey, who is viewing this topic?
if (!empty($settings['display_who_viewing']))
{
// Start out with no one at all viewing it.
$context['view_members'] = array();
$context['view_members_list'] = array();
$context['view_num_hidden'] = 0;

// Search for members who have this topic set in their GET data.
$request = db_query("
SELECT mem.ID_MEMBER, IFNULL(mem.realName, 0) AS realName, mem.showOnline, mg.onlineColor
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE lo.url LIKE '%s:5:\"topic\";i:$topic;%'", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
if (!empty($row['ID_MEMBER']))
{

// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

// Add them both to the list and to the more detailed list.
if (!empty($row['showOnline']) || allowedTo('moderate_forum'))
$context['view_members_list'][] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;

$context['view_members'][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => $link,
'color' => $row['onlineColor'],
'hidden' => empty($row['showOnline']),
);

if (empty($row['showOnline']))
$context['view_num_hidden']++;
}

// The number of guests is equal to the rows minus the ones we actually used ;).
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);
}


Open MessageIndex.php
Find:

// Nosey, nosey - who's viewing this topic?
if (!empty($settings['display_who_viewing']))
{
$context['view_members'] = array();
$context['view_members_list'] = array();
$context['view_num_hidden'] = 0;

$request = db_query("
SELECT mem.ID_MEMBER, IFNULL(mem.realName, 0) AS realName, mem.showOnline
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
WHERE lo.url LIKE '%s:5:\"board\";i:$board;%'", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
if (!empty($row['ID_MEMBER']))
{
if (!empty($row['showOnline']) || allowedTo('moderate_forum'))
$context['view_members_list'][] = empty($row['showOnline']) ? '<i><a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a></i>' : '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';
$context['view_members'][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>',
'hidden' => empty($row['showOnline']),
);

if (empty($row['showOnline']))
$context['view_num_hidden']++;
}
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);
}


Replace with:

// Nosey, nosey - who's viewing this topic?
if (!empty($settings['display_who_viewing']))
{
$context['view_members'] = array();
$context['view_members_list'] = array();
$context['view_num_hidden'] = 0;

$request = db_query("
SELECT mem.ID_MEMBER, IFNULL(mem.realName, 0) AS realName, mem.showOnline, mg.onlineColor
FROM {$db_prefix}log_online AS lo
LEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = lo.ID_MEMBER)
LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))
WHERE lo.url LIKE '%s:5:\"board\";i:$board;%'", __FILE__, __LINE__);
while ($row = mysql_fetch_assoc($request))
if (!empty($row['ID_MEMBER']))
{
// Some basic color coding...
if (!empty($row['onlineColor']))
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '" style="color: ' . $row['onlineColor'] . ';">' . $row['realName'] . '</a>';
else
$link = '<a href="' . $scripturl . '?action=profile;u=' . $row['ID_MEMBER'] . '">' . $row['realName'] . '</a>';

// Add them both to the list and to the more detailed list.
if (!empty($row['showOnline']) || allowedTo('moderate_forum'))
$context['view_members_list'][] = empty($row['showOnline']) ? '<i>' . $link . '</i>' : $link;

$context['view_members'][] = array(
'id' => $row['ID_MEMBER'],
'name' => $row['realName'],
'href' => $scripturl . '?action=profile;u=' . $row['ID_MEMBER'],
'link' => $link,
'color' => $row['onlineColor'],
'hidden' => empty($row['showOnline']),
);

if (empty($row['showOnline']))
$context['view_num_hidden']++;
}
$context['view_num_guests'] = mysql_num_rows($request) - count($context['view_members']);
mysql_free_result($request);
}


This is kind of based off of the one from BoardIndex, so thank the developers :)

diplomat.

ive been trying to do that for ages. thanks bud ;)
avidSOUND.com: Where Aspiring Musicians Can Be HEARD!

Nidoking

Thanks a lot! It worked to perfection!

Jerry

Thanks kirby, are you going to turn this into a mod package? **hasnt looked at the mod board yet. . **


- Jerry
Find me on:
Facebook
Twitter
PlanetSMF

"If all you look for is the negative in things, you will never see the positive."

Kirby

No problem :)
And yeah, I will most likely turn it into a mod package...

Advertisement: