mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-13 14:58:52 +00:00
git-svn-id: file:///svn/phpbb/trunk@7117 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
f5f1363eec
commit
c6ef0181e3
1 changed files with 5 additions and 36 deletions
|
@ -698,7 +698,7 @@ class acp_groups
|
||||||
ORDER BY g.group_type ASC, g.group_name';
|
ORDER BY g.group_type ASC, g.group_name';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$iterate = $lookup = $cached_group_data = array();
|
$lookup = $cached_group_data = array();
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$type = ($row['group_type'] == GROUP_SPECIAL) ? 'special' : 'normal';
|
$type = ($row['group_type'] == GROUP_SPECIAL) ? 'special' : 'normal';
|
||||||
|
@ -706,8 +706,7 @@ class acp_groups
|
||||||
$lookup[$row['group_id']] = $type;
|
$lookup[$row['group_id']] = $type;
|
||||||
// used for easy access to the data within a group
|
// used for easy access to the data within a group
|
||||||
$cached_group_data[$type][$row['group_id']] = $row;
|
$cached_group_data[$type][$row['group_id']] = $row;
|
||||||
// this array holds the properly sorted information
|
$cached_group_data[$type][$row['group_id']]['total_members'] = '0';
|
||||||
$iterate[$type][] = $row['group_id'];
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
|
@ -718,43 +717,14 @@ class acp_groups
|
||||||
GROUP BY ug.group_id';
|
GROUP BY ug.group_id';
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$special = $normal = 0;
|
|
||||||
$group_ary = array();
|
|
||||||
|
|
||||||
while ($row = $db->sql_fetchrow($result))
|
while ($row = $db->sql_fetchrow($result))
|
||||||
{
|
{
|
||||||
$type = $lookup[$row['group_id']];
|
$type = $lookup[$row['group_id']];
|
||||||
$data = &$cached_group_data[$type][$row['group_id']];
|
$cached_group_data[$type][$row['group_id']]['total_members'] = $row['total_members'];
|
||||||
|
|
||||||
$group_ary[$type][$$type]['group_id'] = $row['group_id'];
|
|
||||||
$group_ary[$type][$$type]['group_name'] = $data['group_name'];
|
|
||||||
$group_ary[$type][$$type]['group_type'] = $data['group_type'];
|
|
||||||
$group_ary[$type][$$type]['total_members'] = $row['total_members'];
|
|
||||||
unset($cached_group_data[$type][$row['group_id']], $lookup[$row['group_id']]);
|
|
||||||
|
|
||||||
$$type++;
|
|
||||||
}
|
}
|
||||||
$db->sql_freeresult($result);
|
$db->sql_freeresult($result);
|
||||||
|
|
||||||
// SQL query ignores empty groups, lets fill in the details ;)
|
foreach ($cached_group_data as $type => $row_ary)
|
||||||
foreach ($lookup as $group_id => $type)
|
|
||||||
{
|
|
||||||
$data = &$cached_group_data[$type][$group_id];
|
|
||||||
|
|
||||||
$group_ary[$type][$$type]['group_id'] = (string) $group_id;
|
|
||||||
$group_ary[$type][$$type]['group_name'] = $data['group_name'];
|
|
||||||
$group_ary[$type][$$type]['group_type'] = $data['group_type'];
|
|
||||||
$group_ary[$type][$$type]['total_members'] = '0';
|
|
||||||
|
|
||||||
$$type++;
|
|
||||||
}
|
|
||||||
|
|
||||||
unset($cached_group_data);
|
|
||||||
|
|
||||||
ksort($group_ary);
|
|
||||||
|
|
||||||
$special_toggle = false;
|
|
||||||
foreach ($iterate as $type => $row_ary)
|
|
||||||
{
|
{
|
||||||
if ($type == 'special')
|
if ($type == 'special')
|
||||||
{
|
{
|
||||||
|
@ -763,9 +733,8 @@ class acp_groups
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($row_ary as $key => $group_id)
|
foreach ($row_ary as $group_id => $row)
|
||||||
{
|
{
|
||||||
$row = &$group_ary[$type][$key];
|
|
||||||
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
$group_name = (!empty($user->lang['G_' . $row['group_name']]))? $user->lang['G_' . $row['group_name']] : $row['group_name'];
|
||||||
|
|
||||||
$template->assign_block_vars('groups', array(
|
$template->assign_block_vars('groups', array(
|
||||||
|
|
Loading…
Add table
Reference in a new issue