1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 07:35:29 +02:00

[ticket/12838] Allow for extra columns in cache obtain_ranks()

PHPBB3-12838
This commit is contained in:
PayBas 2014-07-10 17:54:08 +02:00
parent c9803b7ba3
commit 08264ec3af

View File

@ -166,20 +166,21 @@ class service
$ranks = array();
while ($row = $this->db->sql_fetchrow($result))
{
if ($row['rank_special'])
foreach ($row as $field => $data)
{
$ranks['special'][$row['rank_id']] = array(
'rank_title' => $row['rank_title'],
'rank_image' => $row['rank_image']
);
}
else
{
$ranks['normal'][] = array(
'rank_title' => $row['rank_title'],
'rank_min' => $row['rank_min'],
'rank_image' => $row['rank_image']
);
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;
}
}
}
$this->db->sql_freeresult($result);