mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 06:18:52 +00:00
[ticket/11103] Don't call generate_board_url many times
Fix a URL and some comments PHPBB3-11103
This commit is contained in:
parent
b41b1a36d1
commit
ee264e7235
3 changed files with 9 additions and 6 deletions
|
@ -154,7 +154,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||||
* Magic method to set data on this notification
|
* Magic method to set data on this notification
|
||||||
*
|
*
|
||||||
* @param mixed $name
|
* @param mixed $name
|
||||||
* @return mixed
|
* @return null
|
||||||
*/
|
*/
|
||||||
public function __set($name, $value)
|
public function __set($name, $value)
|
||||||
{
|
{
|
||||||
|
@ -191,6 +191,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||||
*
|
*
|
||||||
* @param string $name Name of the variable to set
|
* @param string $name Name of the variable to set
|
||||||
* @param mixed $value Value to set to the variable
|
* @param mixed $value Value to set to the variable
|
||||||
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
protected function set_data($name, $value)
|
protected function set_data($name, $value)
|
||||||
{
|
{
|
||||||
|
|
|
@ -99,7 +99,7 @@ class phpbb_notification_type_report_post extends phpbb_notification_type_post_i
|
||||||
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
|
'POST_SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('post_subject'))),
|
||||||
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
|
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
|
||||||
|
|
||||||
'U_VIEW_REPORT' => "{$board_url}mcp.{$this->php_ext}?f={$this->get_data('forum_id')}&p={$this->item_id}&i=reports&mode=report_details#reports",
|
'U_VIEW_REPORT' => "{$board_url}/mcp.{$this->php_ext}?f={$this->get_data('forum_id')}&p={$this->item_id}&i=reports&mode=report_details#reports",
|
||||||
'U_VIEW_POST' => "{$board_url}/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
|
'U_VIEW_POST' => "{$board_url}/viewtopic.{$this->php_ext}?p={$this->item_id}#p{$this->item_id}",
|
||||||
'U_NEWEST_POST' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread",
|
'U_NEWEST_POST' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}&view=unread#unread",
|
||||||
'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
|
'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->get_data('forum_id')}&t={$this->item_parent_id}",
|
||||||
|
|
|
@ -170,6 +170,8 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
|
||||||
*/
|
*/
|
||||||
public function get_email_template_variables()
|
public function get_email_template_variables()
|
||||||
{
|
{
|
||||||
|
$board_url = generate_board_url();
|
||||||
|
|
||||||
if ($this->get_data('post_username'))
|
if ($this->get_data('post_username'))
|
||||||
{
|
{
|
||||||
$username = $this->get_data('post_username');
|
$username = $this->get_data('post_username');
|
||||||
|
@ -184,10 +186,10 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
|
||||||
'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name')),
|
'FORUM_NAME' => htmlspecialchars_decode($this->get_data('forum_name')),
|
||||||
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
|
'TOPIC_TITLE' => htmlspecialchars_decode(censor_text($this->get_data('topic_title'))),
|
||||||
|
|
||||||
'U_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
|
'U_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
|
||||||
'U_VIEW_TOPIC' => generate_board_url() . "/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
|
'U_VIEW_TOPIC' => "{$board_url}/viewtopic.{$this->php_ext}?f={$this->item_parent_id}&t={$this->item_id}",
|
||||||
'U_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?f={$this->item_parent_id}",
|
'U_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?f={$this->item_parent_id}",
|
||||||
'U_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?uid={$this->user_id}&f={$this->item_parent_id}&unwatch=forum",
|
'U_STOP_WATCHING_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?uid={$this->user_id}&f={$this->item_parent_id}&unwatch=forum",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue