Advertisement:

Author Topic: [how to]Group color meanings  (Read 5493 times)

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
[how to]Group color meanings
« on: June 03, 2004, 11:41:17 AM »
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

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: [how to]Group color meanings
« Reply #1 on: June 03, 2004, 11:47:56 AM »
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

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
Re: [how to]Group color meanings
« Reply #2 on: June 03, 2004, 11:51:20 AM »
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

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
Re: [how to]Group color meanings
« Reply #3 on: June 03, 2004, 11:55:39 AM »
Like this.
I am neither a Pessimist nor an Optimist, Just a Realist.

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

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
Re: [how to]Group color meanings
« Reply #4 on: June 03, 2004, 12:05:02 PM »
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

Offline Owdy

  • SMF Fossil
  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 15,627
  • Gender: Male
  • W00t!
    • janoloferiksson on LinkedIn
    • @@jaoler on Twitter
Re: [how to]Group color meanings
« Reply #5 on: June 03, 2004, 12:06:18 PM »
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

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
Re: [how to]Group color meanings
« Reply #6 on: June 03, 2004, 12:33:27 PM »
Please feel free to make corrections and improvements.
file: Sources\BoardIndex.php
Find
Code: [Select]
// 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
Code: [Select]
// 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
Code: [Select]
$context['users_online'] = array();
$context['list_users_online'] = array();
$context['num_guests'] = 0;
$context['num_users_hidden'] = 0;

Add After
Code: [Select]
$context['groups_online'] = array();
$context['list_groups_online'] = array();

Find
Code: [Select]
$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
Code: [Select]
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
Code: [Select]
$context['list_users_online'][] = $this_user['link'];
add after
Code: [Select]
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
Code: [Select]
if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']);

Replace
Code: [Select]
if (!empty($context['users_online']))
echo '
', $txt[140], ':<br />', implode(', ', $context['list_users_online']), '<br> Key: ', implode(', ', $context['list_groups_online']);
« Last Edit: June 03, 2004, 12:49:35 PM by MrCue »
I am neither a Pessimist nor an Optimist, Just a Realist.

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

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
Re: [how to]Group color meanings
« Reply #7 on: June 04, 2004, 05:25:05 AM »
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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [how to]Group color meanings
« Reply #8 on: June 04, 2004, 06:26:52 AM »
I've already changed it so $context['online_groups'] is available, I did that about two weeks ago.....

-[Unknown]

Offline MrCue

  • Full Member
  • ***
  • Posts: 533
  • Gender: Male
  • Chief Architect
    • Installation of SMF
Re: [how to]Group color meanings
« Reply #9 on: June 04, 2004, 06:29:25 AM »
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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: [how to]Group color meanings
« Reply #10 on: June 04, 2004, 06:38:10 AM »
Not in Beta 5 Public, no.

-[Unknown]