1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 17:56:52 +02:00

[ticket/11103] Some improvements to the user loader

PHPBB3-11103
This commit is contained in:
Nathan Guse
2012-12-08 18:40:41 -06:00
parent 53decec6e3
commit 37565f37e4
9 changed files with 129 additions and 41 deletions

View File

@@ -112,9 +112,7 @@ class phpbb_notification_type_pm extends phpbb_notification_type_base
*/
public function get_title()
{
$user_data = $this->user_loader->get_user($this->get_data('from_user_id'));
$username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('from_user_id'), 'no_profile');
return $this->user->lang('NOTIFICATION_PM', $username, $this->get_data('message_subject'));
}

View File

@@ -181,9 +181,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
}
else
{
$user_data = $this->user_loader->get_user($responder['poster_id']);
$usernames[] = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$usernames[] = $this->user_loader->get_username($responder['poster_id'], 'no_profile');
}
}
@@ -217,9 +215,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
}
else
{
$user_data = $this->user_loader->get_user($this->get_data('poster_id'));
$username = get_username_string('username', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
}
return array(

View File

@@ -160,9 +160,7 @@ class phpbb_notification_type_report_pm extends phpbb_notification_type_pm
{
$this->user->add_lang('mcp');
$user_data = $this->user_loader->get_user($this->get_data('reporter_id'));
$username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
if ($this->get_data('report_text'))
{
@@ -186,7 +184,7 @@ class phpbb_notification_type_report_pm extends phpbb_notification_type_pm
return $this->user->lang(
$this->language_key,
$username,
$username,
censor_text($this->get_data('message_subject')),
$this->get_data('reason_description')
);

View File

@@ -106,9 +106,7 @@ class phpbb_notification_type_report_pm_closed extends phpbb_notification_type_p
*/
public function get_title()
{
$user_data = $this->user_loader->get_user($this->get_data('closer_id'));
$username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile');
return $this->user->lang(
$this->language_key,

View File

@@ -127,9 +127,7 @@ class phpbb_notification_type_report_post extends phpbb_notification_type_post_i
{
$this->user->add_lang('mcp');
$user_data = $this->user_loader->get_user($this->get_data('reporter_id'));
$username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
if ($this->get_data('report_text'))
{

View File

@@ -106,9 +106,7 @@ class phpbb_notification_type_report_post_closed extends phpbb_notification_type
*/
public function get_title()
{
$user_data = $this->user_loader->get_user($this->get_data('closer_id'));
$username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('closer_id'), 'no_profile');
return $this->user->lang(
$this->language_key,

View File

@@ -142,9 +142,7 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
}
else
{
$user_data = $this->user_loader->get_user($this->get_data('poster_id'));
$username = get_username_string('no_profile', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
}
return $this->user->lang(
@@ -178,9 +176,7 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
}
else
{
$user_data = $this->user_loader->get_user($this->get_data('poster_id'));
$username = get_username_string('username', $user_data['user_id'], $user_data['username'], $user_data['user_colour']);
$username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
}
return array(