MyBB Hacks

Full Version: [Edit] Specific forum banning.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
http://mods.mybb.com/view/specific-forum...http://mods.mybb.com/view/specific-forum-banning-desig

Could somebody edit this plugin in some way that moderators can only select forums where they have permission to moderate?

The plugin currenly allows moderators to ban users from specific forums, but I want the plugin to allow moderators to ban users from specific forums where they are moderators in.
Try to replace:

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator() != true)

with:

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator($post['fid']) != true)


Not tested.

(12-03-2011 02:47 AM)TriTop Wrote: [ -> ]Try to replace:

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator() != true)

with:

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator($post['fid']) != true)


Not tested.


Didn't worked Erf

Maybe it has something with this?:

PHP Code:
$forum_select = build_forum_jump("", $fid, 1, '', 0, '', "fid");


and:

PHP Code:
$forum_select = build_forum_jump("", $mybb->input['fid'], 1, '', 0, '', "fid");


Tried without any luck..

Ok. This works. Replace:

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator() != true)
	{
		return;
	}

with:

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator($mybb->input['fid']) != true)
	{
		error('Sorry, you have no permission to ban here!');
	}

Yes id does work Yipi, thanks TriTop!!!
This does not work for me. When i do this, i get a "Sorry you have no permission to ban here!" message on every page in the modCP.
Oh me too :/ It was all right at the first time..
My 30 second guess would be to use this replacement instead

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator($mybb->input['fid']) != true)

(01-09-2012 08:59 PM)ZiNgA BuRgA Wrote: [ -> ]My 30 second guess would be to use this replacement instead

PHP Code:
if($mybb->input['action'] != "specificbanuser" || is_moderator($mybb->input['fid']) != true)


Using just that part of the edit, you may say it works better, as it now allows us use the modcp, but it shows a blank page if mods choose a forum where they have not permission to ban.
Get someone else to write a proper fix for it then.
Pages: 1 2
Reference URL's