MyBB Community Forums

Full Version: remove report button on your own posts
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently users on our forum report their own posts for various reasons. But i would like to remove the report button if its your own post.
Currently there is a PR awaiting for even enhanced appearance of the report button which likely to be included in 1.8.22.
I am referring that to give you a future-proof solution:
https://github.com/mybb/mybb/pull/3701/files

In that PR, $skip_report array is used for determination. You can insert user ID in that array for the thing you wanna accomplish.
https://github.com/mybb/mybb/pull/3701/f...30deacR691 << Here, insert:

$skip_report[] = $mybb->user['uid'];
So if i modified the files to this commit change, then that would remove the report button? That is a lot of files to manually edit if it breaks and i need to back out of it. Im also using mybb 1.8.7 still so im not sure if things would be applicable. An upgrade is out of the question.
Open inc/functions_post.php
Goto line number ~682, find if($mybb->user['uid'] != "0") and replace with if(!in_array($mybb->user['uid'], array(0, $post['uid])))

(I am not sure what exact code you have there since there were some changes after the version you are using ...
awesome thanks!!!!

for completion forgot the ending quote in uid
        //if($mybb->user['uid'] != "0")
        if(!in_array($mybb->user['uid'], array(0, $post['uid'])))
        {
            eval("\$post['button_report'] = \"".$templates->get("postbit_report")."\";");
        }