mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-13 20:28:44 +01:00
[ticket/10845] Changed the report system. Now it saves posts with the bbcode
Now the bitfield and uid of the bbcode is saved in the reports table. This will allow parsing the BBCode while loading the post to show PHPBB3-10845
This commit is contained in:
parent
417caa649a
commit
f3e5acf377
@ -1519,16 +1519,18 @@ function get_schema_struct()
|
||||
|
||||
$schema_data['phpbb_reports'] = array(
|
||||
'COLUMNS' => array(
|
||||
'report_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'reason_id' => array('USINT', 0),
|
||||
'post_id' => array('UINT', 0),
|
||||
'pm_id' => array('UINT', 0),
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_notify' => array('BOOL', 0),
|
||||
'report_closed' => array('BOOL', 0),
|
||||
'report_time' => array('TIMESTAMP', 0),
|
||||
'report_text' => array('MTEXT_UNI', ''),
|
||||
'reported_post_text' => array('MTEXT_UNI', ''),
|
||||
'report_id' => array('UINT', NULL, 'auto_increment'),
|
||||
'reason_id' => array('USINT', 0),
|
||||
'post_id' => array('UINT', 0),
|
||||
'pm_id' => array('UINT', 0),
|
||||
'user_id' => array('UINT', 0),
|
||||
'user_notify' => array('BOOL', 0),
|
||||
'report_closed' => array('BOOL', 0),
|
||||
'report_time' => array('TIMESTAMP', 0),
|
||||
'report_text' => array('MTEXT_UNI', ''),
|
||||
'reported_post_text' => array('MTEXT_UNI', ''),
|
||||
'reported_post_uid' => array('VCHAR:8', ''),
|
||||
'reported_post_bitfield' => array('VCHAR:255', ''),
|
||||
),
|
||||
'PRIMARY_KEY' => 'report_id',
|
||||
'KEYS' => array(
|
||||
|
@ -910,7 +910,9 @@ CREATE TABLE phpbb_reports (
|
||||
report_closed INTEGER DEFAULT 0 NOT NULL,
|
||||
report_time INTEGER DEFAULT 0 NOT NULL,
|
||||
report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
|
||||
reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
|
||||
reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
|
||||
reported_post_bitfield VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL,
|
||||
reported_post_uid VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL
|
||||
);;
|
||||
|
||||
ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
|
||||
|
@ -1109,7 +1109,9 @@ CREATE TABLE [phpbb_reports] (
|
||||
[report_closed] [int] DEFAULT (0) NOT NULL ,
|
||||
[report_time] [int] DEFAULT (0) NOT NULL ,
|
||||
[report_text] [text] DEFAULT ('') NOT NULL ,
|
||||
[reported_post_text] [text] DEFAULT ('') NOT NULL
|
||||
[reported_post_text] [text] DEFAULT ('') NOT NULL ,
|
||||
[reported_post_bitfield] [varchar] (255) DEFAULT ('') NOT NULL ,
|
||||
[reported_post_uid] [varchar] (8) DEFAULT ('') NOT NULL
|
||||
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
|
||||
GO
|
||||
|
||||
|
@ -648,6 +648,8 @@ CREATE TABLE phpbb_reports (
|
||||
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
report_text mediumblob NOT NULL,
|
||||
reported_post_text mediumblob NOT NULL,
|
||||
reported_post_bitfield varbinary(255) DEFAULT '' NOT NULL,
|
||||
reported_post_uid varbinary(8) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (report_id),
|
||||
KEY post_id (post_id),
|
||||
KEY pm_id (pm_id)
|
||||
|
@ -648,6 +648,8 @@ CREATE TABLE phpbb_reports (
|
||||
report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
|
||||
report_text mediumtext NOT NULL,
|
||||
reported_post_text mediumtext NOT NULL,
|
||||
reported_post_bitfield varchar(255) DEFAULT '' NOT NULL,
|
||||
reported_post_uid varchar(8) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (report_id),
|
||||
KEY post_id (post_id),
|
||||
KEY pm_id (pm_id)
|
||||
|
@ -1215,6 +1215,8 @@ CREATE TABLE phpbb_reports (
|
||||
report_time number(11) DEFAULT '0' NOT NULL,
|
||||
report_text clob DEFAULT '' ,
|
||||
reported_post_text clob DEFAULT '' ,
|
||||
reported_post_bitfield varchar2(255) DEFAULT '' ,
|
||||
reported_post_uid varchar2(8) DEFAULT '' ,
|
||||
CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id)
|
||||
)
|
||||
/
|
||||
|
@ -854,6 +854,8 @@ CREATE TABLE phpbb_reports (
|
||||
report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0),
|
||||
report_text TEXT DEFAULT '' NOT NULL,
|
||||
reported_post_text TEXT DEFAULT '' NOT NULL,
|
||||
reported_post_bitfield varchar(255) DEFAULT '' NOT NULL,
|
||||
reported_post_uid varchar(8) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY (report_id)
|
||||
);
|
||||
|
||||
|
@ -628,7 +628,9 @@ CREATE TABLE phpbb_reports (
|
||||
report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||
report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
|
||||
report_text mediumtext(16777215) NOT NULL DEFAULT '',
|
||||
reported_post_text mediumtext(16777215) NOT NULL DEFAULT ''
|
||||
reported_post_text mediumtext(16777215) NOT NULL DEFAULT '',
|
||||
reported_post_bitfield varchar(255) NOT NULL DEFAULT '',
|
||||
reported_post_uid varchar(8) NOT NULL DEFAULT ''
|
||||
);
|
||||
|
||||
CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
|
||||
|
@ -71,9 +71,11 @@ if ($post_id)
|
||||
trigger_error('POST_NOT_EXIST');
|
||||
}
|
||||
|
||||
$forum_id = (int) $report_data['forum_id'];
|
||||
$topic_id = (int) $report_data['topic_id'];
|
||||
$reported_post_text = $report_data['post_text'];
|
||||
$forum_id = (int) $report_data['forum_id'];
|
||||
$topic_id = (int) $report_data['topic_id'];
|
||||
$reported_post_text = $report_data['post_text'];
|
||||
$reported_post_bitfield = $report_data['bbcode_bitfield'];
|
||||
$reported_post_uid = $report_data['bbcode_uid'];
|
||||
|
||||
$sql = 'SELECT *
|
||||
FROM ' . FORUMS_TABLE . '
|
||||
@ -132,7 +134,9 @@ else
|
||||
trigger_error($message);
|
||||
}
|
||||
|
||||
$reported_post_text = $report_data['message_text'];
|
||||
$reported_post_text = $report_data['message_text'];
|
||||
$reported_post_bitfield = $report_data['bbcode_bitfield'];
|
||||
$reported_post_uid = $report_data['bbcode_uid'];
|
||||
}
|
||||
|
||||
// Submit report?
|
||||
@ -150,16 +154,19 @@ if ($submit && $reason_id)
|
||||
trigger_error('EMPTY_REPORT');
|
||||
}
|
||||
|
||||
|
||||
$sql_ary = array(
|
||||
'reason_id' => (int) $reason_id,
|
||||
'post_id' => $post_id,
|
||||
'pm_id' => $pm_id,
|
||||
'user_id' => (int) $user->data['user_id'],
|
||||
'user_notify' => (int) $user_notify,
|
||||
'report_closed' => 0,
|
||||
'report_time' => (int) time(),
|
||||
'report_text' => (string) $report_text,
|
||||
'reason_id' => (int) $reason_id,
|
||||
'post_id' => $post_id,
|
||||
'pm_id' => $pm_id,
|
||||
'user_id' => (int) $user->data['user_id'],
|
||||
'user_notify' => (int) $user_notify,
|
||||
'report_closed' => 0,
|
||||
'report_time' => (int) time(),
|
||||
'report_text' => (string) $report_text,
|
||||
'reported_post_text' => $reported_post_text,
|
||||
'reported_post_uid' => $reported_post_uid,
|
||||
'reported_post_bitfield'=> $reported_post_bitfield,
|
||||
);
|
||||
|
||||
$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
|
||||
|
Loading…
x
Reference in New Issue
Block a user