phpBB

Code Changes

File: phpbb/notification/type/topic.php

  Unmodified   Added   Modified   Removed
Line 50Line 50
	* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/

	* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/

	public static $notification_option = array(

	static public $notification_option = array(

		'lang'	=> 'NOTIFICATION_TYPE_TOPIC',
'group' => 'NOTIFICATION_GROUP_POSTING',
);

		'lang'	=> 'NOTIFICATION_TYPE_TOPIC',
'group' => 'NOTIFICATION_GROUP_POSTING',
);

 

/** @var \phpbb\user_loader */
protected $user_loader;

/** @var \phpbb\config\config */
protected $config;

public function set_config(\phpbb\config\config $config)
{
$this->config = $config;
}

public function set_user_loader(\phpbb\user_loader $user_loader)
{
$this->user_loader = $user_loader;
}


/**
* Is available


/**
* Is available

Line 67Line 83
	* Get the id of the item
*
* @param array $post The data from the post

	* Get the id of the item
*
* @param array $post The data from the post

 
	* @return int The topic id

	*/

	*/

	public static function get_item_id($post)

	static public function get_item_id($post)

	{
return (int) $post['topic_id'];
}

	{
return (int) $post['topic_id'];
}

Line 77Line 94
	* Get the id of the parent
*
* @param array $post The data from the post

	* Get the id of the parent
*
* @param array $post The data from the post

 
	* @return int The forum id

	*/

	*/

	public static function get_item_parent_id($post)

	static public function get_item_parent_id($post)

	{
return (int) $post['forum_id'];
}

	{
return (int) $post['forum_id'];
}

Line 119Line 137
	*/
public function get_avatar()
{

	*/
public function get_avatar()
{

		return $this->user_loader->get_avatar($this->get_data('poster_id'));

		return $this->user_loader->get_avatar($this->get_data('poster_id'), false, true);

	}

/**

	}

/**

Line 138Line 156
			$username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
}


			$username = $this->user_loader->get_username($this->get_data('poster_id'), 'no_profile');
}


		return $this->user->lang(

		return $this->language->lang(

			$this->language_key,
$username
);

			$this->language_key,
$username
);

Line 151Line 169
	*/
public function get_reference()
{

	*/
public function get_reference()
{

		return $this->user->lang(

		return $this->language->lang(

			'NOTIFICATION_REFERENCE',
censor_text($this->get_data('topic_title'))
);

			'NOTIFICATION_REFERENCE',
censor_text($this->get_data('topic_title'))
);

Line 164Line 182
	*/
public function get_forum()
{

	*/
public function get_forum()
{

		return $this->user->lang(

		return $this->language->lang(

			'NOTIFICATION_FORUM',
$this->get_data('forum_name')
);

			'NOTIFICATION_FORUM',
$this->get_data('forum_name')
);

Line 257Line 275
		{
$tracking_data[$row['user_id']] = $row['mark_time'];
}

		{
$tracking_data[$row['user_id']] = $row['mark_time'];
}

 
		$this->db->sql_freeresult($result);


return $tracking_data;
}

/**


return $tracking_data;
}

/**

	* Function for preparing the data for insertion in an SQL query
* (The service handles insertion)
*
* @param array $post Data from submit_post
* @param array $pre_create_data Data from pre_create_insert_array()
*
* @return array Array of data ready to be inserted into the database

	* {@inheritdoc}







	*/
public function create_insert_array($post, $pre_create_data = array())
{

	*/
public function create_insert_array($post, $pre_create_data = array())
{

Line 289Line 302
			$this->notification_read = true;
}


			$this->notification_read = true;
}


		return parent::create_insert_array($post, $pre_create_data);

		parent::create_insert_array($post, $pre_create_data);

	}
}


	}
}