[how to]Group color meanings

Started by MrCue, June 03, 2004, 11:41:17 AM

Previous topic - Next topic

MrCue

How would you make this work.

If just members are online, it says

user1, user2, user3 ....
Key: Normal User   <-- Should be the colour of the normal users

If you have an admin online

user1, user2, admin1, user3
Key: Administrator, Normal User <-- each should be its group colour

And so on for each unique group that is online.
I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

Owdy

admin -> Edit Membergroups -> Modify -> Color in online list:
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

MrCue

No, I know how to change the colours of the groups.
What i would like is for the Active groups to have their group name listed in the correct colour under users online, BUT only the groups that are online.
I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

MrCue

I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

MrCue

Not quite.

I want it to display each group that is online, their colour should be taken from the membergroup so i can change it in one place, and should only display the group if someone from that group is online.
I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

Owdy

Yeah, i notised that isnt what you wanted. I dont know how to do this, sorry .
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

MrCue

#6
Please feel free to make corrections and improvements.
file: Sources\BoardIndex.php
Find

// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, 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 = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
ORDER BY lo.logTime DESC", __FILE__, __LINE__);


Replace

// Load the users online right now.
$result = db_query("
SELECT
lo.ID_MEMBER, mem.realName, mem.memberName, mem.ID_GROUP, mem.showOnline,
mg.onlineColor, mg.groupName
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 = mem.ID_GROUP OR (mem.ID_GROUP = 0 AND mg.ID_GROUP = mem.ID_POST_GROUP))
ORDER BY lo.logTime DESC", __FILE__, __LINE__);


find

$context['users_online'] = array();
$context['list_users_online'] = array();
$context['num_guests'] = 0;
$context['num_users_hidden'] = 0;


Add After

$context['groups_online'] = array();
$context['list_groups_online'] = array();


Find

$this_user = &$context['users_online'][];
$this_user = array(
'id' => $tmp['ID_MEMBER'],
'username' => $tmp['memberName'],
'name' => $tmp['realName'],
'group' => $tmp['ID_GROUP'],
'href' => $scripturl . '?action=profile;u=' . $tmp['ID_MEMBER']
);

Add After

if(!isset($context['groups_online'][$tmp['ID_GROUP']])) {
$this_group = &$context['groups_online'][$tmp['ID_GROUP']];
$this_group = array(
'id' => $tmp['ID_GROUP'],
'name' => $tmp['groupName'],
'color' => $tmp['onlineColor']
);
}

Find

$context['list_users_online'][] = $this_user['link'];

add after

if(!isset($context['list_groups_online'][$tmp['ID_GROUP']])) {
$context['list_groups_online'][$tmp['ID_GROUP']] = '<font color="' . $this_group['color'] . '">' . $this_group['name'] . '</font>';
}


File: Template  \BoardIndex.php
find

if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);


Replace

if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']), '<br> Key: ', implode(', ', $context['list_groups_online']);

I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

MrCue

Could this be an official feature? Or at least some way to see what the colours mean.
I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

[Unknown]

I've already changed it so $context['online_groups'] is available, I did that about two weeks ago.....

-[Unknown]

MrCue

So there is an easier way that what i wrote here?
I am neither a Pessimist nor an Optimist, Just a Realist.

Eve-Online Forum | View Latest Eve-Online Kills | Site Map | SMF Installation

[Unknown]

Not in Beta 5 Public, no.

-[Unknown]

Advertisement: