1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/13713] Introduce priorities for groups

PHPBB3-13713
This commit is contained in:
lavigor
2018-07-22 02:06:18 +03:00
committed by Marc Alexander
parent e874ce9898
commit aee1dfd837
4 changed files with 36 additions and 24 deletions

View File

@@ -107,6 +107,15 @@ abstract class base_group implements source_interface
*/
abstract protected function query($keyword, $topic_id);
/**
* {@inheritdoc}
*/
public function get_priority($row)
{
// By default every result from the source increases the priority by a fixed value
return 1;
}
/**
* {@inheritdoc}
*/
@@ -141,6 +150,7 @@ abstract class base_group implements source_interface
'img' => phpbb_get_group_avatar($groups[$group_id]),
],
'rank' => $group_rank['title'],
'priority' => $this->get_priority($groups[$group_id]),
]);
}
}

View File

@@ -60,13 +60,11 @@ abstract class base_user implements source_interface
abstract protected function query($keyword, $topic_id);
/**
* Returns the priority of the currently selected name
*
* @param array $row Array of fetched user data
* @return int Priority (defaults to 1)
* {@inheritdoc}
*/
public function get_priority($row)
{
// By default every result from the source increases the priority by a fixed value
return 1;
}

View File

@@ -24,4 +24,12 @@ interface source_interface
* @param int $topic_id Current topic ID
*/
public function get(array &$names, $keyword, $topic_id);
/**
* Returns the priority of the currently selected name
*
* @param array $row Array of fetched data for the name type (e.g. user row)
* @return int Priority (defaults to 1)
*/
public function get_priority($row);
}