1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-19 15:01:33 +02:00

[ticket/13713] Implement avatars

PHPBB3-13713
This commit is contained in:
lavigor
2018-06-01 17:59:31 +03:00
committed by Marc Alexander
parent eec7703d3b
commit a176be4c1d
9 changed files with 82 additions and 13 deletions

View File

@@ -18,12 +18,16 @@ abstract class user implements source_interface
/** @var \phpbb\db\driver\driver_interface */
protected $db;
/** @var \phpbb\user_loader */
protected $user_loader;
/**
* Constructor
*/
public function __construct(\phpbb\db\driver\driver_interface $db)
public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user_loader $user_loader)
{
$this->db = $db;
$this->user_loader = $user_loader;
}
/**
@@ -47,9 +51,13 @@ abstract class user implements source_interface
while ($row = $this->db->sql_fetchrow($res))
{
$names['u' . $row['user_id']] = [
'name' => $row['username'],
'param' => 'user_id',
'id' => $row['user_id'],
'name' => $row['username'],
'param' => 'user_id',
'id' => $row['user_id'],
'avatar' => [
'type' => 'user',
'src' => $this->user_loader->get_avatar($row['user_id'], true),
],
];
}