MyBB Community Forums

Full Version: Blocking members from seeing Moderator Notes/Reports
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Some members have been made mods on certain forums of the board. But they're not global Mods, how do I block them from viewing the global mod notes?
Which "notes" are you refering to?
DennisTT Wrote:Which "notes" are you refering to?

When someone reports a post, there's something that appears near under the banner saying "Moderator Note".

It's becoming annoying since these members take it upon themselves to deal with the issue and soon PM me saying I mind as well make them a full Mod.
Do you mean this notice? "Moderator Notice: There is 1 unread reported post."
Oh yup
I wrote a code snippet that shows only moderator reports on their own forums, if you want that?
That would be wonderful, please do Smile
In global.php find:

// Read the reported posts cache
$reported = $cache->read("reportedposts");

Add after

if($mybb->usergroup['cancp'] != "yes" && $mybb->usergroup['issupermod'] != "yes" && $mybb->user['usergroup'] == 6)
	{
		$query = $db->simple_select(TABLE_PREFIX."moderators", "fid", "uid='{$mybb->user['uid']}'");
		while($fid = $db->fetch_array($query))
		{
			$modfids[] = $fid['fid'];
		}
		
		if(!empty($modfids))
		{			
			$query = $db->simple_select(TABLE_PREFIX."reportedposts", "COUNT(rid) as unread", "reportstatus = '0' AND fid IN (".implode(',', $modfids).")");
			$reported['unread'] = $db->fetch_field($query, "unread");
		}
		else
		{
			$reported['unread'] = 0;
		}
	}

In moderation.php find:

		$multipage = multipage($postcount, $perpage, $page, "moderation.php?action=reports");
		if($postcount > $perpage)
		{
			eval("\$reportspages = \"".$templates->get("moderation_reports_multipage")."\";");
		}

		$query = $db->simple_select(TABLE_PREFIX."forums", "fid,name");
		while($forum = $db->fetch_array($query))
		{
			$forums[$forum['fid']] = $forum['name'];
		}

add after:

		$fids = "";
		if($mybb->usergroup['cancp'] != "yes" && $mybb->usergroup['issupermod'] != "yes" && $mybb->user['usergroup'] == 6)
		{
			$query = $db->simple_select(TABLE_PREFIX."moderators", "fid", "uid='{$mybb->user['uid']}'");
			while($fid = $db->fetch_array($query))
			{
				$modfids[] = $fid['fid'];
			}
			
			if(!empty($modfids))
			{
				$fids = "AND r.fid IN (".implode(',', $modfids).")";
			}
		}

Also in moderation.php find:

		$query = $db->query("
			SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
			FROM ".TABLE_PREFIX."reportedposts r
			LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid)
			LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
			LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
			LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
			WHERE r.reportstatus ='0'
			ORDER BY r.dateline ASC
			LIMIT $start, $perpage
		");

replace with

		$query = $db->query("
			SELECT r.*, u.username, up.username AS postusername, up.uid AS postuid, t.subject AS threadsubject
			FROM ".TABLE_PREFIX."reportedposts r
			LEFT JOIN ".TABLE_PREFIX."posts p ON (r.pid=p.pid)
			LEFT JOIN ".TABLE_PREFIX."threads t ON (p.tid=t.tid)
			LEFT JOIN ".TABLE_PREFIX."users u ON (r.uid=u.uid)
			LEFT JOIN ".TABLE_PREFIX."users up ON (p.uid=up.uid)
			WHERE r.reportstatus ='0' {$fids}
			ORDER BY r.dateline ASC
			LIMIT $start, $perpage
		");
Thanks, but it doesn't seem to work - members still seem to be able to see all Moderator Notices.
Sorry, but it works fine for me