2011-08-30, 09:51 AM
Alright, I will show you a quick fix so that Forum Moderators see ONLY their forum reports.
Part 1
Only show our forum reports.
First change you will want is in modcp.php at root.
Search for the following, it should be around line 104.
Once you are there, scroll down until you see the following:
This is what we are altering. We will be adding an 'else' statement after this. Now the above should look like:
--
Part 2
Adjust global unreadreports message.
Now we will need to edit global.php at root. We need to only display how many reports are in your section.
So open up global.php and look for the following:
There should only be one instance.
Alright, now that you are at the mark, we need to change the following:
to..
The difference with this, is that it checks if the user is an Admin or Super Moderator first, and handle the reports notice as normal.
However, if the person is a normal mod, it will continue to the next part of the script, the 'else' statement.
The else statement grabs the number of reports from the reportedposts table (using simple_select only taking the columns 'reportstatus' and 'fid') and checks to see if the user is the moderator of that forum area. It then displays the results as normal.
--
Well guys, that is pretty much it, please leave some feedback and criticism
Part 1
Only show our forum reports.
First change you will want is in modcp.php at root.
Search for the following, it should be around line 104.
if($mybb->input['action'] == "reports")
Once you are there, scroll down until you see the following:
$trow = alt_trow();
if(is_moderator($report['fid']))
{
$trow = 'trow_shaded';
}
This is what we are altering. We will be adding an 'else' statement after this. Now the above should look like:
$trow = alt_trow();
if(is_moderator($report['fid']))
{
$trow = 'trow_shaded';
}
else {
continue;
}
--
Part 2
Adjust global unreadreports message.
Now we will need to edit global.php at root. We need to only display how many reports are in your section.
So open up global.php and look for the following:
$unreadreports = '';
There should only be one instance.
Alright, now that you are at the mark, we need to change the following:
$unreadreports = '';
// This user is a moderator, super moderator or administrator
if($mybb->usergroup['cancp'] == 1 || $mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'])
{
// Read the reported posts cache
$reported = $cache->read("reportedposts");
// 0 or more reported posts currently exist
if($reported['unread'] > 0)
{
if($reported['unread'] == 1)
{
$lang->unread_reports = $lang->unread_report;
}
else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, $reported['unread']);
}
eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");
}
}
to..
$unreadreports = '';
// This user is a moderator, super moderator or administrator
if($mybb->usergroup['cancp'] == 1 || $mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'])
{
if($mybb->usergroup['cancp'] || $mybb->usergroup['issupermod'])
{
// Read the reported posts cache
$reported = $cache->read("reportedposts");
// 0 or more reported posts currently exist
if($reported['unread'] > 0)
{
if($reported['unread'] == 1)
{
$lang->unread_reports = $lang->unread_report;
}
else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, $reported['unread']);
}
eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");
}
}
else {
$query = $db->simple_select("reportedposts", "reportstatus,fid", "reportstatus='0'");
$reportsleft = 0;
while($report = $db->fetch_array($query))
{
if(is_moderator($report['fid']))
{
$reportsleft +=1;
}
}
// 0 or more reported posts currently exist
if($reportsleft > 0)
{
if($reportsleft == 1)
{
$lang->unread_reports = $lang->unread_report;
}
else
{
$lang->unread_reports = $lang->sprintf($lang->unread_reports, $reportsleft);
}
eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");
}
}
}
The difference with this, is that it checks if the user is an Admin or Super Moderator first, and handle the reports notice as normal.
However, if the person is a normal mod, it will continue to the next part of the script, the 'else' statement.
The else statement grabs the number of reports from the reportedposts table (using simple_select only taking the columns 'reportstatus' and 'fid') and checks to see if the user is the moderator of that forum area. It then displays the results as normal.
--
Well guys, that is pretty much it, please leave some feedback and criticism