phpBB

Code Changes

File: includes/ucp/ucp_notifications.php

  Unmodified   Added   Modified   Removed
Line 34Line 34
		$form_time = $request->variable('form_time', 0);
$form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time;


		$form_time = $request->variable('form_time', 0);
$form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time;


 
		/* @var $phpbb_notifications \phpbb\notification\manager */

		$phpbb_notifications = $phpbb_container->get('notification_manager');

		$phpbb_notifications = $phpbb_container->get('notification_manager');

 

/* @var $pagination \phpbb\pagination */

		$pagination = $phpbb_container->get('pagination');

switch ($mode)

		$pagination = $phpbb_container->get('pagination');

switch ($mode)

Line 52Line 55

$notification_methods = $phpbb_notifications->get_subscription_methods();



$notification_methods = $phpbb_notifications->get_subscription_methods();


					foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types)

					foreach ($phpbb_notifications->get_subscription_types() as $group => $subscription_types)

					{

					{

						foreach($subscription_types as $type => $data)

						foreach ($subscription_types as $type => $data)

						{

						{

							foreach($notification_methods as $method => $method_data)

							foreach ($notification_methods as $method => $method_data)

							{
if ($request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type])))
{

							{
if ($request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])) && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type])))
{

Line 66Line 69
								{
$phpbb_notifications->delete_subscription($type, 0, $method_data['id']);
}

								{
$phpbb_notifications->delete_subscription($type, 0, $method_data['id']);
}

							}

if ($request->is_set_post(str_replace('.', '_', $type) . '_notification') && !isset($subscriptions[$type]))
{
$phpbb_notifications->add_subscription($type);
}
else if (!$request->is_set_post(str_replace('.', '_', $type) . '_notification') && isset($subscriptions[$type]))
{
$phpbb_notifications->delete_subscription($type);

 
							}
}
}

							}
}
}

Line 97Line 91
				// Mark all items read
if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
{

				// Mark all items read
if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
{

					$phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);

					$phpbb_notifications->mark_notifications(false, false, $user->data['user_id'], $form_time);


meta_refresh(3, $this->u_action);
$message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];


meta_refresh(3, $this->u_action);
$message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];

Line 128Line 122

if (!empty($mark_read))
{


if (!empty($mark_read))
{

						$phpbb_notifications->mark_notifications_read_by_id($mark_read, $form_time);

						$phpbb_notifications->mark_notifications_by_id('notification.method.board', $mark_read, $form_time);

					}
}


					}
}


				$notifications = $phpbb_notifications->load_notifications(array(

				$notifications = $phpbb_notifications->load_notifications('notification.method.board', array(

					'start'			=> $start,
'limit' => $config['topics_per_page'],
'count_total' => true,

					'start'			=> $start,
'limit' => $config['topics_per_page'],
'count_total' => true,

Line 180Line 174
	{
$notification_methods = $phpbb_notifications->get_subscription_methods();


	{
$notification_methods = $phpbb_notifications->get_subscription_methods();


		foreach($phpbb_notifications->get_subscription_types() as $group => $subscription_types)

		foreach ($phpbb_notifications->get_subscription_types() as $group => $subscription_types)

		{
$template->assign_block_vars($block, array(
'GROUP_NAME' => $user->lang($group),
));


		{
$template->assign_block_vars($block, array(
'GROUP_NAME' => $user->lang($group),
));


			foreach($subscription_types as $type => $data)

			foreach ($subscription_types as $type => $data)

			{
$template->assign_block_vars($block, array(
'TYPE' => $type,

'NAME' => $user->lang($data['lang']),
'EXPLAIN' => (isset($user->lang[$data['lang'] . '_EXPLAIN'])) ? $user->lang($data['lang'] . '_EXPLAIN') : '',

			{
$template->assign_block_vars($block, array(
'TYPE' => $type,

'NAME' => $user->lang($data['lang']),
'EXPLAIN' => (isset($user->lang[$data['lang'] . '_EXPLAIN'])) ? $user->lang($data['lang'] . '_EXPLAIN') : '',


'SUBSCRIBED' => (isset($subscriptions[$type])) ? true : false,

 
				));


				));


				foreach($notification_methods as $method => $method_data)

				foreach ($notification_methods as $method => $method_data)

				{
$template->assign_block_vars($block . '.notification_methods', array(
'METHOD' => $method_data['id'],

				{
$template->assign_block_vars($block . '.notification_methods', array(
'METHOD' => $method_data['id'],

Line 227Line 219
	{
$notification_methods = $phpbb_notifications->get_subscription_methods();


	{
$notification_methods = $phpbb_notifications->get_subscription_methods();


		foreach($notification_methods as $method => $method_data)

		foreach ($notification_methods as $method => $method_data)

		{
$template->assign_block_vars($block, array(
'METHOD' => $method_data['id'],

		{
$template->assign_block_vars($block, array(
'METHOD' => $method_data['id'],