Custom Report Mod

Started by d3vcho, June 02, 2011, 09:27:17 AM

Previous topic - Next topic

d3vcho

Link to Mod

Custom Report Mod

This mod will add custom option about reporting to moderators. By default in SMF 2.0 branch whenever someone reports a post to moderator a report is created in moderation center, but after installing this mod and making required changes in admin panel reports will be posted in topics in the specified board.


Admin Interface

General Settings - ?action=admin;area=customreport
- Enable disable the mod with a single click - If the admin hasn't enable this option the default report section of moderation center will be used.
- Board id to create post report.
- Quote the content of reported post.
- Count Posts of Report Board.
- Count the post when moderator solves a report.
- Use bigger input field for writing reports
- Send email to moderators


Permission Settings - ?action=admin;area=customreport;sa=permissionsettings
- Provide permissions to the group who you want to mark reports as solved over here


In posts
- [Report Solved]/[Report Unsolved]
This button appears in 1st post of report topics in report board. Only people having permission 'Can mark reports as solved/unsolved', can see this button.

When a moderator clicks [Report Solved] button a solved topic will be created and the report post will be locked automatically.
When a moderator clicks [Report Unsolved] button the report topic will be unlocked.


GitHub Link
Change log


All future ideas for this mod are most welcome, please post them in mod support thread.

License
* This SMF Modification is subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this SMF modification except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
"Greeting Death as an old friend, they departed this life as equals"

Spoogs

 :o I have to take a look at this right now :)

Thanks for making it.

live627

Ok, for the time, you have two options, both of which display the same thing.

+ Use timeformat() when posting the report
+ Use [time]timestamp[/time] within the content of your post

Joker™

Quote from: live627 on June 03, 2011, 04:14:20 AM
Ok, for the time, you have two options, both of which display the same thing.

+ Use timeformat() when posting the report
+ Use [time]timestamp[/time] within the content of your post
Lol I think my mind is not at place as still I'm unable to get your exact point :P.

Code I'm using in the mod is

timeformat($message['poster_time'] ,'%I:%M:%S')

Are you pointing out some better option for it?
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

MaXiForum.cz

It´s look very good man :-)

HunterP


I apologize for my reply in the 'other' topic.

Mod's looking good Joker. Two questions/suggestions... In your first screenshot, you can see the "Board for recycled topics" which allowsyou to select a board from the drop down list. The ID of the Report Board has to be entered manually. Would it be possible to add the same type of drop down for the Report Board? As far as I know the current setting ($modSettings['report_board']) can be maintained...

Secondly, would it be possible not to link to the reported posting, but to quote it in the report? Something like :




Reported by: Hunter

Reason: This guy is really nuts!

Quote from: HunterP on June 02, 2011, 02:26:30 PM
You should be happy that people are anxious to use your mod. I also hate to say this, but since I was one of the "impatient users", I'll wait a little while and let other users report how well this mod really works...




This way you also get to see the user name and timestamp in the quoted header, which ofcourse also links to the original (reported) posting.

live627

Quote from: Joker™ on June 03, 2011, 04:55:29 AM
Are you pointing out some better option for it?
If you leave out the second parameter to timeformat(), the default forum- or user selected format would be used.

Joker™

Quote from: live627 on June 03, 2011, 08:00:48 PM
If you leave out the second parameter to timeformat(), the default forum- or user selected format would be used.
Thanks for the great suggestion , made the changes try the new package :P. As it was not such a big change so I've not mentioned it on the mod page.



Quote from: HunterP on June 03, 2011, 03:04:25 PM
I apologize for my reply in the 'other' topic.
Lol you were not the guy who made me to behave in that manner :P.


QuoteMod's looking good Joker. Two questions/suggestions... In your first screenshot, you can see the "Board for recycled topics" which allowsyou to select a board from the drop down list. The ID of the Report Board has to be entered manually. Would it be possible to add the same type of drop down for the Report Board? As far as I know the current setting ($modSettings['report_board']) can be maintained...
For that I think JS will be required and I've pretty poor knowledge of it. I'll try to read things around to make one work for the mod, but can't promise whether I'll be able to implement it or not :P.


Quote
Secondly, would it be possible not to link to the reported posting, but to quote it in the report? Something like :




Reported by: Hunter

Reason: This guy is really nuts!

Quote from: HunterP on June 02, 2011, 02:26:30 PM
You should be happy that people are anxious to use your mod. I also hate to say this, but since I was one of the "impatient users", I'll wait a little while and let other users report how well this mod really works...




This way you also get to see the user name and timestamp in the quoted header, which ofcourse also links to the original (reported) posting.
Nice suggestion, but think if the content of post is too large (around 30,000 characters), then you may face following issues

- Wastage of space in DB, as you writing the whole post again in a new report topic subject.
- If the topic has more message which can be termed as spam, so your moderator will loose the opportunity to look at them.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

Joker™

Updated the package with a minute change as suggest by live627

Sources\SendTopic.php


Code (Find:) Select
timeformat($message['poster_time'] ,'%I:%M:%S')


Code (Replace it with:) Select
timeformat($message['poster_time'])


If you don't want to install the whole package again you can make that change manually (Don't forget to make the backup of your file before editing it)
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

HunterP


A report can be 'solved' more than once, resulting in multiple postings with "Report solved by ...". Wouldn't it be possible to add an extra topic-button which toggles between solved and unsolved? You could keep track of the status in a custom :) table, or be naughty and use SMF's existing table for reports, log_reported.

Also, when a posting gets reported twice (or more), multiple topics are created. I would like to see new reports for the same posting in the same topic. For this, you can also use the same table. The only problem is, how to check on the existing report topic. You could write it's id_msg into id_report but it would mess up the table. When someone starts using your mod and never deinstalls it, it would be ok I think, but when someone deinstalls and starts using SMF's default reporting again, you could run into conflicts I guess.

Last but not least, why do you use the word "solve"? SMF's default reporting uses "close" and I guess that is better. A report doesn't neccissarily need to be "solved", but in the end, it should be closed anyway. In my Dutch translation I used "close" rather than "solve". That's also why I don't post my translations, I use different words...

HunterP

Quote from: Joker™ on June 04, 2011, 01:03:51 AM
For that I think JS will be required and I've pretty poor knowledge of it. I'll try to read things around to make one work for the mod, but can't promise whether I'll be able to implement it or not :P.

The recycle board a few lines above does the same. I've tested this :

Code (Find) Select
array('int', 'report_board_id'),
Code (Replace by) Select
array('select', 'report_board_id', $recycle_boards),

And this seems to work. It loads the same list into a different select...

Quote from: Joker™ on June 04, 2011, 01:03:51 AM
Nice suggestion, but think if the content of post is too large (around 30,000 characters), then you may face following issues

- Wastage of space in DB, as you writing the whole post again in a new report topic subject.
- If the topic has more message which can be termed as spam, so your moderator will loose the opportunity to look at them.

If someone spams, or offends someone and edits the posting between the report and the first moderator to read it, the original text has been lost. I think it's very important that a mod like this makes a direct copy of the message. Not only when the user itself edits the post, also when a moderator edits it after the report, so the copy can be used for future reference regarding this members behaviour.

Joker™

Ok, first of all these days I'm bit busy with another project so you can't except all things to be implemented right away. We can collect all accepted suggestions in this thread and I can work on them as soon as I finish my present project(lol, I've to complete Membergroup Icons mod too :P)

Quote from: HunterP on June 04, 2011, 01:27:11 AM
A report can be 'solved' more than once, resulting in multiple postings with "Report solved by ...". Wouldn't it be possible to add an extra topic-button which toggles between solved and unsolved? You could keep track of the status in a custom :) table, or be naughty and use SMF's existing table for reports, log_reported.
This mod doesn't use Report table at all, it makes use of boards, topics and message table. So as pr your suggestion I can only think of creating a new table and using this feature through it, but surely  gonna be a heck lot of work.


QuoteAlso, when a posting gets reported twice (or more), multiple topics are created. I would like to see new reports for the same posting in the same topic. For this, you can also use the same table. The only problem is, how to check on the existing report topic. You could write it's id_msg into id_report but it would mess up the table. When someone starts using your mod and never deinstalls it, it would be ok I think, but when someone deinstalls and starts using SMF's default reporting again, you could run into conflicts I guess.
Not a very optimum way of doing things if a site has large DB. Assume you have a report solved(as per your last suggestion) and then someone reports the same topic, lol DB query is going to make a huge impact is reporting the post (I keep talking about queries as one of my mod got removed because of making a lot of DB queries only)


QuoteLast but not least, why do you use the word "solve"? SMF's default reporting uses "close" and I guess that is better. A report doesn't neccissarily need to be "solved", but in the end, it should be closed anyway. In my Dutch translation I used "close" rather than "solve". That's also why I don't post my translations, I use different words...
Personal choices ;), if you like you can change the text string easily.


Quote from: HunterP on June 04, 2011, 01:45:23 AM
If someone spams, or offends someone and edits the posting between the report and the first moderator to read it, the original text has been lost. I think it's very important that a mod like this makes a direct copy of the message. Not only when the user itself edits the post, also when a moderator edits it after the report, so the copy can be used for future reference regarding this members behaviour.
Again why to waste DB space, when you have a huge permission system and nice warning system already build in SMF.
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

HunterP

Quote from: Joker™ on June 04, 2011, 03:06:21 AM
Quote from: HunterP on June 04, 2011, 01:45:23 AM
If someone spams, or offends someone and edits the posting between the report and the first moderator to read it, the original text has been lost. I think it's very important that a mod like this makes a direct copy of the message. Not only when the user itself edits the post, also when a moderator edits it after the report, so the copy can be used for future reference regarding this members behaviour.
Again why to waste DB space, when you have a huge permission system and nice warning system already build in SMF.

I think we don't understand each other. What is the difference between a regular posting and a quoted report? Sure the postings will be a bit bigger, but why calling that "waste"? Thats what a DB is for IMHO  ::)

If I offend someone, someone else reports it to the moderators, and since they only get to see the link, there is a chance that the posting gets edited before the moderator(s) get to check the posting. At that point, the proof is gone and no-one will know the exact words. If the reporting member has saved the posting, how can you be sure that he didn't edit it himself? To make this really bulletproof, a immediate copy has to be made at the exact time that the posting is reported.

Well, ofcourse you (and others) don't have to agree, but on my board I really don't see the point in a link. The quoted header also is clickable and links to the posting for further reference.

   $request = $smcFunc['db_query']('', '
      SELECT m.id_topic, m.subject, m.body, m.id_member AS id_poster, m.poster_name, mem.real_name, m.poster_time

and

//Content for report post in the report board.
$subject = '[' . addslashes($board_info['name']) . '] ' . $message['subject'];
$body = '[quote author=' . $poster_name . ' link=topic=' . $message['id_topic'] . '.msg' . $_POST['msg'] . '#msg' . $_POST['msg'] . ' date=' . $message['poster_time'] . ']' . '<br />' . $message['body'] . '<br />' . '[/quote]' . '<br /><br />' . $poster_comment;


Does the trick for me. Maybe you should just give it a try ;)

HunterP

Quote from: Joker™ on June 04, 2011, 03:06:21 AM
Quote from: HunterP on June 04, 2011, 01:27:11 AM
A report can be 'solved' more than once, resulting in multiple postings with "Report solved by ...". Wouldn't it be possible to add an extra topic-button which toggles between solved and unsolved? You could keep track of the status in a custom :) table, or be naughty and use SMF's existing table for reports, log_reported.
This mod doesn't use Report table at all, it makes use of boards, topics and message table. So as pr your suggestion I can only think of creating a new table and using this feature through it, but surely  gonna be a heck lot of work.

I know it doesn't use any tables, it was just a suggestion :) I'm willing to help if you like ;)


Quote from: Joker™ on June 04, 2011, 03:06:21 AM
Quote from: HunterP on June 04, 2011, 01:27:11 AM
Also, when a posting gets reported twice (or more), multiple topics are created. I would like to see new reports for the same posting in the same topic. For this, you can also use the same table. The only problem is, how to check on the existing report topic. You could write it's id_msg into id_report but it would mess up the table. When someone starts using your mod and never deinstalls it, it would be ok I think, but when someone deinstalls and starts using SMF's default reporting again, you could run into conflicts I guess.
Not a very optimum way of doing things if a site has large DB. Assume you have a report solved(as per your last suggestion) and then someone reports the same topic, lol DB query is going to make a huge impact is reporting the post (I keep talking about queries as one of my mod got removed because of making a lot of DB queries only)

I don't understand why you whould need "lots of" queries? You should just need an additional check if the current reported posting has already been reported, if true; add it as reply to the existing topic, if false; create a new one and add it to the table :) The same table can have a column "solved" which is toggled via the "Solve report" link and can also be toggled if this posting gets reported again. Sounds very simple, even for me with my little PHP/SQL knowledge. Again, I'm willing to help if you want, and if other users of your mod are also interested?

HunterP


$txt['report_solved'] = 'Report solved';

Is being used in two ways. To solve the topic and is posted when it is closed. This should be two separate strings, like :

$txt['report_solve'] = 'Solve report';
$txt['report_solved'] = 'Report solved';


Joker™

Quote from: Joker™ on June 04, 2011, 03:06:21 AM
Ok, first of all these days I'm bit busy with another project so you can't except all things to be implemented right away.
Will reply to your questions and suggestions soon ;).
Github Profile
Android apps
Medium

How to enable Post Moderation

"For the wise man looks into space and he knows there is no limited dimensions." - Laozi

All support seeking PM's get microwaved

HunterP

Quote from: HunterP on June 04, 2011, 01:27:11 AM
A report can be 'solved' more than once, resulting in multiple postings with "Report solved by ...".

Just a quick fix for those who also want to get rid of this :

Code (Find) Select
if(($message['id'] == $context['first_message']) && ($context['current_board'] == $modSettings['report_board_id']) && allowedTo('can_solve_report'))
Code (Replace By) Select
if(($message['id'] == $context['first_message']) && ($context['current_board'] == $modSettings['report_board_id']) && allowedTo('can_solve_report') && empty($context['is_locked']))

This checks if the topic is locked. If so, it's already 'solved'.

If a report results in a long discussion, it might be handy that "Solve report" can be accessed in all postings :

Code (Replace By) Select
if (($context['current_board'] == $modSettings['report_board_id']) && allowedTo('can_solve_report') && empty($context['is_locked']))

HunterP


Once again, sorry, I notice that this MOD doesn't change the way PM's are reported? I can imagine that some admins don't want all moderators to see reported PM's, but maybe you can either report to a separate board, or make PM reporting (in the same board) optional.

HunterP


I've been using this mod for a few days now and I'm thinking if stickying might be better than locking, but the other way round. First of all, locking doesn't do anything but showing a lock icon. On most boards, moderators are still able to reply. Secondly, if 'unsolved' topics are sticky (and un-sticky when they are 'solved'), they stick to the top and that offers a far better visual indication of reports that still need attention. On my board, most reports get solved rapidly, but some require some discussion, or are not clear enough to take direct action. If tey are sticky, they remain on the top of the list and don't disappear down the list on a busy board with lots of reports.

For me, it's peanuts to change this, but I'm posting this for you (and others) to think about.

Also I'm having an issue with my added DB-table, but I guess I better wait untill you have some more time :)

Spoogs

You do realize that you can create a new permission profile just for that board and strip moderators of most of their super powers right?

Advertisement: