mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-24 10:31:57 +02:00
[ticket/11103] time -> notification_time
PHPBB3-11103
This commit is contained in:
@@ -96,7 +96,7 @@ class phpbb_notification_manager
|
||||
$options = array_merge(array(
|
||||
'notification_id' => false,
|
||||
'user_id' => $this->user->data['user_id'],
|
||||
'order_by' => 'time',
|
||||
'order_by' => 'notification_time',
|
||||
'order_dir' => 'DESC',
|
||||
'limit' => 0,
|
||||
'start' => 0,
|
||||
@@ -238,10 +238,9 @@ class phpbb_notification_manager
|
||||
|
||||
$sql = 'UPDATE ' . $this->notifications_table . "
|
||||
SET unread = 0
|
||||
WHERE time <= " . $time .
|
||||
WHERE notification_time <= " . $time .
|
||||
(($item_type !== false) ? ' AND ' . (is_array($item_type) ? $this->db->sql_in_set('item_type', $item_type) : " item_type = '" . $this->db->sql_escape($item_type) . "'") : '') .
|
||||
(($item_id !== false) ? ' AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) : '') .
|
||||
(($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '');
|
||||
$this->db->sql_query($sql);
|
||||
}
|
||||
|
||||
@@ -270,7 +269,7 @@ class phpbb_notification_manager
|
||||
$sql = 'UPDATE ' . $this->notifications_table . "
|
||||
SET unread = 0
|
||||
WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
|
||||
AND time <= " . $time .
|
||||
AND notification_time <= " . $time .
|
||||
(($item_parent_id !== false) ? ' AND ' . (is_array($item_parent_id) ? $this->db->sql_in_set('item_parent_id', $item_parent_id) : 'item_parent_id = ' . (int) $item_parent_id) : '') .
|
||||
(($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '');
|
||||
$this->db->sql_query($sql);
|
||||
@@ -288,7 +287,7 @@ class phpbb_notification_manager
|
||||
|
||||
$sql = 'UPDATE ' . $this->notifications_table . "
|
||||
SET unread = 0
|
||||
WHERE time <= " . $time . '
|
||||
WHERE notification_time <= " . $time . '
|
||||
AND ' . ((is_array($notification_id)) ? $this->db->sql_in_set('notification_id', $notification_id) : 'notification_id = ' . (int) $notification_id);
|
||||
$this->db->sql_query($sql);
|
||||
}
|
||||
@@ -793,7 +792,7 @@ class phpbb_notification_manager
|
||||
public function prune_notifications($timestamp)
|
||||
{
|
||||
$sql = 'DELETE FROM ' . $this->notifications_table . '
|
||||
WHERE time < ' . (int) $timestamp;
|
||||
WHERE notification_time < ' . (int) $timestamp;
|
||||
$this->db->sql_query($sql);
|
||||
}
|
||||
|
||||
|
@@ -32,7 +32,7 @@ class phpbb_notification_type_approve_post extends phpbb_notification_type_post
|
||||
{
|
||||
return 'approve_post';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Language key used to output the text
|
||||
*
|
||||
@@ -123,7 +123,7 @@ class phpbb_notification_type_approve_post extends phpbb_notification_type_post
|
||||
|
||||
$data = parent::create_insert_array($post, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -121,7 +121,7 @@ class phpbb_notification_type_approve_topic extends phpbb_notification_type_topi
|
||||
{
|
||||
$data = parent::create_insert_array($post, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -168,7 +168,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
'item_type' => $this->get_type(),
|
||||
'item_parent_id' => static::get_item_parent_id($type_data),
|
||||
|
||||
'time' => time(),
|
||||
'notification_time' => time(),
|
||||
'unread' => true,
|
||||
|
||||
'data' => array(),
|
||||
@@ -195,7 +195,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
|
||||
// Unset data unique to each row
|
||||
unset(
|
||||
$data['time'], // Also unsetting time, since it always tries to change the time to current (if you actually need to change the time, over-ride this function)
|
||||
$data['notification_time'], // Also unsetting time, since it always tries to change the time to current (if you actually need to change the time, over-ride this function)
|
||||
$data['notification_id'],
|
||||
$data['unread'],
|
||||
$data['user_id']
|
||||
@@ -250,7 +250,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
'FORMATTED_TITLE' => $this->get_title(),
|
||||
|
||||
'URL' => $this->get_url(),
|
||||
'TIME' => $this->user->format_date($this->time),
|
||||
'TIME' => $this->user->format_date($this->notification_time),
|
||||
|
||||
'UNREAD' => $this->unread,
|
||||
|
||||
|
@@ -103,7 +103,7 @@ class phpbb_notification_type_disapprove_post extends phpbb_notification_type_ap
|
||||
|
||||
$data = parent::create_insert_array($post);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -103,7 +103,7 @@ class phpbb_notification_type_disapprove_topic extends phpbb_notification_type_a
|
||||
|
||||
$data = parent::create_insert_array($post, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -320,11 +320,11 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
|
||||
|
||||
$this->set_data('forum_name', $post['forum_name']);
|
||||
|
||||
$this->time = $post['post_time'];
|
||||
$this->notification_time = $post['post_time'];
|
||||
|
||||
// Topics can be "read" before they are public (while awaiting approval).
|
||||
// Make sure that if the user has read the topic, it's marked as read in the notification
|
||||
if (isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->time)
|
||||
if (isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time)
|
||||
{
|
||||
$this->unread = false;
|
||||
}
|
||||
|
@@ -120,7 +120,7 @@ class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
|
||||
{
|
||||
$data = parent::create_insert_array($post, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ class phpbb_notification_type_report_pm_closed extends phpbb_notification_type_p
|
||||
|
||||
$data = parent::create_insert_array($pm, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -148,7 +148,7 @@ class phpbb_notification_type_report_post_closed extends phpbb_notification_type
|
||||
|
||||
$data = parent::create_insert_array($post, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@@ -261,11 +261,11 @@ class phpbb_notification_type_topic extends phpbb_notification_type_base
|
||||
|
||||
$this->set_data('forum_name', $post['forum_name']);
|
||||
|
||||
$this->time = $post['post_time'];
|
||||
$this->notification_time = $post['post_time'];
|
||||
|
||||
// Topics can be "read" before they are public (while awaiting approval).
|
||||
// Make sure that if the user has read the topic, it's marked as read in the notification
|
||||
if (isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->time)
|
||||
if (isset($pre_create_data[$this->user_id]) && $pre_create_data[$this->user_id] >= $this->notification_time)
|
||||
{
|
||||
$this->unread = false;
|
||||
}
|
||||
|
@@ -113,7 +113,7 @@ class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_top
|
||||
{
|
||||
$data = parent::create_insert_array($topic, $pre_create_data);
|
||||
|
||||
$this->time = $data['time'] = time();
|
||||
$this->notification_time = $data['notification_time'] = time();
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user