1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-04-19 23:32:02 +02:00

[ticket/11103] Don't call generate_board_url many times

Fix a URL and some comments

PHPBB3-11103
This commit is contained in:
Nathan Guse 2013-02-28 17:25:39 -06:00
parent b41b1a36d1
commit ee264e7235
3 changed files with 9 additions and 6 deletions

View File

@ -154,7 +154,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
* Magic method to set data on this notification
*
* @param mixed $name
* @return mixed
* @return null
*/
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 mixed $value Value to set to the variable
* @return mixed
*/
protected function set_data($name, $value)
{

View File

@ -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'))),
'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_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}",

View File

@ -170,6 +170,8 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
*/
public function get_email_template_variables()
{
$board_url = generate_board_url();
if ($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')),
'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_VIEW_TOPIC' => generate_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_STOP_WATCHING_FORUM' => generate_board_url() . "/viewforum.{$this->php_ext}?uid={$this->user_id}&f={$this->item_parent_id}&unwatch=forum",
'U_TOPIC' => "{$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' => "{$board_url}/viewforum.{$this->php_ext}?f={$this->item_parent_id}",
'U_STOP_WATCHING_FORUM' => "{$board_url}/viewforum.{$this->php_ext}?uid={$this->user_id}&f={$this->item_parent_id}&unwatch=forum",
);
}