From 95b5109c622f8acd2d57343b97e3c2b6b157863a Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Wed, 25 Jan 2012 14:30:52 +0000 Subject: [PATCH 1/7] [feature/save-post-on-report] The complete changes for this feature This covers all the changes so that when a report is made, the post itself is copied and displayed in the MCP instead of the current post. Unfortunatly, I made all commits in the wrong way and they were lost. Now I have only the final files. --- phpBB/includes/mcp/mcp_reports.php | 4 ++-- phpBB/install/database_update.php | 3 +++ phpBB/report.php | 10 +++++++--- .../prosilver/template/posting_topic_review.html | 2 +- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 95e84e816b..c848175c79 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -71,7 +71,7 @@ class mcp_reports // closed reports are accessed by report id $report_id = request_var('r', 0); - $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour + $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . ' AND rr.reason_id = r.reason_id @@ -226,7 +226,7 @@ class mcp_reports 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), - 'POST_PREVIEW' => $message, + 'POST_PREVIEW' => $report['reported_text'], 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 843e8c2f23..0a2c3998c4 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1088,6 +1088,9 @@ function database_update_info() PROFILE_FIELDS_TABLE => array( 'field_show_on_pm' => array('BOOL', 0), ), + REPORTS_TABLE => array( + 'reported_post' => array('TEXT', ''), + ), ), 'change_columns' => array( GROUPS_TABLE => array( diff --git a/phpBB/report.php b/phpBB/report.php index e29001d389..ab4de68cea 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -71,8 +71,9 @@ if ($post_id) trigger_error('POST_NOT_EXIST'); } - $forum_id = (int) $report_data['forum_id']; - $topic_id = (int) $report_data['topic_id']; + $forum_id = (int) $report_data['forum_id']; + $topic_id = (int) $report_data['topic_id']; + $reported_text = $report_data['post_text']; $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' @@ -130,6 +131,8 @@ else $message .= '

' . sprintf($user->lang['RETURN_PM'], '', ''); trigger_error($message); } + + $reported_text = $report_data['message_text']; } // Submit report? @@ -155,7 +158,8 @@ if ($submit && $reason_id) 'user_notify' => (int) $user_notify, 'report_closed' => 0, 'report_time' => (int) time(), - 'report_text' => (string) $report_text + 'report_text' => (string) $report_text, + 'reported_text' => $reported_text, ); $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index 67627f9785..a022048c34 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -17,7 +17,7 @@
{topic_review_row.L_IGNORE_POST} -
+
From c241a4a2b484b561b5515c6f8211a21d39fd8d78 Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Fri, 3 Feb 2012 20:54:24 +0000 Subject: [PATCH 2/7] [feature/save-post-on-report] Saves the post reported when a report is creat A problem when creating a report is that the report may be made and then the post changed. After the changes, if the report is seen the message it shows may not be correct to be reported. With these changes, when a report is created the system copies the post that was reported and shows it in the report details in the MCP PHPBB3-10600 --- phpBB/develop/create_schema_files.php | 1 + phpBB/install/schemas/firebird_schema.sql | 3 ++- phpBB/install/schemas/mssql_schema.sql | 3 ++- phpBB/install/schemas/mysql_40_schema.sql | 1 + phpBB/install/schemas/mysql_41_schema.sql | 1 + phpBB/install/schemas/oracle_schema.sql | 1 + phpBB/install/schemas/postgres_schema.sql | 1 + phpBB/install/schemas/sqlite_schema.sql | 3 ++- phpBB/styles/subsilver2/template/posting_topic_review.html | 1 + 9 files changed, 12 insertions(+), 3 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 80d6e05d09..a4738df5bf 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1528,6 +1528,7 @@ function get_schema_struct() 'report_closed' => array('BOOL', 0), 'report_time' => array('TIMESTAMP', 0), 'report_text' => array('MTEXT_UNI', ''), + 'reported_post' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'report_id', 'KEYS' => array( diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index daeba45864..518f1bcd4f 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -909,7 +909,8 @@ CREATE TABLE phpbb_reports ( user_notify INTEGER DEFAULT 0 NOT NULL, 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 + report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL, + reported_post BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 736917fdcb..526ce0f65b 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1108,7 +1108,8 @@ CREATE TABLE [phpbb_reports] ( [user_notify] [int] DEFAULT (0) NOT NULL , [report_closed] [int] DEFAULT (0) NOT NULL , [report_time] [int] DEFAULT (0) NOT NULL , - [report_text] [text] DEFAULT ('') NOT NULL + [report_text] [text] DEFAULT ('') NOT NULL , + [reported_post] [text] DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 97c378621b..22276b0d1f 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -647,6 +647,7 @@ CREATE TABLE phpbb_reports ( report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, + reported_post mediumblob NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 9615905625..7513b4518d 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -647,6 +647,7 @@ CREATE TABLE phpbb_reports ( report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumtext NOT NULL, + reported_post mediumtext NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 5d60d2a19e..3982686c0d 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1214,6 +1214,7 @@ CREATE TABLE phpbb_reports ( report_closed number(1) DEFAULT '0' NOT NULL, report_time number(11) DEFAULT '0' NOT NULL, report_text clob DEFAULT '' , + reported_post clob DEFAULT '' , CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index d7377ac2e6..69685e45aa 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -853,6 +853,7 @@ CREATE TABLE phpbb_reports ( report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0), report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0), report_text TEXT DEFAULT '' NOT NULL, + reported_post TEXT DEFAULT '' NOT NULL, PRIMARY KEY (report_id) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 257937275c..3916493bea 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -627,7 +627,8 @@ CREATE TABLE phpbb_reports ( user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0', report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0', report_time INTEGER UNSIGNED NOT NULL DEFAULT '0', - report_text mediumtext(16777215) NOT NULL DEFAULT '' + report_text mediumtext(16777215) NOT NULL DEFAULT '', + reported_post mediumtext(16777215) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html index 2bfa95f3d4..92f71c2307 100644 --- a/phpBB/styles/subsilver2/template/posting_topic_review.html +++ b/phpBB/styles/subsilver2/template/posting_topic_review.html @@ -51,6 +51,7 @@
+ {REPORTED_IMG}
{topic_review_row.MESSAGE}
From 6f5c0dddfcd2a1b56fe1e8cf783f48ecfc8561e9 Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Tue, 14 Feb 2012 07:58:30 +0000 Subject: [PATCH 3/7] [feature/save-post-on-report] Bug fix table name There was a bug in the previous commit. I changed the name of the colon of the table and forgot to update the database_update.php now it's fixed. PHPBB3-10600 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 0a2c3998c4..7240e899a6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1089,7 +1089,7 @@ function database_update_info() 'field_show_on_pm' => array('BOOL', 0), ), REPORTS_TABLE => array( - 'reported_post' => array('TEXT', ''), + 'reported_text' => array('TEXT', ''), ), ), 'change_columns' => array( From 18373035c3299e80b2c075cfc3d475c89af3cc73 Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Wed, 15 Feb 2012 22:03:32 +0000 Subject: [PATCH 4/7] [feature/save-post-on-report] Changed the name of the column The name of the column was changed from reported_post AND reported_text to reported_post_text. This change was made by request PHPBB3-10600 --- phpBB/develop/create_schema_files.php | 2 +- phpBB/includes/mcp/mcp_reports.php | 4 ++-- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/firebird_schema.sql | 2 +- phpBB/install/schemas/mssql_schema.sql | 2 +- phpBB/install/schemas/mysql_40_schema.sql | 2 +- phpBB/install/schemas/mysql_41_schema.sql | 2 +- phpBB/install/schemas/oracle_schema.sql | 2 +- phpBB/install/schemas/postgres_schema.sql | 2 +- phpBB/install/schemas/sqlite_schema.sql | 2 +- phpBB/report.php | 10 +++++----- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index a4738df5bf..987c9152d4 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1528,7 +1528,7 @@ function get_schema_struct() 'report_closed' => array('BOOL', 0), 'report_time' => array('TIMESTAMP', 0), 'report_text' => array('MTEXT_UNI', ''), - 'reported_post' => array('MTEXT_UNI', ''), + 'reported_post_text' => array('MTEXT_UNI', ''), ), 'PRIMARY_KEY' => 'report_id', 'KEYS' => array( diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index c848175c79..b4756b2600 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -71,7 +71,7 @@ class mcp_reports // closed reports are accessed by report id $report_id = request_var('r', 0); - $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour + $sql = 'SELECT r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . ' AND rr.reason_id = r.reason_id @@ -226,7 +226,7 @@ class mcp_reports 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), - 'POST_PREVIEW' => $report['reported_text'], + 'POST_PREVIEW' => $report['reported_post_text'], 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 7240e899a6..2fdbd16e4a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1089,7 +1089,7 @@ function database_update_info() 'field_show_on_pm' => array('BOOL', 0), ), REPORTS_TABLE => array( - 'reported_text' => array('TEXT', ''), + 'reported_post_text' => array('TEXT', ''), ), ), 'change_columns' => array( diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 518f1bcd4f..b88ed0a64a 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -910,7 +910,7 @@ 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 BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL + reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL );; ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 526ce0f65b..a0399756e9 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1109,7 +1109,7 @@ 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] DEFAULT ('') NOT NULL + [reported_post_text] [text] DEFAULT ('') NOT NULL ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 22276b0d1f..69648c6b14 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -647,7 +647,7 @@ CREATE TABLE phpbb_reports ( report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumblob NOT NULL, - reported_post mediumblob NOT NULL, + reported_post_text mediumblob NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 7513b4518d..9b32ee19c6 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -647,7 +647,7 @@ CREATE TABLE phpbb_reports ( report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, report_time int(11) UNSIGNED DEFAULT '0' NOT NULL, report_text mediumtext NOT NULL, - reported_post mediumtext NOT NULL, + reported_post_text mediumtext NOT NULL, PRIMARY KEY (report_id), KEY post_id (post_id), KEY pm_id (pm_id) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 3982686c0d..032c8633dd 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1214,7 +1214,7 @@ CREATE TABLE phpbb_reports ( report_closed number(1) DEFAULT '0' NOT NULL, report_time number(11) DEFAULT '0' NOT NULL, report_text clob DEFAULT '' , - reported_post clob DEFAULT '' , + reported_post_text clob DEFAULT '' , CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 69685e45aa..f482920776 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -853,7 +853,7 @@ CREATE TABLE phpbb_reports ( report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0), report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0), report_text TEXT DEFAULT '' NOT NULL, - reported_post TEXT DEFAULT '' NOT NULL, + reported_post_text TEXT DEFAULT '' NOT NULL, PRIMARY KEY (report_id) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 3916493bea..56468bcdd9 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -628,7 +628,7 @@ 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 mediumtext(16777215) NOT NULL DEFAULT '' + reported_post_text mediumtext(16777215) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id); diff --git a/phpBB/report.php b/phpBB/report.php index ab4de68cea..29b46a6211 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -71,9 +71,9 @@ if ($post_id) trigger_error('POST_NOT_EXIST'); } - $forum_id = (int) $report_data['forum_id']; - $topic_id = (int) $report_data['topic_id']; - $reported_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']; $sql = 'SELECT * FROM ' . FORUMS_TABLE . ' @@ -132,7 +132,7 @@ else trigger_error($message); } - $reported_text = $report_data['message_text']; + $reported_post_text = $report_data['message_text']; } // Submit report? @@ -159,7 +159,7 @@ if ($submit && $reason_id) 'report_closed' => 0, 'report_time' => (int) time(), 'report_text' => (string) $report_text, - 'reported_text' => $reported_text, + 'reported_post_text' => $reported_post_text, ); $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); From 165a2d1aa879f1fc65448721da5f6d143aff91fe Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Thu, 8 Mar 2012 09:16:36 +0000 Subject: [PATCH 5/7] [feature/save-post-on-report] Change the column type of reported text What ever it said. I changed the type of data in the column reported_post_text to match what was requested by p PHPBB3-10600 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 2fdbd16e4a..8a7ec1004e 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1089,7 +1089,7 @@ function database_update_info() 'field_show_on_pm' => array('BOOL', 0), ), REPORTS_TABLE => array( - 'reported_post_text' => array('TEXT', ''), + 'reported_post_text' => array('MTEXT_UNI', ''), ), ), 'change_columns' => array( From 28c6b95100014bc9237c50c16e6b69a96102e7c6 Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Thu, 8 Mar 2012 22:04:56 +0000 Subject: [PATCH 6/7] [feature/save-post-on-report] bbcode_nl2br missing. New lines were missing in the reported_post_text. By adding the bbcode_nl2br() became as it is supposed to. PHPBB3-10600 --- phpBB/includes/mcp/mcp_reports.php | 7 ++++--- phpBB/styles/prosilver/template/posting_topic_review.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index b4756b2600..69c6a4cfff 100644 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -116,8 +116,9 @@ class mcp_reports $template->assign_vars(array( 'S_TOPIC_REVIEW' => true, 'S_BBCODE_ALLOWED' => $post_info['enable_bbcode'], - 'TOPIC_TITLE' => $post_info['topic_title']) - ); + 'TOPIC_TITLE' => $post_info['topic_title'], + 'REPORTED_POST_ID' => $post_id, + )); } $topic_tracking_info = $extensions = $attachments = array(); @@ -226,7 +227,7 @@ class mcp_reports 'REPORTER_NAME' => get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']), 'U_VIEW_REPORTER_PROFILE' => get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']), - 'POST_PREVIEW' => $report['reported_post_text'], + 'POST_PREVIEW' => bbcode_nl2br($report['reported_post_text']), 'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'], 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html index a022048c34..1c4b67044d 100644 --- a/phpBB/styles/prosilver/template/posting_topic_review.html +++ b/phpBB/styles/prosilver/template/posting_topic_review.html @@ -17,7 +17,7 @@
{topic_review_row.L_IGNORE_POST} -
+
From 3a044b4b3ef6b5a7c27ea357bc3b7d7dd101a262 Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Fri, 9 Mar 2012 15:56:43 +0000 Subject: [PATCH 7/7] [feature/save-post-on-report] Changed mark in subsilver2 to look like viewtopic As cyberalien requested. This was changed to match better the idea behind what was made in prosilver to subsilver2. PHPBB3-10600 --- .../styles/subsilver2/template/posting_topic_review.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html index 92f71c2307..cbd6746a8a 100644 --- a/phpBB/styles/subsilver2/template/posting_topic_review.html +++ b/phpBB/styles/subsilver2/template/posting_topic_review.html @@ -51,7 +51,13 @@
- {REPORTED_IMG} + + + + {REPORTED_IMG} + +
+
{topic_review_row.MESSAGE}