1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-17 14:18:24 +01:00

[ticket/12838] Simplify normal special rank array creation

PHPBB3-12838
This commit is contained in:
PayBas 2014-08-07 14:24:21 +02:00
parent 8d8e0aae68
commit d8d09e0df2

View File

@ -166,21 +166,14 @@ class service
$ranks = array();
while ($row = $this->db->sql_fetchrow($result))
{
foreach ($row as $field => $data)
if ($row['rank_special'])
{
if ($field == 'rank_special' || ($row['rank_special'] && $field == 'rank_min'))
{
continue;
}
if ($row['rank_special'])
{
$ranks['special'][$row['rank_id']][$field] = $data;
}
else
{
$ranks['normal'][$row['rank_id']][$field] = $data;
}
unset($row['rank_min']);
$ranks['special'][$row['rank_id']] = $row;
}
else
{
$ranks['normal'][$row['rank_id']] = $row;
}
}
$this->db->sql_freeresult($result);