mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
[ticket/11103] data -> notification_data
PHPBB3-11103
This commit is contained in:
parent
fad6bc5a7e
commit
eeb4018195
@ -1312,7 +1312,7 @@ function get_schema_struct()
|
||||
'user_id' => array('UINT', 0),
|
||||
'notification_read' => array('BOOL', 0),
|
||||
'notification_time' => array('TIMESTAMP', 1),
|
||||
'data' => array('TEXT_UNI', ''),
|
||||
'notification_data' => array('TEXT_UNI', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'notification_id',
|
||||
'KEYS' => array(
|
||||
|
@ -110,7 +110,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
{
|
||||
// The row from the database (unless this is a new notification we're going to add)
|
||||
$this->data = $data;
|
||||
$this->data['data'] = (isset($this->data['data'])) ? unserialize($this->data['data']) : array();
|
||||
$this->data['notification_data'] = (isset($this->data['notification_data'])) ? unserialize($this->data['notification_data']) : array();
|
||||
}
|
||||
|
||||
public function __get($name)
|
||||
@ -137,7 +137,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
*/
|
||||
protected function get_data($name)
|
||||
{
|
||||
return ($name === false) ? $this->data['data'] : ((isset($this->data['data'][$name])) ? $this->data['data'][$name] : null);
|
||||
return ($name === false) ? $this->data['notification_data'] : ((isset($this->data['notification_data'][$name])) ? $this->data['notification_data'][$name] : null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -148,7 +148,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
*/
|
||||
protected function set_data($name, $value)
|
||||
{
|
||||
$this->data['data'][$name] = $value;
|
||||
$this->data['notification_data'][$name] = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -171,12 +171,12 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_i
|
||||
'notification_time' => time(),
|
||||
'notification_read' => false,
|
||||
|
||||
'data' => array(),
|
||||
'notification_data' => array(),
|
||||
), $this->data);
|
||||
|
||||
$data = $this->data;
|
||||
|
||||
$data['data'] = serialize($data['data']);
|
||||
$data['notification_data'] = serialize($data['notification_data']);
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
@ -342,7 +342,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
|
||||
// Do not add them as a responder if they were the original poster that created the notification
|
||||
if ($this->get_data('poster_id') == $post['poster_id'])
|
||||
{
|
||||
return array('data' => serialize($this->get_data(false)));
|
||||
return array('notification_data' => serialize($this->get_data(false)));
|
||||
}
|
||||
|
||||
$responders = $this->get_data('responders');
|
||||
@ -354,7 +354,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
|
||||
// Do not add them as a responder multiple times
|
||||
if ($responder['poster_id'] == $post['poster_id'])
|
||||
{
|
||||
return array('data' => serialize($this->get_data(false)));
|
||||
return array('notification_data' => serialize($this->get_data(false)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -365,6 +365,6 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
|
||||
|
||||
$this->set_data('responders', $responders);
|
||||
|
||||
return array('data' => serialize($this->get_data(false)));
|
||||
return array('notification_data' => serialize($this->get_data(false)));
|
||||
}
|
||||
}
|
||||
|
@ -1200,7 +1200,7 @@ function database_update_info()
|
||||
'notification_read' => array('BOOL', 0),
|
||||
'is_enabled' => array('BOOL', 1),
|
||||
'notification_time' => array('TIMESTAMP', 1),
|
||||
'data' => array('TEXT_UNI', ''),
|
||||
'notification_data' => array('TEXT_UNI', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'notification_id',
|
||||
'KEYS' => array(
|
||||
|
@ -636,7 +636,7 @@ CREATE TABLE phpbb_notifications (
|
||||
user_id INTEGER DEFAULT 0 NOT NULL,
|
||||
notification_read INTEGER DEFAULT 0 NOT NULL,
|
||||
notification_time INTEGER DEFAULT 1 NOT NULL,
|
||||
data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
|
||||
notification_data BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
|
||||
);;
|
||||
|
||||
ALTER TABLE phpbb_notifications ADD PRIMARY KEY (notification_id);;
|
||||
|
@ -780,7 +780,7 @@ CREATE TABLE [phpbb_notifications] (
|
||||
[user_id] [int] DEFAULT (0) NOT NULL ,
|
||||
[notification_read] [int] DEFAULT (0) NOT NULL ,
|
||||
[notification_time] [int] DEFAULT (1) NOT NULL ,
|
||||
[data] [varchar] (4000) DEFAULT ('') NOT NULL
|
||||
[notification_data] [varchar] (4000) DEFAULT ('') NOT NULL
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
@ -447,7 +447,7 @@ CREATE TABLE phpbb_notifications (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
data blob NOT NULL,
|
||||
notification_data blob NOT NULL,
|
||||
PRIMARY KEY (notification_id),
|
||||
KEY item_ident (item_type, item_id),
|
||||
KEY user (user_id, notification_read)
|
||||
|
@ -447,7 +447,7 @@ CREATE TABLE phpbb_notifications (
|
||||
user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
notification_read tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
notification_time int(11) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
data text NOT NULL,
|
||||
notification_data text NOT NULL,
|
||||
PRIMARY KEY (notification_id),
|
||||
KEY item_ident (item_type, item_id),
|
||||
KEY user (user_id, notification_read)
|
||||
|
@ -862,7 +862,7 @@ CREATE TABLE phpbb_notifications (
|
||||
user_id number(8) DEFAULT '0' NOT NULL,
|
||||
notification_read number(1) DEFAULT '0' NOT NULL,
|
||||
notification_time number(11) DEFAULT '1' NOT NULL,
|
||||
data clob DEFAULT '' ,
|
||||
notification_data clob DEFAULT '' ,
|
||||
CONSTRAINT pk_phpbb_notifications PRIMARY KEY (notification_id)
|
||||
)
|
||||
/
|
||||
|
@ -619,7 +619,7 @@ CREATE TABLE phpbb_notifications (
|
||||
user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0),
|
||||
notification_read INT2 DEFAULT '0' NOT NULL CHECK (notification_read >= 0),
|
||||
notification_time INT4 DEFAULT '1' NOT NULL CHECK (notification_time >= 0),
|
||||
data varchar(4000) DEFAULT '' NOT NULL,
|
||||
notification_data varchar(4000) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (notification_id)
|
||||
);
|
||||
|
||||
|
@ -434,7 +434,7 @@ CREATE TABLE phpbb_notifications (
|
||||
user_id INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||
notification_read INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||
notification_time INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
data text(65535) NOT NULL DEFAULT ''
|
||||
notification_data text(65535) NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE INDEX phpbb_notifications_item_ident ON phpbb_notifications (item_type, item_id);
|
||||
|
@ -206,8 +206,8 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'item_parent_id' => 1,
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413321,
|
||||
'data' => array(),
|
||||
'notification_time' => 1349413321,
|
||||
'notification_data' => array(),
|
||||
),
|
||||
2 => array(
|
||||
'item_type' => 'test',
|
||||
@ -215,8 +215,8 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'item_parent_id' => 2,
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413322,
|
||||
'data' => array(),
|
||||
'notification_time' => 1349413322,
|
||||
'notification_data' => array(),
|
||||
),
|
||||
3 => array(
|
||||
'item_type' => 'test',
|
||||
@ -224,8 +224,8 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'item_parent_id' => 2,
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413323,
|
||||
'data' => array(),
|
||||
'notification_time' => 1349413323,
|
||||
'notification_data' => array(),
|
||||
),
|
||||
4 => array(
|
||||
'item_type' => 'post',
|
||||
@ -233,8 +233,8 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'item_parent_id' => 2,
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413324,
|
||||
'data' => array(
|
||||
'notification_time' => 1349413324,
|
||||
'notification_data' => array(
|
||||
'poster_id' => 2,
|
||||
'topic_title' => 'test-title',
|
||||
'post_subject' => 'Re: test-title',
|
||||
@ -248,9 +248,9 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'item_id' => 5,
|
||||
'item_parent_id' => 2,
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413325,
|
||||
'data' => array(
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413325,
|
||||
'notification_data' => array(
|
||||
'poster_id' => 2,
|
||||
'topic_title' => 'test-title',
|
||||
'post_subject' => 'Re: test-title',
|
||||
@ -313,7 +313,7 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413321,
|
||||
'data' => array(),
|
||||
'notification_data' => array(),
|
||||
),
|
||||
2 => array(
|
||||
'item_type' => 'test',
|
||||
@ -322,7 +322,7 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413322,
|
||||
'data' => array(),
|
||||
'notification_data' => array(),
|
||||
),
|
||||
3 => array(
|
||||
'item_type' => 'test',
|
||||
@ -331,7 +331,7 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1234,
|
||||
'data' => array(),
|
||||
'notification_data' => array(),
|
||||
),
|
||||
4 => array(
|
||||
'item_type' => 'post',
|
||||
@ -340,7 +340,7 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413324,
|
||||
'data' => array(
|
||||
'notification_data' => array(
|
||||
'poster_id' => 2,
|
||||
'topic_title' => 'test-title',
|
||||
'post_subject' => 'Re: test-title',
|
||||
@ -356,7 +356,7 @@ class phpbb_notification_test extends phpbb_database_test_case
|
||||
'user_id' => 0,
|
||||
'notification_read' => 0,
|
||||
'notification_time' => 1349413325,
|
||||
'data' => array(
|
||||
'notification_data' => array(
|
||||
'poster_id' => 2,
|
||||
'topic_title' => 'test-title2',
|
||||
'post_subject' => 'Re: test-title2',
|
||||
|
Loading…
x
Reference in New Issue
Block a user