Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: d3vcho on June 02, 2011, 09:27:17 AM

Title: Custom Report Mod
Post by: d3vcho on June 02, 2011, 09:27:17 AM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=3011)

Custom Report Mod (http://custom.simplemachines.org/mods/index.php?mod=3011)

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 (https://github.com/frandominguez03/SMF-CustomReportMod)
Change log (https://github.com/frandominguez03/SMF-CustomReportMod/blob/master/changelog.md)


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/
Title: Re: Custom report Mod
Post by: Spoogs on June 02, 2011, 10:24:19 AM
 :o I have to take a look at this right now :)

Thanks for making it.
Title: Re: Custom report Mod
Post by: 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
Title: Re: Custom report Mod
Post by: Joker™ on June 03, 2011, 04:55:29 AM
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?
Title: Re: Custom report Mod
Post by: MaXiForum.cz on June 03, 2011, 06:34:36 AM
It´s look very good man :-)
Title: Re: Custom report Mod
Post by: HunterP on June 03, 2011, 03:04:25 PM

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.
Title: Re: Custom report Mod
Post by: live627 on June 03, 2011, 08:00:48 PM
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.
Title: Re: Custom report Mod
Post by: Joker™ on June 04, 2011, 01:03:51 AM
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.
Title: Re: Custom report Mod
Post by: Joker™ on June 04, 2011, 01:06:49 AM
Updated the package with a minute change as suggest by live627  (http://www.simplemachines.org/community/index.php?action=profile;u=154736)

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)
Title: Re: Custom report Mod
Post by: 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.

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...
Title: Re: Custom report Mod
Post by: HunterP on June 04, 2011, 01:45:23 AM
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.
Title: Re: Custom report Mod
Post by: 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. 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.
Title: Re: Custom report Mod
Post by: HunterP on June 04, 2011, 10:00:48 AM
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 ;)
Title: Re: Custom report Mod
Post by: HunterP on June 04, 2011, 10:09:18 AM
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?
Title: Re: Custom report Mod
Post by: HunterP on June 04, 2011, 11:00:15 AM

$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';

Title: Re: Custom report Mod
Post by: Joker™ on June 05, 2011, 07:23:32 AM
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 ;).
Title: Re: Custom report Mod
Post by: HunterP on June 05, 2011, 07:35:30 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 ...".

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']))
Title: Re: Custom report Mod
Post by: HunterP on June 05, 2011, 10:22:51 AM

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.
Title: Re: Custom report Mod
Post by: HunterP on June 06, 2011, 01:08:36 AM

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 :)
Title: Re: Custom report Mod
Post by: Spoogs on June 06, 2011, 09:45:20 AM
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?
Title: Re: Custom report Mod
Post by: HunterP on June 06, 2011, 01:14:08 PM
Quote from: Spoogs on June 06, 2011, 09:45:20 AM
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?

It can be done, but how often do you think this will happen?
Title: Re: Custom report Mod
Post by: Spoogs on June 06, 2011, 01:19:43 PM
Umm it's only 1 board, how often would it need to happen?
Does it not solve the issue you put forth with no additional code needed?
Title: Re: Custom report Mod
Post by: HunterP on June 06, 2011, 01:27:40 PM
Quote from: Spoogs on June 06, 2011, 01:19:43 PM
Umm it's only 1 board, how often would it need to happen?
Does it not solve the issue you put forth with no additional code needed?

I don't quite understand what you're trying to say?
What I mean is that I don't understand why someone should be able to see reports, but not to solve them.
That doesn't make any sense in my opinion. It's Jokers mod, so he should create permissions the way he wants :)
Title: Re: Custom report Mod
Post by: Spoogs on June 06, 2011, 01:32:37 PM
Marking the topics solved is permissions driven

Quote from: Joker™ on June 02, 2011, 09:27:17 AM
Also admins need to allot one permission to there moderators who will be handling the reports. To enable this permission go to
Administration Center » Permissions » General Permissions » and open permission of the group who you want to mark reports as solved
- Can mark reports as solved. (Will be explaining about this permission more ahead)
Quote from: Joker™ on June 02, 2011, 09:27:17 AM
- [Report Solved]
This button appears in 1st post of report topics in report board. Only people having permission 'Can mark reports as solved', can see this button. When a moderator clicks this button the forum will
be creating a topic automatically saying
Title: Re: Custom report Mod
Post by: HunterP on June 06, 2011, 01:37:55 PM
Quote from: Spoogs on June 06, 2011, 01:32:37 PM
Marking the topics solved is permissions driven

I know but..........Never mind :)
Title: Re: Custom report Mod
Post by: Joker™ on June 06, 2011, 01:44:06 PM
Quote from: HunterP on June 06, 2011, 01:08:36 AM
For me, it's peanuts to change this
Can I have some peanuts :P?
Title: Re: Custom report Mod
Post by: HunterP on June 06, 2011, 01:51:15 PM
Quote from: Joker™ on June 06, 2011, 01:44:06 PM
Can I have some peanuts :P?

Salted?  ;)
Title: Re: Custom report Mod
Post by: Joker™ on June 06, 2011, 01:58:41 PM
Quote from: HunterP on June 06, 2011, 01:51:15 PM
Salted?  ;)
Lol, salted, ok :P.
Title: Re: Custom report Mod
Post by: Zuća on June 06, 2011, 02:05:21 PM
Do you map out the issue "solved" if it can write to the topic (declared) and not in the mail in a certain board?
Title: Re: Custom report Mod
Post by: Joker™ on June 07, 2011, 09:15:45 AM
Quote from: HunterP on June 05, 2011, 07:35:30 AM
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']))

Thanks for the fix (not tried it personally yet), but whenever you provide some code change in a message don't forget to warn users to make backup of there files first, as people tend to break there forums badly while modifying codes. So don't forget to warn people while playing with codes.



Quote from: HunterP on June 05, 2011, 10:22:51 AM
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.
This mod is specifically designed for reporting posts, I haven't mentioned anything about PM's also in the mod description. Can be a future aspect of the mod ;).



Quote from: HunterP on June 06, 2011, 01:08:36 AM
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.
Lol on my previous forum I used to get 20 - 30 reports per hour and I would be very unhappy to see 20-30 topics sticked in the report board. The behavior of this mod is made to suit the needs all the forums running on SMF and not a specific forum. As I said previously also you can use the SMF permission system, it quite powerful as per my knowledge.
So, for sure I'm not going to change this specific behavior of the mod :).



QuoteAlso I'm having an issue with my added DB-table, but I guess I better wait untill you have some more time :)
That would require to see what changes have you made exactly to the tables. My suggestion would be to create a new table for this mod, instead of using log_reported table.



QuoteI don't quite understand what you're trying to say?
What I mean is that I don't understand why someone should be able to see reports, but not to solve them.
That doesn't make any sense in my opinion. It's Jokers mod, so he should create permissions the way he wants :)
I made that permission so that if an admin has forgot to hide the board from normal users then those users won't be able to solve the reports. While making this mod on my test site, my report board was visible to every group as a result you can see that permission ;) (is it bad to have a extra permission?).
Title: Re: Custom report Mod
Post by: Joker™ on June 07, 2011, 09:21:04 AM
Quote from: Present. on June 06, 2011, 02:05:21 PM
Do you map out the issue "solved" if it can write to the topic (declared) and not in the mail in a certain board?
Sorry cant' get what you are exactly trying to say :P?
Title: Re: Custom report Mod
Post by: HunterP on June 07, 2011, 02:09:02 PM

Not directly related to this mod, but I've been wondering for a long time why only one line is available when reporting a posting and why the report-field is bigger when reporting a personal message. I've copied the line for the personal messages to regular postings and this seems to work correctly. Why isn't this default?
Title: Re: Custom report Mod
Post by: Joker™ on June 07, 2011, 03:15:53 PM
Quote from: HunterP on June 07, 2011, 02:09:02 PM

Not directly related to this mod, but I've been wondering for a long time why only one line is available when reporting a posting and why the report-field is bigger when reporting a personal message. I've copied the line for the personal messages to regular postings and this seems to work correctly. Why isn't this default?
http://www.simplemachines.org/community/index.php?topic=426962.msg2994246#msg2994246
Title: Re: Custom report Mod
Post by: HunterP on June 07, 2011, 03:20:40 PM
Quote from: Joker™ on June 07, 2011, 03:15:53 PM
http://www.simplemachines.org/community/index.php?topic=426962.msg2994246#msg2994246

Good one! But why mister Joker, didn't you apply this in this modification? ;)
Title: Re: Custom report Mod
Post by: Joker™ on June 07, 2011, 03:26:28 PM
Quote from: HunterP on June 07, 2011, 03:20:40 PM
Good one! But why mister Joker, didn't you apply this in this modification? ;)
Lol mods playing with templates becomes difficult to manage in terms of support in later stages.
Title: Re: Custom report Mod
Post by: live627 on June 07, 2011, 06:34:41 PM
Actually you can do that without meddling with a template edit. Have you ever used integrate_buffer? It's  a buffer hook callback of ob_start(). Use it to do a search and replace of the text field.
Title: Re: Custom report Mod
Post by: Bugo on June 08, 2011, 01:36:31 AM
It would be nice to replace this line:

$subject = $txt['report_solved'] . $message['subject'];

with:

$subject = $txt['report_solved'] . ' ' . $message['subject'];

or:

$subject = $txt['report_solved'];
Title: Re: Custom report Mod
Post by: Joker™ on June 08, 2011, 08:09:25 AM
Quote from: live627 on June 07, 2011, 06:34:41 PM
Actually you can do that without meddling with a template edit. Have you ever used integrate_buffer? It's  a buffer hook callback of ob_start(). Use it to do a search and replace of the text field.
Never used hooks, will try to read about them soon.



Quote from: Bugo on June 08, 2011, 01:36:31 AM
It would be nice to replace this line:

$subject = $txt['report_solved'] . $message['subject'];

with:

$subject = $txt['report_solved'] . ' ' . $message['subject'];

Thanks Bugo suggestion take, will be implementing it in the next upgrade.
Title: Re: Custom report Mod
Post by: Joker™ on June 21, 2011, 09:51:19 AM
Update on mod

Made some changes in mod (you can say nice one :P).

- Drop down box to select report board.
In the mod earlier one can select a report board as recycle bin board and vice-versa, just fixed this bug.

- Reported post can be quoted in the post(report board post)
This has been made using a slight permission, that a admin can choose whether he wants this functionality or not.

- Implemented bugo suggestion in a slight different manner.

- Report to moderator was shown in report board also,fixed (Just a silly mistake from me :P).



So features left are:

- Checking that whether the report is solved or not?
As we are using a board to collect the reported posts, so the tables are also used regarding to posts, topic and messages. I don't think using a log_report table for this single feature is very efficient, moreover creating a single table/column for it doesn't sound nice to me. Just looking/thinking of more ideas how to accomplish it.


- Checking whether the post is reported earlier or not (Edit - Completed ;))
This sounds a nice enough feature to me to be implemented, going to work on this tonight.


Whole and whole you can expect the updated mod in a few days :).
Title: Re: Custom report Mod
Post by: Joker™ on June 21, 2011, 05:04:46 PM
Mod updated, you can read change log here (http://www.simplemachines.org/community/index.php?topic=436235.msg3061510#msg3061510).
Title: Re: Custom report Mod
Post by: Eclipse16V on June 21, 2011, 05:27:24 PM
Nice Mod

Thanks

German Lang comes the next days
Title: Re: Custom report Mod
Post by: Joker™ on June 23, 2011, 01:16:46 PM
Just updated the mod to Version 1.2. I urge all users using version 1.1  to update to 1.2 asap, as version 1.2 contains a critical fix.
Title: Re: Custom report Mod
Post by: snooks on June 23, 2011, 03:21:51 PM
done and thanks  ;)
Title: Re: Custom report Mod
Post by: snooks on June 25, 2011, 04:31:35 PM
Hi joker, are you aware of this problem caused by this mod i can confirm what these guys are saying i have just done my head in wondering why all of a sudden a post view able by guests was no longer view able to them
After searching i came up with this post http://www.simplemachines.org/community/index.php?topic=439380.msg3085730#msg3085730 i uninstalled the mod and everything was back to normal, maybe you was unaware of this problem so just pointing it out hope you dont mind

I would like to use this mod but posts view able to guests is important too so any chance of a fix if possible please

thank you
Title: Re: Custom report Mod
Post by: Joker™ on June 26, 2011, 12:46:00 PM
Thanks for informing me, I've just updated the package, please try the new package.

Too tired to explain the exact cause of issue.
Title: Re: Custom report Mod
Post by: akbora on June 26, 2011, 01:02:38 PM
This is very useful mod that's great job
Title: Re: Custom report Mod
Post by: snooks on June 26, 2011, 01:06:12 PM
Quote from: Joker™ on June 26, 2011, 12:46:00 PM
Thanks for informing me, I've just updated the package, please try the new package.

Too tired to explain the exact cause of issue.

thank you very much for this fix :)
Title: Re: Custom report Mod
Post by: npiccoli on July 13, 2011, 03:41:27 PM
I thought of a couple ways you could improve this modification.

By the way, I noticed you are adding spaces before you are adding the colons. Those spaces are unnecessary, perhaps you could remove them in the next update (if there is going to be another update).

Overall, this modification is pretty nice. I think with the three suggestions above it would make the modification better all around. Either way, thanks! :)
Title: Re: Custom report Mod
Post by: Joker™ on July 13, 2011, 04:23:11 PM
Quote from: npiccoli on July 13, 2011, 03:41:27 PM
I thought of a couple ways you could improve this modification.
  • You could allow moderators to respond to the topics created in the specified board. Those replies will be sent to the reporter via private message. Once the reporter responds to the private message, it will be added as a response to the topic.
  • You could add the ability to automatically archive reports after they have been solved, or archive them after a certain amount of time. By archiving, I mean either choosing to delete them, or place them into another board.

By the way, I noticed you are adding spaces before you are adding the colons. Those spaces are unnecessary, perhaps you could remove them in the next update (if there is going to be another update).

Overall, this modification is pretty nice. I think with the three suggestions above it would make the modification better all around. Either way, thanks! :)
First of all thanks for suggestions


1. You mean to add create a suggestion topic for a reported topic? If that's the case then I think you missed the point of whole mod. This mod makes reports post already in a board and if moderators want to have a discussion they can do it on that topic only. What you are asking for is already packed and rolled out as a mod. You can find the mod on mod site.


2. Once a report is solved and topic is locked automatically. So as new reports are created, old ones will slide down automatically. You can also move topics to other board using checkboxes. To make what you are asking for shouldn't be too hard, as one member asked for the feature of pruning posts based on there last views and I completed the whole things in about 15mins. But seriously I hate to prune topics :P. Still if more users ask for this I'll include this feature in the mod.


3. Are you trying to point out to this code?
$subject = $txt['reported_post'] . ' : ' . $message['subject'];

I just did it that way to have a more clean display of topic subject, if you like you can change it to
$subject = $txt['reported_post'] . ':' . $message['subject'];


A big thanks once again for all of your suggestions :).
Title: Re: Custom report Mod
Post by: npiccoli on July 13, 2011, 04:41:37 PM
Quote from: Joker™ on July 13, 2011, 04:23:11 PM1. You mean to add create a suggestion topic for a reported topic? If that's the case then I think you missed the point of whole mod. This mod makes reports post already in a board and if moderators want to have a discussion they can do it on that topic only. What you are asking for is already packed and rolled out as a mod. You can find the mod on mod site.

I get it now, after thinking it through the way you have it makes total sense!

Quote from: Joker™ on July 13, 2011, 04:23:11 PM2. Once a report is solved and topic is locked automatically. So as new reports are created, old ones will slide down automatically. You can also move topics to other board using checkboxes. To make what you are asking for shouldn't be too hard, as one member asked for the feature of pruning posts based on there last views and I completed the whole things in about 15mins. But seriously I hate to prune topics :P. Still if more users ask for this I'll include this feature in the mod.

I have always found that pruning these kind of topics is a good way to keep a board organized. I like having archives in certain boards, whereas some people would rather the topics just be left alone. Perhaps if this feature is added, you could have the ability for the board pruning to be toggled via the admin panel.

Quote from: Joker™ on July 13, 2011, 04:23:11 PM3. Are you trying to point out to this code?
$subject = $txt['reported_post'] . ' : ' . $message['subject'];

I just did it that way to have a more clean display of topic subject, if you like you can change it to
$subject = $txt['reported_post'] . ':' . $message['subject'];

Oh okay. Could you tell me where to find this code? Like... which file is this code found in so I can edit it a little?

Quote from: Joker™ on July 13, 2011, 04:23:11 PMA big thanks once again for all of your suggestions :).

You are most welcome. :)
Title: Re: Custom report Mod
Post by: Joker™ on July 13, 2011, 04:49:45 PM
QuoteI have always found that pruning these kind of topics is a good way to keep a board organized. I like having archives in certain boards, whereas some people would rather the topics just be left alone. Perhaps if this feature is added, you could have the ability for the board pruning to be toggled via the admin panel.
Will think about it again ;).


QuoteOh okay. Could you tell me where to find this code? Like... which file is this code found in so I can edit it a little?
Sources/SendTopic.php (Make backup of file before editing it)
Title: Re: Custom report Mod
Post by: npiccoli on July 13, 2011, 05:27:06 PM
Quote from: Joker™ on July 13, 2011, 04:49:45 PM
QuoteI have always found that pruning these kind of topics is a good way to keep a board organized. I like having archives in certain boards, whereas some people would rather the topics just be left alone. Perhaps if this feature is added, you could have the ability for the board pruning to be toggled via the admin panel.
Will think about it again ;).


QuoteOh okay. Could you tell me where to find this code? Like... which file is this code found in so I can edit it a little?
Sources/SendTopic.php (Make backup of file before editing it)

Thank you, again! :)
Title: Re: Custom report Mod
Post by: Bill Statler on July 30, 2011, 11:52:22 PM
Joker™, thank you very much for this mod!  Our moderator staff is very happy with the change -- it's so much easier to discuss reported posts in a regular forum thread, rather than in comments in the Moderation Center.

Can I request an extra feature for Version 1.4?  It would be nice if the moderators could receive automatic e-mail notification when a post is reported.  As far as I can tell, your Version 1.3 doesn't have this ability.

I thought we could work around this by using notification for new topics in the Reported Posts board.  But this doesn't work.  If I understand your code, it just calls createPost() and bypasses the code that handles notifications for regular posts -- so, no notifications.

It seems like the e-mailing code from ReportToModerator2() could be transplanted into your CustomReportToModerator2().  I was thinking of trying this myself, but I've got almost no experience with hacking PHP software.

Is this doable?

Thanks very much.
Title: Re: Custom report Mod
Post by: Joker™ on July 31, 2011, 06:00:41 AM
Quote from: Bill Statler on July 30, 2011, 11:52:22 PM
Can I request an extra feature for Version 1.4?  It would be nice if the moderators could receive automatic e-mail notification when a post is reported.  As far as I can tell, your Version 1.3 doesn't have this ability.
Surely sounds a nice idea, and will try to work on it in next release ;).
Title: Re: Custom report Mod
Post by: Bill Statler on July 31, 2011, 01:46:22 PM
Quote from: Joker™ on July 31, 2011, 06:00:41 AM
Surely sounds a nice idea, and will try to work on it in next release ;).

Thank you!  Looking forward to it. :)
Title: Re: Custom report Mod
Post by: sisterwolf on September 29, 2011, 06:36:51 PM
Quote from: Bill Statler on July 30, 2011, 11:52:22 PM
Joker™, thank you very much for this mod!  Our moderator staff is very happy with the change -- it's so much easier to discuss reported posts in a regular forum thread, rather than in comments in the Moderation Center.

Can I request an extra feature for Version 1.4?  It would be nice if the moderators could receive automatic e-mail notification when a post is reported.  As far as I can tell, your Version 1.3 doesn't have this ability.

I thought we could work around this by using notification for new topics in the Reported Posts board.  But this doesn't work.  If I understand your code, it just calls createPost() and bypasses the code that handles notifications for regular posts -- so, no notifications.

It seems like the e-mailing code from ReportToModerator2() could be transplanted into your CustomReportToModerator2().  I was thinking of trying this myself, but I've got almost no experience with hacking PHP software.

Is this doable?

Thanks very much.


This ^ would be awesome. What I'm wondering, is if we could do this in the meantime by taking this code:
if ((isset($_POST[$context['session_var']]) || isset($_POST['submit'])) && empty($context['post_errors']) && !empty($modSettings['report_board']))
CustomReportToModerator2();


And asking it to ALSO call ReportToModerator2 (for notifications) as well as calling CustomReportToModerator2 for board postings.

Is there a quick fix that we could do that would use both functions?
Title: Re: Custom report Mod
Post by: Joker™ on September 30, 2011, 08:03:13 AM
Quote from: sisterwolf on September 29, 2011, 06:36:51 PM
This ^ would be awesome. What I'm wondering, is if we could do this in the meantime by taking this code:
if ((isset($_POST[$context['session_var']]) || isset($_POST['submit'])) && empty($context['post_errors']) && !empty($modSettings['report_board']))
CustomReportToModerator2();


And asking it to ALSO call ReportToModerator2 (for notifications) as well as calling CustomReportToModerator2 for board postings.

Is there a quick fix that we could do that would use both functions?
Been busy with other projects right now. I'll try to see all my mods soon. Most of them needs some or other new features requested by users around here :P.
Title: Re: Custom report Mod
Post by: Thumbelina on October 08, 2011, 06:01:21 AM
Hi,

It would be great to have a limit on the number of reports a member can make. A bit like challenges in tennis, so if someone is constantly reporting stuff the Mods think is frivolous, then they use up their reports and cannot report any more for a while.
Title: Re: Custom report Mod
Post by: Joker™ on October 09, 2011, 05:12:31 AM
Quote from: Thumbelina on October 08, 2011, 06:01:21 AM
Hi,

It would be great to have a limit on the number of reports a member can make. A bit like challenges in tennis, so if someone is constantly reporting stuff the Mods think is frivolous, then they use up their reports and cannot report any more for a while.
There was some sort of time limit between which a member can report again. As far as I remember it is 4 times the "Time required between posts from the same IP".

Even now you want some measures for such members, just issue them some warning using the inbuilt warning system of SMF.
Title: Re: Custom report Mod
Post by: Joker™ on October 09, 2011, 02:57:46 PM
Updated the mod to 1.4 RC1 (My first mod going in RC stage :P)

Quote from: Bill Statler on July 30, 2011, 11:52:22 PM
Can I request an extra feature for Version 1.4?  It would be nice if the moderators could receive automatic e-mail notification when a post is reported.  As far as I can tell, your Version 1.3 doesn't have this ability.
Just left with this feature. Right now I'm not having mail server on the notebook. In morning I'll try to make one and test the email thing also.


Quote from: live627 on June 07, 2011, 06:34:41 PM
Actually you can do that without meddling with a template edit. Have you ever used integrate_buffer? It's  a buffer hook callback of ob_start(). Use it to do a search and replace of the text field.
Sir, you would be happy to see the this version ;). Thanks for the advise.


Can I get some feedback on the new version? I hope it doesn't give to much of issues to you guys. Just bit worried about the hooks :P.

/me starts moving towards bed
Title: Re: Custom report Mod
Post by: _saiko on November 02, 2011, 05:06:51 PM
Using the 1.4RC1 version.

Getting 'Undefined index: comment_body' in error log.

There's a problem with line 45 in the CustomReport.php file.
Title: Re: Custom report Mod
Post by: Joker™ on November 03, 2011, 08:14:53 AM
Quote from: _saiko on November 02, 2011, 05:06:51 PM
Using the 1.4RC1 version.

Getting 'Undefined index: comment_body' in error log.

There's a problem with line 45 in the CustomReport.php file.
Must be something related to buffer. Will try to fix it soon.

Thanks for reporting it :).
Title: Re: Custom report Mod
Post by: Joker™ on November 04, 2011, 07:15:16 AM
Mod updated.

Please try version "CustomReportMod1.4RC2"
Title: Re: Custom report Mod
Post by: Diego Andrés on November 06, 2011, 01:57:12 AM
I got a question for this ...
If a moderator put a comment in the report, automatically also appear in the topic?
Title: Re: Custom report Mod
Post by: Joker™ on November 07, 2011, 04:20:29 AM
Quote from: Diego Andrés on November 06, 2011, 01:57:12 AM
I got a question for this ...
If a moderator put a comment in the report, automatically also appear in the topic?
Can you explain your question in a bit more explanatory way?

Also there is complete description of the mod on the mod page (http://custom.simplemachines.org/mods/index.php?mod=3011) :).
Title: Re: Custom report Mod
Post by: HunterP on November 07, 2011, 11:23:43 AM

Question for the Joker. If a team member closes/solves a report, a default posting is being made, indicating that this member has closed the report. Would it be possible, after clicking this extra button, that an additional window appears (like the reporting window itself) in which this team member can add his comment, about how he handled this report, followed by the default text?

Someting like this, if I would type "Deleted the posting and warned this ever annoying member", it would appear like (not quoted, but just for this example) :

QuoteDeleted the posting and warned this ever annoying member




Report solved by 'Hunter'

Would this be possible, please?

Ofcourse, a member can post his comment AND close the topic, but my suggestion is a bit easier, quicker and looks better ;)
Title: Re: Custom report Mod
Post by: Diego Andrés on November 07, 2011, 07:11:21 PM
Quote from: Joker™ on November 07, 2011, 04:20:29 AM
Quote from: Diego Andrés on November 06, 2011, 01:57:12 AM
I got a question for this ...
If a moderator put a comment in the report, automatically also appear in the topic?
Can you explain your question in a bit more explanatory way?

Also there is complete description of the mod on the mod page (http://custom.simplemachines.org/mods/index.php?mod=3011) :).

Yes ... Here is a picture:
http://i.imgur.com/3mP1u.png

I'm talking about commenting the report, also the comment appears in the topic?
Title: Re: Custom report Mod
Post by: HunterP on November 08, 2011, 02:05:58 AM
Quote from: Diego Andrés on November 07, 2011, 07:11:21 PM
I'm talking about commenting the report, also the comment appears in the topic?

Yes the report is a topic, so all members who can access that topic (like moderators) can reply to it, like in a regular topic.
Title: Re: Custom report Mod
Post by: Diego Andrés on November 08, 2011, 03:26:07 PM
But as i say, i'm asking if the comments to the report on the moderation log, also appear in the topic
Title: Re: Custom report Mod
Post by: HunterP on November 08, 2011, 03:31:57 PM
Quote from: Diego Andrés on November 08, 2011, 03:26:07 PM
But as i say, i'm asking if the comments to the report on the moderation log, also appear in the topic

No, this modification replaces the old logging. Or do you mean if all old reports wille be posted as topic? No, old reports will remain in the moderation log. Only new reports (after you install the topic) will be posted as topic.
Title: Re: Custom report Mod
Post by: Joker™ on November 08, 2011, 03:34:51 PM
Quote from: HunterP on November 07, 2011, 11:23:43 AM

Question for the Joker. If a team member closes/solves a report, a default posting is being made, indicating that this member has closed the report. Would it be possible, after clicking this extra button, that an additional window appears (like the reporting window itself) in which this team member can add his comment, about how he handled this report, followed by the default text?

Would this be possible, please?
Possibility depends on how much free time I get in upcoming days. Right now nearly half of my days gets acquired on my workplace.


Quote from: Diego Andrés on November 08, 2011, 03:26:07 PM
But as i say, i'm asking if the comments to the report on the moderation log, also appear in the topic
If this mod is enabled the default reports moderation area is disabled automatically.
Title: Re: Custom report Mod
Post by: Diego Andrés on November 08, 2011, 07:00:02 PM
Quote from: Joker™ on November 08, 2011, 03:34:51 PM
Quote from: HunterP on November 07, 2011, 11:23:43 AM

Question for the Joker. If a team member closes/solves a report, a default posting is being made, indicating that this member has closed the report. Would it be possible, after clicking this extra button, that an additional window appears (like the reporting window itself) in which this team member can add his comment, about how he handled this report, followed by the default text?

Would this be possible, please?
Possibility depends on how much free time I get in upcoming days. Right now nearly half of my days gets acquired on my workplace.


Quote from: Diego Andrés on November 08, 2011, 03:26:07 PM
But as i say, i'm asking if the comments to the report on the moderation log, also appear in the topic
If this mod is enabled the default reports moderation area is disabled automatically.

Oh I saw ... Thanks.
Title: Re: Custom report Mod
Post by: Joker™ on November 10, 2011, 06:06:26 AM
Quote from: Diego Andrés on November 08, 2011, 07:00:02 PM
Oh I saw ... Thanks.
Happy to help :D.
Title: Re: Custom report Mod
Post by: Sefket on November 22, 2011, 05:06:40 PM
- [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.

Can you put this in for SMF 1.1.15?
Title: Re: Custom report Mod
Post by: Joker™ on November 22, 2011, 05:15:13 PM
Quote from: Sefket on November 22, 2011, 05:06:40 PM
- [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.

Can you put this in for SMF 1.1.15?
Sorry mate I'm not back-porting any of my work to SMF 1.x branch as SMF has already released a stable version of SMF 2.0.
Title: Re: Custom report Mod
Post by: hcfwesker on December 06, 2011, 07:33:54 AM
I noticed in the demo pics, there's no reply button in the topic that gets posted in the report board.  Can those with permission to view it, be able to reply.  It'd be handy for staff to be able to discuss the outcome, or what needs to be done, in the reported topic.  Just wasn't sure.
Title: Re: Custom report Mod
Post by: Joker™ on December 06, 2011, 07:44:25 AM
Quote from: hcfwesker on December 06, 2011, 07:33:54 AM
I noticed in the demo pics, there's no reply button in the topic that gets posted in the report board.  Can those with permission to view it, be able to reply.  It'd be handy for staff to be able to discuss the outcome, or what needs to be done, in the reported topic.  Just wasn't sure.
Reply button vanishes if the report is marked as solved. Initially when a report topic is created there is a reply button for moderators(pretty sure of that), as that is the main motto of this mod.
Title: Re: Custom report Mod
Post by: hcfwesker on December 06, 2011, 07:53:31 AM
Awesome, thats what I wanted to know.  Definitely fixing to add this.   As always, another brilliant MOD .... can't believe I just found it now lol
Title: Re: Custom report Mod
Post by: Joker™ on December 06, 2011, 09:21:25 AM
Quote from: hcfwesker on December 06, 2011, 07:53:31 AM
Awesome, thats what I wanted to know.  Definitely fixing to add this.   As always, another brilliant MOD .... can't believe I just found it now lol
Thanks for the nice words :).
Title: Re: Custom report Mod
Post by: Sefket on December 07, 2011, 08:36:39 PM
Quote from: Joker™ on November 22, 2011, 05:15:13 PM
Quote from: Sefket on November 22, 2011, 05:06:40 PM
- [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.

Can you put this in for SMF 1.1.15?
Sorry mate I'm not back-porting any of my work to SMF 1.x branch as SMF has already released a stable version of SMF 2.0.

Aww :( .
Title: Re: Custom report Mod
Post by: Joker™ on December 08, 2011, 06:54:57 AM
Quote from: Sefket on December 07, 2011, 08:36:39 PM
Quote from: Joker™ on November 22, 2011, 05:15:13 PM
Quote from: Sefket on November 22, 2011, 05:06:40 PM
- [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.

Can you put this in for SMF 1.1.15?
Sorry mate I'm not back-porting any of my work to SMF 1.x branch as SMF has already released a stable version of SMF 2.0.

Aww :( .
try updating your forum to SMF 2.0. It's not that hard ;).
Title: Re: Custom report Mod
Post by: afv on January 26, 2012, 11:59:37 PM
Hi Joker™,

Thank you for all the work on this mod! :D I've been using the old vReportBoard Mod but will soon upgrade my forum to the new SMF 2, so I'll have to use your mod. :)

I was taking a look at the source code and noticed this on the modification.xml file, that I'm not sure if it's correct (shouldn't the red parts be switched with the green ones?):

Quote
[...]
   <file name="$sourcedir/ManageBoards.php">
      <operation>
         <search position="replace"><![CDATA[   $recycle_boards = array('');
   $request = $smcFunc['db_query']('order_by_board_order', '
      SELECT b.id_board, b.name AS board_name, c.name AS cat_name
      FROM {db_prefix}boards AS b
         LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
      WHERE redirect = {string:empty_string}',
      array(
         'empty_string' => '',
      )
   );
   while ($row = $smcFunc['db_fetch_assoc']($request))
      $recycle_boards[$row['id_board']] = $row['cat_name'] . ' - ' . $row['board_name'];
   $smcFunc['db_free_result']($request);]]></search>
         <add><![CDATA[   $recycle_boards = array('');
   $request = $smcFunc['db_query']('order_by_board_order', '
      SELECT b.id_board, b.name AS board_name, c.name AS cat_name
      FROM {db_prefix}boards AS b
         LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
      WHERE redirect = {string:empty_string}' . (!empty($modSettings[ 'report_board']) && $modSettings[ 'report_board_id'] > 0 ? '
      AND b.id_board != {int:report_board_id}' : ''),
      array(
         'empty_string' => '',
         'report_board_id' => $modSettings[ 'report_board_id'],
      )
   );
   while ($row = $smcFunc['db_fetch_assoc']($request))
      $recycle_boards[$row['id_board']] = $row['cat_name'] . ' - ' . $row['board_name'];
   $smcFunc['db_free_result']($request);
   
   $report_boards = array('');
   $request = $smcFunc['db_query']('order_by_board_order', '
      SELECT b.id_board, b.name AS board_name, c.name AS cat_name
      FROM {db_prefix}boards AS b
         LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
      WHERE redirect = {string:empty_string}' . (!empty($modSettings[ 'recycle_enable']) && $modSettings[ 'recycle_board'] > 0 ? '
      AND b.id_board != {int:recycle_board_id}' : ''),
      array(
         'empty_string' => '',
         'recycle_board_id' => $modSettings[ 'recycle_board'],
      )
   );
   while ($row = $smcFunc['db_fetch_assoc']($request))
      $report_boards[$row['id_board']] = $row['cat_name'] . ' - ' . $row['board_name'];
   $smcFunc['db_free_result']($request);
]]></add>
      </operation>
[...]

Thanks! :)
Title: Re: Custom report Mod
Post by: Joker™ on January 27, 2012, 05:49:45 AM
Quote from: afv on January 26, 2012, 11:59:37 PM
Hi Joker™,

Thank you for all the work on this mod! :D I've been using the old vReportBoard Mod but will soon upgrade my forum to the new SMF 2, so I'll have to use your mod. :)

I was taking a look at the source code and noticed this on the modification.xml file, that I'm not sure if it's correct (shouldn't the red parts be switched with the green ones?):

First question first, have you seen some visual error with the present code?

That code picks up the board which you can use as a report board, so in that case you don't want recycle/trash board to be used as the report board.
Also the mod code is simple replacing the original code, hence the code you have marked in red is same as original one.

  $request = $smcFunc['db_query']('order_by_board_order', '
      SELECT b.id_board, b.name AS board_name, c.name AS cat_name
      FROM {db_prefix}boards AS b
         LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)
      WHERE redirect = {string:empty_string}' . (!empty($modSettings[ 'report_board']) && $modSettings[ 'report_board_id'] > 0 ? '
      AND b.id_board != {int:report_board_id}' : ''),
      array(
         'empty_string' => '',
         'report_board_id' => $modSettings[ 'report_board_id'],
      )
   );
   while ($row = $smcFunc['db_fetch_assoc']($request))
      $recycle_boards[$row['id_board']] = $row['cat_name'] . ' - ' . $row['board_name'];
   $smcFunc['db_free_result']($request);


Talking about this code.
Title: Re: Custom report Mod
Post by: afv on January 27, 2012, 11:20:02 AM
Quote from: Joker™ on January 27, 2012, 05:49:45 AM
First question first, have you seen some visual error with the present code?

That code picks up the board which you can use as a report board, so in that case you don't want recycle/trash board to be used as the report board.
Also the mod code is simple replacing the original code, hence the code you have marked in red is same as original one.

[...]

Talking about this code.

Thanks for the response. I haven't tried it yet. :)

There's something I'm missing on that code, because it seems to me that it's assigning the report_board_id to the $recycle_boards (on the while loop) and then, on the next select, assigning the recycle to the $report_boards. That's why I thought they were switched. :-[
Title: Re: Custom report Mod
Post by: dimspace on December 08, 2012, 10:43:03 AM
Excellent mod, thank you. combined it with the portal so that the latest thread in the board appears at the top of the page for mods and admin and works lovely. (2.0.2)
Title: Re: Custom report Mod
Post by: rogerzilla on February 14, 2013, 02:52:39 PM
Is there any way to have a different target for reports from a particular board?  We'd like the board moderator to be able to see reports for him, without having access to the same area as global moderators.

Thanks
Title: Re: Custom report Mod
Post by: Joker™ on February 15, 2013, 04:29:24 AM
Quote from: rogerzilla on February 14, 2013, 02:52:39 PM
Is there any way to have a different target for reports from a particular board?  We'd like the board moderator to be able to see reports for him, without having access to the same area as global moderators.

Thanks
Can you elaborate this?
Title: Re: Custom report Mod
Post by: NekoJonez on April 29, 2013, 09:20:09 AM
In SMF 2.0.4 with 1.4RC , I have two lines above the "save" button. How can I fix this?
Title: Re: Custom report Mod
Post by: Mooby The Golden Sock on February 08, 2014, 01:58:06 PM
Quote from: Joker™ on February 15, 2013, 04:29:24 AM
Quote from: rogerzilla on February 14, 2013, 02:52:39 PM
Is there any way to have a different target for reports from a particular board?  We'd like the board moderator to be able to see reports for him, without having access to the same area as global moderators.

Thanks
Can you elaborate this?
I'm pretty sure he's saying that he wants to set up his forum like:

- General Discussion (Moderator: Luke Skywalker)
-- Reports: General Discussion (Moderator: Luke Skywalker)

- Talking About The Weather (Moderator: Han Solo)
-- Reports: Talking About The Weather (Moderator: Han Solo)

- Water Cooler (Moderator: Chewbacca)
-- Reports: Water Cooler (Moderator: Chewbacca)

- Things Related To Other Things (Moderator: R2D2)
-- Reports: Things Related To Other Things (Moderator: R2D2)

Basically, a function to set up a report board for each board in the forum.  Like, in the menu, have the normal drop down box for selecting the general report board, with an option to use individual board settings.  If the latter is chosen, then have an additional report board drop down on the board settings page for each individual board.
Title: Re: Custom report Mod
Post by: Joker™ on February 15, 2014, 07:52:34 AM
Quote from: Mooby The Golden Sock on February 08, 2014, 01:58:06 PM
I'm pretty sure he's saying that he wants to set up his forum like:

- General Discussion (Moderator: Luke Skywalker)
-- Reports: General Discussion (Moderator: Luke Skywalker)

- Talking About The Weather (Moderator: Han Solo)
-- Reports: Talking About The Weather (Moderator: Han Solo)

- Water Cooler (Moderator: Chewbacca)
-- Reports: Water Cooler (Moderator: Chewbacca)

- Things Related To Other Things (Moderator: R2D2)
-- Reports: Things Related To Other Things (Moderator: R2D2)

Basically, a function to set up a report board for each board in the forum.  Like, in the menu, have the normal drop down box for selecting the general report board, with an option to use individual board settings.  If the latter is chosen, then have an additional report board drop down on the board settings page for each individual board.
That would create a lot of boards, which is not good for a forum's health, as the SMF structure don't play very well with a lot of boards. I'll try to implement this with something else.
Title: Re: Custom report Mod
Post by: Growing2LoveSiMaFo on May 25, 2014, 05:13:29 PM
I am on version 2.0.7.  While installing I get an error trying to do a Find/Replace operation in the Display.php file, specifically

t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved, t.unapproved_posts,
t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved, t.unapproved_posts, c.solved,

At this point, I don't know if other errors will show up, but this is where it has presently errored out.

Any idea why?  TIA.
Title: Re: Custom report Mod
Post by: Joker™ on May 31, 2014, 02:42:52 PM
Quote from: Growing2LoveSiMaFo on May 25, 2014, 05:13:29 PM
I am on version 2.0.7.  While installing I get an error trying to do a Find/Replace operation in the Display.php file, specifically

t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved, t.unapproved_posts,
t.id_member_started, t.id_first_msg, t.id_last_msg, t.approved, t.unapproved_posts, c.solved,

At this point, I don't know if other errors will show up, but this is where it has presently errored out.

Any idea why?  TIA.
Can you copy paste the exact error, as it must have been shown in error logs in admin panel.
Title: Re: Custom report Mod
Post by: Skaty on September 09, 2014, 08:26:02 PM
Hi, thanks for the mod i'm still using it.  But this is bothering me for a long time. Can we add a link to the reported post? When i see the report, if i need to interfering the post i'm starting to search it, where is it? 

Maybe i did something when installation process, or this feature is missing really.
Title: Re: Custom report Mod
Post by: hcfwesker on September 09, 2014, 10:23:17 PM
When the topic/post is created in your "board targeted for reported posts" (after the reported post is sent) , it will say who reported it at the top of the message, and a link to the post (where the 'quote' link takes you to the post, and the body of the reported message in the quote box.

This isn't a MOD for the moderation center, if that's what you're referring to.

Title: Re: Custom report Mod
Post by: Skaty on September 10, 2014, 07:55:34 AM
Quote from: hcfwesker on September 09, 2014, 10:23:17 PM
When the topic/post is created in your "board targeted for reported posts" (after the reported post is sent) , it will say who reported it at the top of the message, and a link to the post (where the 'quote' link takes you to the post, and the body of the reported message in the quote box.

This isn't a MOD for the moderation center, if that's what you're referring to.

Hi Bro :)

Mine doesn't have link  :o  Can you tell me which file and which code is these so i can check and edit them.

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FAqMAKkE.png&hash=1d4e52e3c318cc2fd41783da739934dd1c497b32)
Title: Re: Custom report Mod
Post by: hcfwesker on September 10, 2014, 11:59:44 AM
Check the SMF default theme, first, and see if the feature is there.  Your custom theme you're using may just not link back to quotes or something.

And, best advice would be to uninstall then reinstall the MOD.
Title: Re: Custom report Mod
Post by: Joker™ on October 22, 2014, 12:23:28 PM
Anyone still interested in this mod, as Joker is having some nice ideas related to mod enhancement. But, I'm willing to work on them only if community is still interested in this mod :)
Title: Re: Custom report Mod
Post by: hcfwesker on October 22, 2014, 04:12:55 PM
This MOD is a must for our site, so of course I'm interested :)
Title: Re: Custom report Mod
Post by: Joker™ on October 23, 2014, 03:33:04 AM
Quote from: hcfwesker on October 22, 2014, 04:12:55 PM
This MOD is a must for our site, so of course I'm interested :)
Nice to know. So currently I'm making the following changes in to the mod

- Separate admin section for the mod, so that its easier for admins to make mod related settings
- Email to moderators when a post is reported (a long pending feature)
- 'Solved' button to be shown only to the moderators related to post, i.e moderators of the boards

Do you guys like to add something to the list?
Title: Re: Custom report Mod
Post by: hcfwesker on October 23, 2014, 07:03:39 PM
The reason we prefer this MOd over default, is because it bypasses the email send feature.  If you do add it, hopefully it can be turned off to not get reported emails.

One thing that would be great, but not sure how extensive it could be ... is for mods able to handle reports, can see in the original post that it has been reported, and a button they can click to change it to "report solved" when they handle it, so other staff know it's been handled when they view it. 
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on October 23, 2014, 07:37:17 PM
Not installed here but I'm following, exceptionally since I don't post in new topics anymore.
Title: Re: Custom report Mod
Post by: Joker™ on October 24, 2014, 09:45:06 AM
Quote from: hcfwesker on October 23, 2014, 07:03:39 PM
The reason we prefer this MOd over default, is because it bypasses the email send feature.  If you do add it, hopefully it can be turned off to not get reported emails.
Nice. Will be keeping this in mind.


Quote from: hcfwesker on October 23, 2014, 07:03:39 PM
One thing that would be great, but not sure how extensive it could be ... is for mods able to handle reports, can see in the original post that it has been reported, and a button they can click to change it to "report solved" when they handle it, so other staff know it's been handled when they view it. 
So you mean a solve button in original post itself, and to be shown to mods only?
Title: Re: Custom report Mod
Post by: Joker™ on October 24, 2014, 09:45:50 AM
Quote from: ♦ Ninja ZX-10RR ♦ on October 23, 2014, 07:37:17 PM
Not installed here but I'm following, exceptionally since I don't post in new topics anymore.
Well I make sure with the new things you'll be attracted and forced to install this mod :P
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on October 24, 2014, 12:01:37 PM
Quote from: Joker™ on October 24, 2014, 09:45:50 AM
Quote from: ♦ Ninja ZX-10RR ♦ on October 23, 2014, 07:37:17 PM
Not installed here but I'm following, exceptionally since I don't post in new topics anymore.
Well I make sure with the new things you'll be attracted and forced to install this mod :P
Go for it :D *hopes it will be compatible with the other 118 or so* :P
Title: Re: Custom report Mod
Post by: Joker™ on November 30, 2014, 01:00:38 PM
Version 2.0 released

*Version 2.0*
- PHP files converted to OOP, easy code management and readability
- A separate admin interface for easy access and maintainance
- Added option to 'Send email to moderators'
- Major fix for reporting a post after last reported post was deleted
- Table cleanup if the topic containing the report is permanently deleted
- History management with the reports that are being moved to other board
- Cleaner report content
- Handling removal of topics
- Permissions fixes through out the codebase
- Tons of fixes and enhancements
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on November 30, 2014, 03:29:28 PM
Did you actually test it? It is giving me a modification parse error in my test forum... The installation doesn't even start...
Title: Re: Custom report Mod
Post by: Joker™ on November 30, 2014, 08:49:42 PM
Quote from: ♦ Ninja ZX-10RR ♦ on November 30, 2014, 03:29:28 PM
Did you actually test it? It is giving me a modification parse error in my test forum... The installation doesn't even start...
Yup tested it a lot of times :P. There might be a conflict with some other mod, in which file are you getting the error?
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on November 30, 2014, 09:35:01 PM
For some reason 2 installer.xml show up and they both have modification parse error... Nothing else is being shown :|
The weird thing is that it doesn't install even on my test forum which is almost default... I wish it isn't the same error that I get with ForumFirewall...
Title: Re: Custom report Mod
Post by: Joker™ on December 02, 2014, 07:59:09 AM
Quote from: ♦ Ninja ZX-10RR ♦ on November 30, 2014, 09:35:01 PM
For some reason 2 installer.xml show up and they both have modification parse error... Nothing else is being shown :|
The weird thing is that it doesn't install even on my test forum which is almost default... I wish it isn't the same error that I get with ForumFirewall...
I tried with the a fresh forum and didn't came across any error.


Quote from: Joker™ on November 30, 2014, 08:49:42 PM
There might be a conflict with some other mod, in which file are you getting the error?
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 02, 2014, 12:54:15 PM
Quote from: Joker™ on December 02, 2014, 07:59:09 AM
There might be a conflict with some other mod, in which file are you getting the error?
Quote from: ♦ Ninja ZX-10RR ♦ on November 30, 2014, 09:35:01 PM
For some reason 2 installer.xml show up and they both have modification parse error... Nothing else is being shown :|
>_< unfortunately I don't have a single more information other than that. If you want I can PM you the details of my test forum and you can check it out yourself (you can also modify it, I don't mind, but you will see that there are really a few mods that are very unlikely to affect this one).
Title: Re: Custom report Mod
Post by: DSystem on December 02, 2014, 07:48:05 PM
Had the same problem of ♦ Ninja ZX-10RR ♦

Just rename the file modification.xml for Modification.xml

The problem was very simple but I lost a lot of time to figure out :)
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 02, 2014, 08:10:14 PM
??? ?! Indeed that worked :o I can't get the reason for that but... Well thanks, getting an error in the display template only now, pretty sure I can fix that on my own. Thanks a lot DSystem! Perhaps I can try this trick with the Forum Firewall mod as well...

Thanks for the help anyway Joker™, I'd suggest to investigate on this thing though XD
Title: Re: Custom report Mod
Post by: Arantor on December 02, 2014, 08:18:34 PM
Unixish systems (Linux, OS X) are case sensitive; Modification.xml and modification.xml are two quite different files there, but Windows wouldn't care.
Title: Re: Custom report Mod
Post by: Joker™ on December 02, 2014, 08:48:44 PM
Quote from: DSystem on December 02, 2014, 07:48:05 PM
Had the same problem of ♦ Ninja ZX-10RR ♦

Just rename the file modification.xml for Modification.xml

The problem was very simple but I lost a lot of time to figure out :)
Lol, Joker hides somewhere in a corner :-[

Thanks for pointing that out, will be fixing it soon.


Quote from: Arantor on December 02, 2014, 08:18:34 PM
Unixish systems (Linux, OS X) are case sensitive; Modification.xml and modification.xml are two quite different files there, but Windows wouldn't care.
I use OS X and this issue isn't reproducible on it
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 02, 2014, 09:13:24 PM
I *think* he is talking about the server O.S. since I am on Windows? I could be wrong, though.
Title: Re: Custom report Mod
Post by: Arantor on December 02, 2014, 09:22:47 PM
Well, yes, but I would presume Joker is using a MAMP server for testing, in which case I don't know why this wouldn't turn up before.

This is also why I explicitly use lower-case for all .xml files though, just to avoid this being an issue ;)
Title: Re: Custom report Mod
Post by: Joker™ on December 02, 2014, 09:26:35 PM
Mod updated

Version 2.0.1
- Mofdification xml naming fix


Well I used OS X (yosemite) and windows 7 with XAMPP, and on both OS I wasn't able to reproduce the issue. Bu now going to be more careful in the future. Thanks everyone :)
Title: Re: Custom report Mod
Post by: Arantor on December 02, 2014, 09:29:23 PM
Testing it on Windows wouldn't tell you anything; Windows doesn't care about filename case, but if you tested it on a server running OS X, I'd have thought it would complain.
Title: Re: Custom report Mod
Post by: Joker™ on December 02, 2014, 11:15:36 PM
Quote from: Arantor on December 02, 2014, 09:29:23 PM
Testing it on Windows wouldn't tell you anything; Windows doesn't care about filename case, but if you tested it on a server running OS X, I'd have thought it would complain.
Lol OS X seems to be drunk :P
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 03, 2014, 01:22:17 PM
I'm in a hurry and can't post everything but I got an "8: Undefined index: cannot_can_solve_report" in Sources/Errors.php at string 204, it prevents me to actually solve the reports from their topics.
Title: Re: Custom report Mod
Post by: Joker™ on December 04, 2014, 02:30:40 PM
Quote from: ♦ Ninja ZX-10RR ♦ on December 03, 2014, 01:22:17 PM
I'm in a hurry and can't post everything but I got an "8: Undefined index: cannot_can_solve_report" in Sources/Errors.php at string 204, it prevents me to actually solve the reports from their topics.
Will look into it by tomorrow
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 04, 2014, 02:59:23 PM
I'll be waiting :) thanks!
Title: Re: Custom report Mod
Post by: Joker™ on December 05, 2014, 05:07:56 AM
Quote from: ♦ Ninja ZX-10RR ♦ on December 04, 2014, 02:59:23 PM
I'll be waiting :) thanks!
Thanks for the report. Released a new version 2.0.2 with bug fixed :)
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 05, 2014, 07:53:13 AM
Will be trying it later today, I'll get back to you :)

And you're welcome ;)
Title: Re: Custom report Mod
Post by: Ninja ZX-10RR on December 05, 2014, 04:56:56 PM
Seems to work properly now, I have done just a little of testing though. I don't have much time but the issue that was there with the previous version seems to have gone away and I'm now able to mark reports as solved :D nice work Joker™!
I'll bump again in case I stumble into other bugs ;)
Title: Re: Custom report Mod
Post by: Joker™ on December 06, 2014, 03:02:49 AM
Quote from: ♦ Ninja ZX-10RR ♦ on December 05, 2014, 04:56:56 PM
Seems to work properly now, I have done just a little of testing though. I don't have much time but the issue that was there with the previous version seems to have gone away and I'm now able to mark reports as solved :D nice work Joker™!
I'll bump again in case I stumble into other bugs ;)
Thanks and glad that its working as expected
Title: Re: Custom report Mod
Post by: Bill Statler on April 14, 2015, 05:44:02 PM
Quote from: Joker™ on December 05, 2014, 05:07:56 AM
...Released a new version 2.0.2 with bug fixed :)

Belated thanks for updating this mod!  It will be part of our (also belated) forum software update.
Title: Re: Custom report Mod
Post by: JaGuR on June 27, 2015, 09:33:12 PM
Hi Joker,

Great Mod, and hoping you are still working on it, as I believe it is a must have for any forum.

I have one feature suggestion though if possible, adding custom icons to this mod to show topic solved and unsolved.

on SMF1 the mod I was using had a red unsolved icon and a green solved icon which made it easy for moderators to see a thread that needed actioning

I was thinking about having a go at modding this myself, but thought it best to ask you to implement it first  ;D
Title: Re: Custom report Mod
Post by: Paracelsus on July 06, 2015, 06:36:30 AM
Quote from: JaGuR on June 27, 2015, 09:33:12 PM
Hi Joker,

Great Mod, and hoping you are still working on it, as I believe it is a must have for any forum.

I have one feature suggestion though if possible, adding custom icons to this mod to show topic solved and unsolved.

on SMF1 the mod I was using had a red unsolved icon and a green solved icon which made it easy for moderators to see a thread that needed actioning

I was thinking about having a go at modding this myself, but thought it best to ask you to implement it first  ;D

Thinking about the same thing... in the topic/post icon it should be possible to have an icon for unsolved topics and another one once you click solved.

Maybe it's possible to modify it in CustomReportCore.php in Sources, not sure...
Title: Re: Custom report Mod
Post by: JaGuR on July 06, 2015, 07:53:31 PM
I have been successful in adding a new unsolved icon when first reporting the post and it showing up as a new post.

But the problem is in clicking on solve /  unsolve the reported post, it creates a completely new post below the reported post and the solved icon gets added to that instead of just toggling the icon between solved and unsolved on the reported post that the solve and unsolve relates to, this has nothing to do with the icon that you see in the boards index and recent topics board as it displays the icon from the first post, not subsequent posts.

Thinking I might just add my own code to toggle the icon that is stored in the database by passing the mod all together but keep the report to mod part :/
Title: Re: Custom report Mod
Post by: Paracelsus on July 10, 2015, 06:37:39 PM
Quote from: JaGuR on July 06, 2015, 07:53:31 PM
I have been successful in adding a new unsolved icon when first reporting the post and it showing up as a new post.

How did you do that?
Title: Re: Custom report Mod
Post by: ms_ukyankee on December 13, 2015, 07:05:50 PM
I've made some changes to use solved/unsolved icons and not lock the topics, someone else might find useful.

In /Sources/CustomReport/CustomReportCore.php find:

public function reportSolved($topicId) {
global $txt, $board_info, $user_info, $modSettings;

$result = $this->dbInstance->checkIsTopicSolved($topicId);
if(empty($result['solved'])) {
$subject = '[' .$txt['cr_report_solved'] . ']'. ' ' . $result['subject'];
$body = $txt['cr_report_solved'] . ' ' . $txt['by'] . ' ' . '\''. $user_info['name'] . '\'';

$msgOptions = array(
'subject' => $subject,
'body' => $body,
);
$topicOptions = array(
'id' => $topicId,
'board' => $modSettings['cr_report_board'],
'lock_mode' => 1,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $user_info['id'],
'update_post_count' => !empty($modSettings['cr_enable_report_mod_count']) && $board_info['posts_count'],
);
createPost($msgOptions, $topicOptions, $posterOptions);
} else {
$this->dbInstance->unlockTopic($topicId);
}

$isSolved = empty($result['solved']) ? 1 : 0;
$this->dbInstance->setSolveStatus(array(
'isSolved' => $isSolved,
'topicId' => $topicId
));


Changed to:

public function reportSolved($topicId) {
global $txt, $board_info, $user_info, $modSettings, $smcFunc;

$result = $this->dbInstance->checkIsTopicSolved($topicId);
if(empty($result['solved'])) {
$subject = '[' .$txt['cr_report_solved'] . ']'. ' ' . $result['subject'];
$body = $txt['cr_report_solved'] . ' ' . $txt['by'] . ' ' . '\''. $user_info['name'] . '\'';

$msgOptions = array(
'subject' => $subject,
'body' => $body,
                                'icon' => 'solved',
);
$topicOptions = array(
'id' => $topicId,
'board' => $modSettings['cr_report_board'],
'lock_mode' => 0,
'mark_as_read' => true,
);
$posterOptions = array(
'id' => $user_info['id'],
'update_post_count' => !empty($modSettings['cr_enable_report_mod_count']) && $board_info['posts_count'],
);
                createPost($msgOptions, $topicOptions, $posterOptions);
   
} else {
$this->dbInstance->unlockTopic($topicId);
}

$isSolved = empty($result['solved']) ? 1 : 0;
$this->dbInstance->setSolveStatus(array(
'isSolved' => $isSolved,
'topicId' => $topicId
));

    if ($isSolved == 1) $seticon = 'solved';
    else $seticon = 'unsolved';

    // update icon on first post
   
    $smcFunc['db_query']('', '
      UPDATE {db_prefix}messages
      SET icon = {string:icon}
      WHERE id_msg = {int:id_msg}',
      array(
        'id_msg' => $result['id_first_msg'],
        'icon' => $seticon,
      )
    );
   
// Back to the post we reported!
redirectexit('topic=' . $topicId . '.0');
}


And find:

private function createReport() {
global $modSettings, $user_info, $board_info;

// set up all options
$msgOptions = array(
'id' => 0,
'subject' => $this->post_data['subject'],
'body' => $this->post_data['body'],
'icon' => 'xx',
'smileys_enabled' => true,
'attachments' => array(),
'approved' => true,
);


Change 'icon':

private function createReport() {
global $modSettings, $user_info, $board_info;

// set up all options
$msgOptions = array(
'id' => 0,
'subject' => $this->post_data['subject'],
'body' => $this->post_data['body'],
'icon' => 'unsolved',
'smileys_enabled' => true,
'attachments' => array(),
'approved' => true,
);


You need to have solved.gif and unsolved.gif in the default theme folder Themes/default/images/post/. I had them from the 1.x version of a similar mod.

Thanks Joker for a great mod!
Title: Re: Custom report Mod
Post by: ms_ukyankee on December 14, 2015, 02:27:53 PM
Following on from post above with unsolved icon, to change the board topic index to sort by unsolved topics, find in /Sources/MessageIndex.php (around line 390):


ORDER BY ' . ($pre_query ? 'FIND_IN_SET(t.id_topic, {string:find_set_topics})' : (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . '
LIMIT ' . ($pre_query ? '' : '{int:start}, ') . '{int:maxindex}',


Change to:

ORDER BY ' . ($pre_query ? 'FIND_IN_SET(t.id_topic, {string:find_set_topics})' : (!empty($modSettings['enableStickyTopics']) ? 'is_sticky' . ($fake_ascending ? '' : ' DESC') . ', ' : '') . (!empty($modSettings['cr_report_board']) && $board == $modSettings['cr_report_board'] ? "mf.icon = 'unsolved'" . ($fake_ascending ? '' : ' DESC') . ', ' : '') . $_REQUEST['sort'] . ($ascending ? '' : ' DESC')) . '
LIMIT ' . ($pre_query ? '' : '{int:start}, ') . '{int:maxindex}',
Title: Re: Custom report Mod
Post by: JaGuR on February 01, 2016, 05:52:07 PM
Good man, greatly appreciated :)

Now all that is stopping me from upgrading to SMF 2 from SMF 1 is being able to hide posts from members, as opposed to deleting them completely  ;D
Title: Re: Custom Report Mod
Post by: d3vcho on August 04, 2018, 10:08:38 AM
Version 2.0.3

- Fixed couple of bugs that caused the mod not to work

Please leave your feedback.
Title: Re: Custom Report Mod
Post by: d3vcho on October 06, 2018, 06:37:17 AM
Version 2.0.4

- Adds russian translation (by realdigger)
Title: Re: Custom Report Mod
Post by: shadav on June 08, 2020, 11:28:48 PM
I know this is an old thread, but noticed there was an update to the mod.....
but.....
the download ins't an installer, nor any install instructions that I can find...just files and folders
am I suppoed to just upload the the files and folders and then run installer/install.php and installhooks.php what about template edits?

[edit] unzipped, took all the items out of the folder (leaving subfolders alone) then rezipped it, the install recognizes it now
Title: Re: Custom Report Mod
Post by: Kindred on June 09, 2020, 01:11:01 AM
It is supposed to be installed using the package manager, but it looks like the author  forgot the XML file when he uploaded the new version
Title: Re: Custom Report Mod
Post by: 1.1Nerd on August 25, 2020, 05:41:55 PM
The mod file unfortunately seems to be broken / corrupt. WOuld be nice if somebody could please update the file with a working one. Thank you
Title: Re: Custom Report Mod
Post by: shadav on August 25, 2020, 07:14:09 PM
Quote from: 1.1Nerd on August 25, 2020, 05:41:55 PM
The mod file unfortunately seems to be broken / corrupt. WOuld be nice if somebody could please update the file with a working one. Thank you

;) read 2 posts up
Quote from: shadav on June 08, 2020, 11:28:48 PM
I know this is an old thread, but noticed there was an update to the mod.....
but.....
the download ins't an installer, nor any install instructions that I can find...just files and folders
am I suppoed to just upload the the files and folders and then run installer/install.php and installhooks.php what about template edits?

[edit] unzipped, took all the items out of the folder (leaving subfolders alone) then rezipped it, the install recognizes it now
Title: Re: Custom Report Mod
Post by: d3vcho on August 26, 2020, 03:03:54 AM
It's been solved now. That was totally my fault.

Sorry for the inconvenients!
Title: Re: Custom Report Mod
Post by: 1.1Nerd on August 26, 2020, 07:51:36 AM
Thank you!
Title: Re: Custom Report Mod
Post by: user58389239 on May 11, 2023, 11:08:40 AM
Any plans to upgrade this mod for 2.1? Or, does anyone know of another mod that does the same thing? I'm looking for something that puts the "reported posts" into a particular board.
Title: Re: Custom Report Mod
Post by: Kindred on May 14, 2023, 08:14:02 PM
This already works on 2.1 afaik
Title: Re: Custom Report Mod
Post by: user58389239 on June 02, 2023, 06:48:37 PM
It does not work in 2.1. It's fine though, we're adjusting without it and just using the built-in mod functionality.
Title: Re: Custom Report Mod
Post by: user58389239 on September 25, 2023, 11:17:34 AM
Do the devs have any guidance on what sorts of changes would need to be made to this Mod to update for compatibility with SMF v2.1? I was thinking about trying to engage a developer to work on this...curious if you have any guidance.