[ticket/13713] Make changes pointed by @Nicofuma

PHPBB3-13713
This commit is contained in:
lavigor 2018-07-07 23:53:20 +03:00 committed by Marc Alexander
parent d195244004
commit ffbff7ed79
No known key found for this signature in database
GPG key ID: 50E0D2423696F995
3 changed files with 19 additions and 17 deletions

View file

@ -1,20 +1,20 @@
Subject: Topic reply notification - "{TOPIC_TITLE}" Subject: Topic reply notification - "{{ TOPIC_TITLE }}"
Hello {USERNAME}, Hello {{ USERNAME }},
You are receiving this notification because "{AUTHOR_NAME}" mentioned you in the topic "{TOPIC_TITLE}" at "{SITENAME}". You can use the following link to view the reply made. You are receiving this notification because "{{ AUTHOR_NAME }}" mentioned you in the topic "{{ TOPIC_TITLE }}" at "{{ SITENAME }}". You can use the following link to view the reply made.
If you want to view the post where you have been mentioned, click the following link: If you want to view the post where you have been mentioned, click the following link:
{U_VIEW_POST} {{ U_VIEW_POST }}
If you want to view the topic, click the following link: If you want to view the topic, click the following link:
{U_TOPIC} {{ U_TOPIC }}
If you want to view the forum, click the following link: If you want to view the forum, click the following link:
{U_FORUM} {{ U_FORUM }}
If you no longer wish to receive updates about replies mentioning you, please update your notification settings here: If you no longer wish to receive updates about replies mentioning you, please update your notification settings here:
{U_NOTIFICATION_SETTINGS} {{ U_NOTIFICATION_SETTINGS }}
{EMAIL_SIG} {{ EMAIL_SIG }}

View file

@ -14,6 +14,7 @@
namespace phpbb\mention\controller; namespace phpbb\mention\controller;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse;
class mention class mention
{ {
@ -45,7 +46,7 @@ class mention
{ {
// if (!$this->request->is_ajax()) // if (!$this->request->is_ajax())
// { // {
// redirect(append_sid($this->phpbb_root_path . 'index.' . $this->php_ext)); // new RedirectResponse(append_sid($this->phpbb_root_path . 'index.' . $this->php_ext));
// } // }
$keyword = $this->request->variable('keyword', '', true); $keyword = $this->request->variable('keyword', '', true);

View file

@ -33,6 +33,9 @@ abstract class base_group implements source_interface
/** @var string */ /** @var string */
protected $php_ext; protected $php_ext;
/** @var array Fetched groups' data */
protected $groups = null;
/** /**
* Constructor * Constructor
*/ */
@ -58,9 +61,7 @@ abstract class base_group implements source_interface
*/ */
protected function get_groups() protected function get_groups()
{ {
static $groups = null; if (is_null($this->groups))
if (is_null($groups))
{ {
$query = $this->db->sql_build_query('SELECT', [ $query = $this->db->sql_build_query('SELECT', [
'SELECT' => 'g.*, ug.user_id as ug_user_id', 'SELECT' => 'g.*, ug.user_id as ug_user_id',
@ -76,7 +77,7 @@ abstract class base_group implements source_interface
]); ]);
$result = $this->db->sql_query($query); $result = $this->db->sql_query($query);
$groups = []; $this->groups = [];
while ($row = $this->db->sql_fetchrow($result)) while ($row = $this->db->sql_fetchrow($result))
{ {
if ($row['group_type'] == GROUP_SPECIAL && !in_array($row['group_name'], ['ADMINISTRATORS', 'GLOBAL_MODERATORS']) || $row['group_type'] == GROUP_HIDDEN && !$this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $this->user->data['user_id']) if ($row['group_type'] == GROUP_SPECIAL && !in_array($row['group_name'], ['ADMINISTRATORS', 'GLOBAL_MODERATORS']) || $row['group_type'] == GROUP_HIDDEN && !$this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel') && $row['ug_user_id'] != $this->user->data['user_id'])
@ -86,14 +87,14 @@ abstract class base_group implements source_interface
} }
$group_name = $this->helper->get_name($row['group_name']); $group_name = $this->helper->get_name($row['group_name']);
$groups['names'][$row['group_id']] = $group_name; $this->groups['names'][$row['group_id']] = $group_name;
$groups[$row['group_id']] = $row; $this->groups[$row['group_id']] = $row;
$groups[$row['group_id']]['group_name'] = $group_name; $this->groups[$row['group_id']]['group_name'] = $group_name;
} }
$this->db->sql_freeresult($result); $this->db->sql_freeresult($result);
} }
return $groups; return $this->groups;
} }
/** /**