Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

[feature/save-post-on-report] The complete changes for this feature #542

Merged
merged 7 commits into from about 2 years ago

9 participants

brunoais Oleg Pudeyev Josh Woody David King p-scratch Michael C. Vjacheslav Trushkin Callum Macrae Jakub Senko
brunoais

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.

PHPBB3-10600

phpBB/report.php
... ...
@@ -16,6 +16,7 @@
16 16
 include($phpbb_root_path . 'common.' . $phpEx);
17 17
 include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
18 18
 
  19
+
1
David King Collaborator

This line shouldn't be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/report.php
((15 lines not shown))
162 171
 	$db->sql_query($sql);
163 172
 	$report_id = $db->sql_nextid();
  173
+	
1
David King Collaborator

Same here, no newline needed to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/report.php
((7 lines not shown))
159 164
 	);
160 165
 
161  
-	$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
  166
+	// $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
1
David King Collaborator

I do not see why this was changed. The only difference I can see is moving the $db->sql_build_array() to a new line. This is not needed. Also the newline created before and after it aren't really needed either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/includes/mcp/mcp_reports.php
... ...
@@ -114,9 +114,11 @@ function main($id, $mode)
114 114
 				if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false))
115 115
 				{
116 116
 					$template->assign_vars(array(
117  
-						'S_TOPIC_REVIEW'	=> true,
118  
-						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
119  
-						'TOPIC_TITLE'		=> $post_info['topic_title'])
  117
+							'S_TOPIC_REVIEW'	=> true,
  118
+							'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
  119
+							'TOPIC_TITLE'		=> $post_info['topic_title'],
  120
+							'REPORTED_POST_ID'	=> $post_id,
  121
+						)
120 122
 					);
7
Oleg Pudeyev
p added a note January 26, 2012

What happened to indentation here?

brunoais
brunoais added a note January 26, 2012

Nothing. What's wrong?
I made 1 extra change so that it goes according to the 3.1 coding guidelines. If I didn't do it it wouldn't respect the 3.1 coding guidelines and would only respect the 3.0 coding guidelines

Oleg Pudeyev
p added a note January 26, 2012

I see. What is the 3.1 guideline?

brunoais
brunoais added a note January 26, 2012

"Commas after every array element" http://area51.phpbb.com/docs/31x/coding-guidelines.html#codelayout
Also, the examples (at least my interpretation) show that that is the correct way of implementing tabulation.

David King Collaborator

As is done elsewhere, perhaps the two lines with the closing parenthesis (lines 121 and 122) could be combined like: ));

Also, the indentation does appear to have been changed. Can you make sure your tab-width in your editor is 4 spaces?

brunoais
brunoais added a note January 28, 2012

"As is done elsewhere, perhaps the two lines with the closing parenthesis (lines 121 and 122) could be combined like: ));"
ok, I'll do that.
"Also, the indentation does appear to have been changed. Can you make sure your tab-width in your editor is 4 spaces?"
I added 1 indentation for the parenthesis (I interpreted that for 3.1 it is that way). Seems like I'm wrong.

Want me to remove the tab?
I'll join the two parenthesis as requested.

David King Collaborator

Oh, okay, I see now. Yes, please join the parenthesis and remove the extra tab. As far as I know that is still the proper way to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/report.php
((7 lines not shown))
159 163
 	);
160 164
 
161  
-	$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
  165
+	$sql =	'INSERT INTO ' . REPORTS_TABLE . ' ' .
  166
+			$db->sql_build_array('INSERT', $sql_ary) ;
1
Oleg Pudeyev
p added a note January 26, 2012

Please revert this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/styles/prosilver/template/posting_topic_review.html
... ...
@@ -17,7 +17,7 @@ <h3 id="review">
17 17
 		<div class="inner"><span class="corners-top"><span></span></span>
18 18
 			{topic_review_row.L_IGNORE_POST}
19 19
 	<!-- ELSE -->
20  
-	<div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
  20
+	<div class="post <!-- IF topic_review_row.POST_ID == REPORTED_POST_ID -->reported<!-- ELSEIF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
9
Oleg Pudeyev
p added a note January 26, 2012

What does this do and does this change need to be applied to subsilver?

brunoais
brunoais added a note January 26, 2012

I marks the post in the MCP while reviewing the report.
Because the report in the preview may not match the current report, using that style, the post that was reported becomes marked while it is being reviewed in the report info page.
The mark is exactly like a post appears between others in viewtopic.php

David King Collaborator

This needs to be done in subsilver2 as well If this is going into 3.1. If we're holding this back to 3.2, subsilver2 is not going to be included so the change wont be needed.

brunoais
brunoais added a note January 27, 2012

I don't want this not added to the 3.1 so I made those changes to subsilver2, committed, pushed and squashed.
Anything else needed?

Oleg Pudeyev
p added a note March 08, 2012

I cannot find the effects of this change in UI, where can I see them?

brunoais
brunoais added a note March 08, 2012

You have to go to the only place where REPORTED_POST_ID is set.
That place is the /mcp.php?i=reports&mode=report_details
There are no alternatives.

Vjacheslav Trushkin
cyberalien added a note March 08, 2012

I don't like this change, it removes .bg1 and .bg2 and requires style to implement .reported background. It would make more sense to add .reported in addition to background color, like this:

<div class="post <!-- IF topic_review_row.POST_ID == REPORTED_POST_ID -->reported <!-- ENDIF --><!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
Oleg Pudeyev
p added a note March 08, 2012

http://postimage.org/image/h5t9o6tzr/

Is the added ui there?

brunoais
brunoais added a note March 08, 2012

@cyberalien
Hum... Ok, makes sense, that's also how it is implemented in viewtopic_body.html.
Expect those changes to be applied into the next commit.
@p
No. You need to scroll further down. In the bottom div, you have to find tester_134's post.
Note that (IIRC) if his topic was removed it will not appear in the review (I didn't change that part)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Oleg Pudeyev
p commented January 26, 2012

Please squash all commits into one.

The resulting commit will need PHPBB3-10600 at the end of it, see http://wiki.phpbb.com/Git#Commit_Messages.

Josh Woody

New DB column needs to be added to develop/create_db_schema.php, and the file needs to be run to generate the actual schema files (install/db/schemas/)

brunoais

All you requested is done (at least it looks like done to me).
Anything else?

brunoais

kay, added the system to subsilver2.
Anything else needed?

David King
Collaborator

Something went wrong with two of the schema files. Instead of showing only your change, it thinks the whole file needs to be shown as changed.

can you make sure your editor is setup correctly?

brunoais

I had to make a change to the file create_schema_files.php.
I had to replace:
fwrite($fp, $line);
with:
fwrite($fp, str_replace("\r",'',$line) );

before:
foreach ($schema_data as $table_name => $table_data)

Problems was:
New lines made using heredoc were being written as:
\r\r\n instead of \r\n.

phpBB/styles/subsilver2/template/posting_topic_review.html
... ...
@@ -18,7 +18,7 @@
18 18
 		</tr>
19 19
 		<!-- BEGIN topic_review_row -->
20 20
 
21  
-			<!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
  21
+			<!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --><tr style="background-color: #F7ECEF;"><!-- ELSEIF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
7
David King Collaborator

Is there no class for reported posts in subsilver2? iirc we're trying to stay away from inline css where possible.

If it has, it's very well hidden.
How should I approach, then?
Change the .css to include the reported class?
Use a "reported" class and pray the others to create a convenient mark?

David King Collaborator

Personally, I am not very familiar with subsilver2 so I'm not sure how it's handled elsewhere.

Basically, as long as this is the same as how posts are shown as reported in other parts of the style, then it's fine.

Eh.... no. Subsilver2 does not have any styling what-so-ever to mark reported posts.
It uses a simples text stating that the post is marked followed by an exclamation point.
Because this change to subsilver2 was requested so that my changes can be applied to 3.1, I added the style that way to create the mark.
If you want to I may remove this and the mark will only appear in the prosilver style. Alternatively I may try using the other method (show some text an the exclamation point or just the exclamation point)

David King Collaborator

I suppose that because subSilver2 does not traditionally mark posts as reported like this, this isn't needed for subsilver2. My request for the prosilver changes to be applied to subsilver2 was assuming that subsilver2 also marked reported posts in the same way (I don't use subsilver2 and I'm not familiar with its code, so I wasn't sure). I don't think the answer would be to add inline css to mark the post reported like this if it isn't marked similarly in other parts of subsilver to (i.e. viewtopic_body.html)

so... should I not do any changes to subsilver2 or is there anything in particular I should do to make the "mark"?

David King Collaborator

[10:27] brunoais> so you want me to remove that from subsilver2, right?
[10:29] brunoais> you want me not to make any changes to subsilver2 for this code change, right?
[10:32] imkingdavid> i guess not
[10:32] imkingdavid> if the post is being marked as reported the same as it is elsewhere in subsilver2
[10:32] imkingdavid> right
[10:32] imkingdavid> ?
[10:32] brunoais> I didn't understand that correctly...
[10:34] imkingdavid> basically what you're doing in prosilver is marking the post as reported in the topic review right?
[10:34] brunoais> right. And I used the class that is used in the viewtopic to mark as reported
[10:38] imkingdavid> but since subsilver2 doesn't mark posts reported like that, it doesn't need the same type of change
[10:38] imkingdavid> if it does mark posts reported in another way but doesn't in the topic review, it might be good to change it there for continuity
[10:39] brunoais> ok
[10:39] brunoais> so I use the "!" symbol as used in subsilver?
[10:40] brunoais> *so I use the "!" symbol as used in subsilver2?
[10:40] imkingdavid> if that's how its done elsewhere in subsilver2 then i guess so
[10:41] brunoais> that's the way it's done in viewtopic.php
[10:42] imkingdavid> alright then i say go for it
[10:42] brunoais> k
[10:42] brunoais> I'll see if I have that done by saturday
[10:45] imkingdavid> k

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Josh Woody

Having merged this and run database_update.php, I see the following error

Unknown column 'reported_text' in 'field list' [1054]

SQL

INSERT INTO phpbb_reports (reason_id, post_id, pm_id, user_id, user_notify, report_closed, report_time, report_text, reported_text) VALUES (1, 999503, 0, 2, 0, 0, 1329183139, '', 'This is a test with just a plain long topic title and no specialchars.')

This is my phpbb_reports table schema after running database_update.php:
mysql> SHOW COLUMNS FROM phpbb_reports
-> ;
+---------------+-----------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------------+-----------------------+------+-----+---------+----------------+
| report_id | mediumint(8) unsigned | NO | PRI | NULL | auto_increment |
| reason_id | smallint(4) unsigned | NO | | 0 | |
| post_id | mediumint(8) unsigned | NO | MUL | 0 | |
| pm_id | mediumint(8) unsigned | NO | MUL | 0 | |
| user_id | mediumint(8) unsigned | NO | | 0 | |
| user_notify | tinyint(1) unsigned | NO | | 0 | |
| report_closed | tinyint(1) unsigned | NO | | 0 | |
| report_time | int(11) unsigned | NO | | 0 | |
| report_text | mediumtext | NO | | NULL | |
| reported_post | text | NO | | NULL | |
+---------------+-----------------------+------+-----+---------+----------------+
10 rows in set (0.00 sec)

Note the mismatch in column names (reported_post vs. reported_text)

Oleg Pudeyev
p commented February 14, 2012

There are still mentions of reported_post in the diff.

I like reported_text more than reported_post, but what about reported_post_text?

brunoais

"I like reported_text more than reported_post, but what about reported_post_text?"
I'm open for that. Actually, I'm one of the worse people to give names to things.
If you want that for the colon name you got it! Just ask and the naming will be as you ask.

David King
Collaborator

I agree with Oleg. reported_post_text would be the most accurate, imo.

brunoais

Should I use the name 'reported_post_text', then?

Oleg Pudeyev
p commented February 15, 2012

That would be my vote.

David King
Collaborator

@brunoais I think so too.

brunoais

New commit with the code changes.
See if you like it better this way.

brunoais

All should be ok now. please check

phpBB/install/database_update.php
... ...
@@ -1088,6 +1088,9 @@ function database_update_info()
1088 1088
 				PROFILE_FIELDS_TABLE	=> array(
1089 1089
 					'field_show_on_pm'		=> array('BOOL', 0),
1090 1090
 				),
  1091
+				REPORTS_TABLE		=> array(
  1092
+					'reported_post_text'	=> array('TEXT', ''),
2
Oleg Pudeyev
p added a note March 07, 2012

I think this should be MTEXT_UNI.

brunoais
brunoais added a note March 07, 2012

Changed, committed and pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Oleg Pudeyev
p commented March 07, 2012

Everything else looks good.

Oleg Pudeyev
p commented March 08, 2012

Also, the posting review template appears to be used in the normal posting views, therefore I would like to see some sort of a MCP/auth check there to guard against accidentally exposing reported status to users and/or an explanation of why this can never happen.

phpBB/styles/subsilver2/template/posting_topic_review.html
... ...
@@ -51,6 +51,7 @@
51 51
 							<table width="100%" cellspacing="0" cellpadding="2">
52 52
 							<tr>
53 53
 								<td>
  54
+									<!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --><span class="postreported">{REPORTED_IMG}</span><!-- ENDIF -->
3
Vjacheslav Trushkin
cyberalien added a note March 08, 2012

In other template files this is wrapped in its own container, usually a table cell. Please do that here too, wrap it in div or extra table. See viewtopic_body.html for example.

brunoais
brunoais added a note March 08, 2012

Sorry big teeth smile... I tried to do that but the layout is being "destroyed" when I try to do that. Any advice?
Should I do a table just for this message like it appears in the viewtopic_body.html ?

Vjacheslav Trushkin
cyberalien added a note March 09, 2012

Yes, table would make it look exactly the same as in viewtopic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/includes/functions_module.php
... ...
@@ -747,8 +747,26 @@ function assign_tpl_vars($module_url)
747 747
 				}
748 748
 			}
749 749
 
750  
-			$u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&amp;icat=' . $current_id : '') . '&amp;mode=' . $item_ary['mode']);
751  
-
  750
+			$u_title = $module_url . $delim . 'i=';
  751
+			// if the item has a name use it, else use its id
  752
+			if (empty($item_ary['name']))
  753
+			{
  754
+				$u_title .=  $item_ary['id'];
  755
+			}
  756
+			else
  757
+			{
  758
+				$u_title .=  $item_ary['name'];
  759
+			}
3

Why not use ternary here?

Jakub Senko
Senky added a note March 28, 2012

This is much more clear and easier to maintain... IMHO I would keep it as it is

brunoais
brunoais added a note March 28, 2012

This is wrong code. This was deleted later. Due to lots of problems with dealing with git due to my "noobsness", this which belongs to another ticket, was mixed up in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/styles/subsilver2/template/overall_footer.html
... ...
@@ -8,7 +8,7 @@
1

What? Why have you done this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/includes/functions_module.php
... ...
@@ -747,7 +747,19 @@ function assign_tpl_vars($module_url)
747 747
 				}
748 748
 			}
749 749
 
750  
-			$u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&amp;icat=' . $current_id : '') . '&amp;mode=' . $item_ary['mode']);
  750
+			$u_title = $module_url . $delim . 'i=';
2
David King Collaborator

Isn't this from https://github.com/phpbb/phpbb3/pull/545/files ? Why is it here?

From what I have seen so far, it looks like brunoais is experiementing on his branch without creating a new branch - there was something else which shouldn't have been on this pull request, too.

@brunoais: In the future, either experiment on develop (it's very difficult to accidentally commit stuff), or create a new branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
phpBB/report.php
((7 lines not shown))
159 163
 	);
160 164
 
161  
-	$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
  165
+	$sql =	'INSERT INTO ' . REPORTS_TABLE . ' ' .$db->sql_build_array('INSERT', $sql_ary);
2

Still needs changing back properly.

David King Collaborator

Yep, needs no added space between = and ', and add a space between . and $

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Oleg Pudeyev
p commented March 10, 2012

Status here? Is the UI fixed?

brunoais

@p Everything is ready for merging, sir!

phpBB/includes/mcp/mcp_reports.php
... ...
@@ -114,10 +114,11 @@ function main($id, $mode)
114 114
 				if (topic_review($post_info['topic_id'], $post_info['forum_id'], 'topic_review', 0, false))
115 115
 				{
116 116
 					$template->assign_vars(array(
117  
-						'S_TOPIC_REVIEW'	=> true,
118  
-						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
119  
-						'TOPIC_TITLE'		=> $post_info['topic_title'])
120  
-					);
  117
+							'S_TOPIC_REVIEW'	=> true,
  118
+							'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
  119
+							'TOPIC_TITLE'		=> $post_info['topic_title'],
  120
+							'REPORTED_POST_ID'	=> $post_id,
8

Indents still need fixing here.

brunoais
brunoais added a note March 10, 2012

Like that?

Yeah, that's good.

You should probably fix your commit messages though - they're very vague (or at least, go into more detail in the future)

brunoais
brunoais added a note March 11, 2012

hum.... That's quite hard, ya know. What was made is quite obvious in the diff itself. I don't know how redundant it must be, actually.
I'm quite new in this stuff, so I'll be learning as time passes

I should be able to skim through git log to find a commit, I shouldn't have to view the diffs. Not all of us have the privilege of 24/7 Internet access, and so can't always access GitHub.

David King Collaborator

Commit messages should just be brief description of what was done. I often do similar to yours, like "fixing things", but I agree that it is very helpful to have some sort of description of what was actually fixed. Otherwise, it is difficult to identify which commit actually does what at a glance without actually viewing the changes of each commit.

brunoais
brunoais added a note March 11, 2012

@callumacrae Hum... got the main idea, yeah...
@imkingdavid
When the changes come from my initiative, I know well what to write (check my private forum feature commits, pls). When it's this stuff.... I don't really know how to verbose them. It's just a bunch of minor changes that I don't know how to describe.

brunoais
brunoais added a note March 14, 2012

How do you want me to deal with this?

  • Change the commit messages to show what was fixed?
  • Merge commits?
  • both?

Anyway, pls specify what should be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Josh Woody

In this case, it would be appropriate to squash all the "minor fixes" commits when this is declared ready to merge. (or the developer who does the merge could do the squash - I'm not entirely certain how that is supposed to flow)

brunoais

I'll have no problems squashing the minor fix commits.
I'll just need to know what do you need me to squash.

added some commits January 25, 2012
brunoais [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.
95b5109
brunoais [feature/save-post-on-report] Saves the post reported when a report i…
…s 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
c241a4a
brunoais [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
6f5c0dd
brunoais [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
1837303
brunoais [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
165a2d1
brunoais [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
28c6b95
brunoais [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
3a044b4
p-scratch

I am going to merge this.

brunoais

@p-scratch Who are you?

Michael C.

@brunoais Thats @p or oleg or nn- or an-. They are all the same person. :)

Oleg Pudeyev p merged commit 3a044b4 into from March 28, 2012
Oleg Pudeyev p closed this March 28, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 7 unique commits by 2 authors.

Mar 19, 2012
brunoais [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.
95b5109
brunoais [feature/save-post-on-report] Saves the post reported when a report i…
…s 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
c241a4a
brunoais [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
6f5c0dd
brunoais [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
1837303
brunoais [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
165a2d1
brunoais [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
28c6b95
brunoais [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
3a044b4
This page is out of date. Refresh to see the latest.
1  phpBB/develop/create_schema_files.php
@@ -1528,6 +1528,7 @@ function get_schema_struct()
1528 1528
 			'report_closed'			=> array('BOOL', 0),
1529 1529
 			'report_time'			=> array('TIMESTAMP', 0),
1530 1530
 			'report_text'			=> array('MTEXT_UNI', ''),
  1531
+			'reported_post_text'	=> array('MTEXT_UNI', ''),
1531 1532
 		),
1532 1533
 		'PRIMARY_KEY'	=> 'report_id',
1533 1534
 		'KEYS'			=> array(
9  phpBB/includes/mcp/mcp_reports.php
@@ -71,7 +71,7 @@ function main($id, $mode)
71 71
 				// closed reports are accessed by report id
72 72
 				$report_id = request_var('r', 0);
73 73
 
74  
-				$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
  74
+				$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
75 75
 					FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
76 76
 					WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id") . '
77 77
 						AND rr.reason_id = r.reason_id
@@ -116,8 +116,9 @@ function main($id, $mode)
116 116
 					$template->assign_vars(array(
117 117
 						'S_TOPIC_REVIEW'	=> true,
118 118
 						'S_BBCODE_ALLOWED'	=> $post_info['enable_bbcode'],
119  
-						'TOPIC_TITLE'		=> $post_info['topic_title'])
120  
-					);
  119
+						'TOPIC_TITLE'		=> $post_info['topic_title'],
  120
+						'REPORTED_POST_ID'	=> $post_id,
  121
+					));
121 122
 				}
122 123
 
123 124
 				$topic_tracking_info = $extensions = $attachments = array();
@@ -226,7 +227,7 @@ function main($id, $mode)
226 227
 					'REPORTER_NAME'				=> get_username_string('username', $report['user_id'], $report['username'], $report['user_colour']),
227 228
 					'U_VIEW_REPORTER_PROFILE'	=> get_username_string('profile', $report['user_id'], $report['username'], $report['user_colour']),
228 229
 
229  
-					'POST_PREVIEW'			=> $message,
  230
+					'POST_PREVIEW'			=> bbcode_nl2br($report['reported_post_text']),
230 231
 					'POST_SUBJECT'			=> ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
231 232
 					'POST_DATE'				=> $user->format_date($post_info['post_time']),
232 233
 					'POST_IP'				=> $post_info['poster_ip'],
3  phpBB/install/database_update.php
@@ -1088,6 +1088,9 @@ function database_update_info()
1088 1088
 				PROFILE_FIELDS_TABLE	=> array(
1089 1089
 					'field_show_on_pm'		=> array('BOOL', 0),
1090 1090
 				),
  1091
+				REPORTS_TABLE		=> array(
  1092
+					'reported_post_text'	=> array('MTEXT_UNI', ''),
  1093
+				),
1091 1094
 			),
1092 1095
 			'change_columns'	=> array(
1093 1096
 				GROUPS_TABLE		=> array(
3  phpBB/install/schemas/firebird_schema.sql
@@ -909,7 +909,8 @@ CREATE TABLE phpbb_reports (
909 909
 	user_notify INTEGER DEFAULT 0 NOT NULL,
910 910
 	report_closed INTEGER DEFAULT 0 NOT NULL,
911 911
 	report_time INTEGER DEFAULT 0 NOT NULL,
912  
-	report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
  912
+	report_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL,
  913
+	reported_post_text BLOB SUB_TYPE TEXT CHARACTER SET UTF8 DEFAULT '' NOT NULL
913 914
 );;
914 915
 
915 916
 ALTER TABLE phpbb_reports ADD PRIMARY KEY (report_id);;
3  phpBB/install/schemas/mssql_schema.sql
@@ -1108,7 +1108,8 @@ CREATE TABLE [phpbb_reports] (
1108 1108
 	[user_notify] [int] DEFAULT (0) NOT NULL ,
1109 1109
 	[report_closed] [int] DEFAULT (0) NOT NULL ,
1110 1110
 	[report_time] [int] DEFAULT (0) NOT NULL ,
1111  
-	[report_text] [text] DEFAULT ('') NOT NULL 
  1111
+	[report_text] [text] DEFAULT ('') NOT NULL ,
  1112
+	[reported_post_text] [text] DEFAULT ('') NOT NULL
1112 1113
 ) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
1113 1114
 GO
1114 1115
 
1  phpBB/install/schemas/mysql_40_schema.sql
@@ -647,6 +647,7 @@ CREATE TABLE phpbb_reports (
647 647
 	report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
648 648
 	report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
649 649
 	report_text mediumblob NOT NULL,
  650
+	reported_post_text mediumblob NOT NULL,
650 651
 	PRIMARY KEY (report_id),
651 652
 	KEY post_id (post_id),
652 653
 	KEY pm_id (pm_id)
1  phpBB/install/schemas/mysql_41_schema.sql
@@ -647,6 +647,7 @@ CREATE TABLE phpbb_reports (
647 647
 	report_closed tinyint(1) UNSIGNED DEFAULT '0' NOT NULL,
648 648
 	report_time int(11) UNSIGNED DEFAULT '0' NOT NULL,
649 649
 	report_text mediumtext NOT NULL,
  650
+	reported_post_text mediumtext NOT NULL,
650 651
 	PRIMARY KEY (report_id),
651 652
 	KEY post_id (post_id),
652 653
 	KEY pm_id (pm_id)
1  phpBB/install/schemas/oracle_schema.sql
@@ -1214,6 +1214,7 @@ CREATE TABLE phpbb_reports (
1214 1214
 	report_closed number(1) DEFAULT '0' NOT NULL,
1215 1215
 	report_time number(11) DEFAULT '0' NOT NULL,
1216 1216
 	report_text clob DEFAULT '' ,
  1217
+	reported_post_text clob DEFAULT '' ,
1217 1218
 	CONSTRAINT pk_phpbb_reports PRIMARY KEY (report_id)
1218 1219
 )
1219 1220
 /
1  phpBB/install/schemas/postgres_schema.sql
@@ -853,6 +853,7 @@ CREATE TABLE phpbb_reports (
853 853
 	report_closed INT2 DEFAULT '0' NOT NULL CHECK (report_closed >= 0),
854 854
 	report_time INT4 DEFAULT '0' NOT NULL CHECK (report_time >= 0),
855 855
 	report_text TEXT DEFAULT '' NOT NULL,
  856
+	reported_post_text TEXT DEFAULT '' NOT NULL,
856 857
 	PRIMARY KEY (report_id)
857 858
 );
858 859
 
3  phpBB/install/schemas/sqlite_schema.sql
@@ -627,7 +627,8 @@ CREATE TABLE phpbb_reports (
627 627
 	user_notify INTEGER UNSIGNED NOT NULL DEFAULT '0',
628 628
 	report_closed INTEGER UNSIGNED NOT NULL DEFAULT '0',
629 629
 	report_time INTEGER UNSIGNED NOT NULL DEFAULT '0',
630  
-	report_text mediumtext(16777215) NOT NULL DEFAULT ''
  630
+	report_text mediumtext(16777215) NOT NULL DEFAULT '',
  631
+	reported_post_text mediumtext(16777215) NOT NULL DEFAULT ''
631 632
 );
632 633
 
633 634
 CREATE INDEX phpbb_reports_post_id ON phpbb_reports (post_id);
10  phpBB/report.php
@@ -71,8 +71,9 @@
71 71
 		trigger_error('POST_NOT_EXIST');
72 72
 	}
73 73
 
74  
-	$forum_id = (int) $report_data['forum_id'];
75  
-	$topic_id = (int) $report_data['topic_id'];
  74
+	$forum_id 			= (int) $report_data['forum_id'];
  75
+	$topic_id 			= (int) $report_data['topic_id'];
  76
+	$reported_post_text	= $report_data['post_text'];
76 77
 
77 78
 	$sql = 'SELECT *
78 79
 		FROM ' . FORUMS_TABLE . '
@@ -130,6 +131,8 @@
130 131
 		$message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
131 132
 		trigger_error($message);
132 133
 	}
  134
+	
  135
+	$reported_post_text = $report_data['message_text'];
133 136
 }
134 137
 
135 138
 // Submit report?
@@ -155,7 +158,8 @@
155 158
 		'user_notify'	=> (int) $user_notify,
156 159
 		'report_closed'	=> 0,
157 160
 		'report_time'	=> (int) time(),
158  
-		'report_text'	=> (string) $report_text
  161
+		'report_text'	=> (string) $report_text,
  162
+		'reported_post_text'	=> $reported_post_text,
159 163
 	);
160 164
 
161 165
 	$sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
2  phpBB/styles/prosilver/template/posting_topic_review.html
@@ -17,7 +17,7 @@ <h3 id="review">
17 17
 		<div class="inner"><span class="corners-top"><span></span></span>
18 18
 			{topic_review_row.L_IGNORE_POST}
19 19
 	<!-- ELSE -->
20  
-	<div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
  20
+	<div class="post <!-- IF topic_review_row.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF --><!-- IF topic_review_row.POST_ID == REPORTED_POST_ID --> reported<!-- ENDIF -->">
21 21
 		<div class="inner"><span class="corners-top"><span></span></span>
22 22
 	<!-- ENDIF -->
23 23
 
7  phpBB/styles/subsilver2/template/posting_topic_review.html
@@ -51,6 +51,13 @@
51 51
 							<table width="100%" cellspacing="0" cellpadding="2">
52 52
 							<tr>
53 53
 								<td>
  54
+									<!-- IF topic_review_row.POST_ID == REPORTED_POST_ID -->
  55
+									<table width="100%" cellspacing="0">
  56
+										<tr>
  57
+											<span class="postreported">{REPORTED_IMG}</span>
  58
+										</tr>
  59
+									</table>
  60
+									<!-- ENDIF -->
54 61
 									<div class="postbody">{topic_review_row.MESSAGE}</div>
55 62
 
56 63
 									<!-- IF topic_review_row.S_HAS_ATTACHMENTS -->
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.