Warning: The author of this contribution does not provide support for it anymore.

User Blog Mod

User no report self or admin/founder edits here. - User Blog Mod

User no report self or admin/founder edits here.

by PiperB » Sun Jul 16, 2017 9:19 am

-----------------------

As it sits with this mod installed user's and admins can report their own blog entries and comments, as well as everyone else including admins and founders. Any user CAN report their self or anyone else in other words. It should not have been like this in my opinion, though otherwise this blog mod is excellent and I am not knocking it, just saying that users should not be able to report themselves or admins and founders. They should only be able to report other users entries and comments.

Here is my fix for this.
Note: With my fix users will no longer have the option to report themselves, and also not any user id number specified in the additional part specified. Will explain how to add more users below. The way it is now it's set to not allow reporting one's own self or the founder admin. You can change that number to any member you like that you don't want to allow members to report.

Open: /blog/includes/blog_data.php

Find:

Code: Select all

		    'U_REPORT'				=> (check_blog_permissions('blog', 'report', true, $id)) ? blog_url(false, $id, false, array('page' => 'blog', 'mode' => 'report')) : '',
Replace with:

Code: Select all

			'U_REPORT'				=> (check_blog_permissions('blog', 'report', true, $id) && $user_id != $user->data['user_id'] && $user_id != ANONYMOUS && $user_id != 2) ? blog_url(false, $id, false, array('page' => 'blog', 'mode' => 'report')) : '',


Find:

Code: Select all

		    'U_REPORT'				=> (check_blog_permissions('reply', 'report', true, $blog_id, $id)) ? blog_url(false, false, $id, array('page' => 'reply', 'mode' => 'report')) : '',
Replace with:

Code: Select all

		    'U_REPORT'				=> (check_blog_permissions('reply', 'report', true, $blog_id, $id) && $user_id != $user->data['user_id'] && $user_id != ANONYMOUS && $user_id != 2) ? blog_url(false, false, $id, array('page' => 'reply', 'mode' => 'report')) : '',


Save the file. Clear your cache.

Now where the number is in the replacements for both finds in the code where it says
&& $user_id != 2
That is the number of the first founder admin ID on most boards, but if your's is different, then change the number 2 to your founder admin's number. If you just want to do this for founders then you can use && $user_id != FOUNDER

I recommend leaving the fix this way, so that if you have additional admins posting stuff that should be reported, then users can still report them....but that is only a recommendation based on my feelings and opinions, you must of course always use your best judgement for what is best for your own board.

However, if you wish to disallow users from reporting additional founders, admins, mods, or other users and e.c.t. then you would just add an additional bit for each member along with their number as so inline directly after the line of code I told you to put your founder admin id number.
&& $user_id != 2 && $user_id != USER ID NUMER HERE

So in this example where it says "USER ID NUMBER HERE" you would just remove that line of text marking notation and add the number of the next user id you want to not allow users to report. I hope that was clear enough for those who really needed the explanation.

So an additional....
&& $user_id != USER ID NUMER HERE
....after the next with no commas between, only the && and replace the number with user id of the users you wish to make immune to reportings done on them.

Again you would do this for both of the replacements, one controls the blog post reporting and the other controls the comments reporting for the comments made on blog posts.

Enjoy! ;)

__________________________________
Disclaimer: I decided to share my edits, fixes, addons, companion mods, e.t.c. for "wiki" type purposes and for those out there like me who are on older versions of phpbb3 still. Also for those who still have or wanted this mod to have a new feature or a fix this is for you! :)
<!-- IF U_LOVE_NOTEPAD++ -->
[td class=statement]I Notepad++ ![/td]
<!-- ENDNEVER --> <!-- tee hee --> :P
Whoa ooo whoa ooo whoa I'm a Lady!
User avatar
PiperB
Registered User
Posts: 173
Joined: Mon Nov 07, 2016 6:54 pm
Contact: