diff options
Diffstat (limited to 'phpBB/index.php')
| -rw-r--r-- | phpBB/index.php | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/phpBB/index.php b/phpBB/index.php index 84faea917f..92eda26000 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -36,16 +36,27 @@ $l_total_post_s = ($total_posts == 0) ? 'TOTAL_POSTS_ZERO' : 'TOTAL_POSTS_OTHER' $l_total_topic_s = ($total_topics == 0) ? 'TOTAL_TOPICS_ZERO' : 'TOTAL_TOPICS_OTHER'; // Grab group details for legend display -$sql = 'SELECT group_id, group_name, group_colour, group_type - FROM ' . GROUPS_TABLE . ' - WHERE group_legend = 1 - AND group_type <> ' . GROUP_HIDDEN . ' - ORDER BY group_name ASC'; +$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id + FROM ' . GROUPS_TABLE . ' g + LEFT JOIN ' . USER_GROUP_TABLE . ' ug + ON ( + g.group_id = ug.group_id + AND g.group_type = ' . GROUP_HIDDEN . ' + AND ug.user_id = ' . $user->data['user_id'] . ' + AND ug.user_pending = 0 + ) + WHERE g.group_legend = 1 + ORDER BY g.group_name ASC'; $result = $db->sql_query($sql); $legend = ''; while ($row = $db->sql_fetchrow($result)) { + if ($row['group_type'] == GROUP_HIDDEN && empty($row['user_id'])) + { + continue; + } + $colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : ''; if ($row['group_name'] == 'BOTS') |
