MyBB Community Forums

Full Version: Stop users reporting admin staff
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
For some reason people report posts made by he admins staff on my site, Some because they didnt like what was said, others for the weirdest of reasons.

Just strikes me as a bit silly that people can report a sites admin to the sites admin so is there a way to stop this?
Open report.php, around line 33
Find
if(!$post['pid'])
{
	$error = $lang->error_invalidpost;
	eval("\$report_error = \"".$templates->get("report_error")."\";");
	output_page($report_error);
	exit;
}
Replace with
if(!$post['pid'])
{
	$error = $lang->error_invalidpost;
	eval("\$report_error = \"".$templates->get("report_error")."\";");
	output_page($report_error);
	exit;
}
if($post['uid'])
{	
    $query = $db->simple_select("users", "usergroup", "uid = '".$post['uid']."'");
	while($user = $db->fetch_array($query))
	{
		$usergroup = $cache->read("usergroups");
		if($usergroup[$user['usergroup']]['showforumteam'] == "1")
		{
			$error = "You can't report a team member's post.";
			eval("\$report_error = \"".$templates->get("report_error")."\";");
			output_page($report_error);
			exit;
		}
	}
}
Not tested.
Tested and works.
You can also import this patch for the Patches plugin: [attachment=28181]
Crikey Jordan - is that not going to cause a query per post on showthread?

This might be a task for template conditionals http://mybbhacks.zingaburga.com/showthread.php?tid=260

something like the below in postbit

<if !in_array($post['usergroup'], array (3,4)) then> {$post['button_report']}</if>

Not tested.

Tested and works.
It should only be a query per report.php page opening when pid has been specifyed. Is there a $post['usergroup'] variable?
Yup - see my code for using template conditionals. Also very handy for css per usergroup.
Mine basically does the same as yours now. Except it checks if the user who posted's group is part of the forum team. Yours only displays the button if the poster is not an administrator or a moderator, without any queries.
By adding more group numbers to the array you can trim it down to whatever groups are part of forum team. I must admit, I use template conditionals a lot, so I rarely use plugins for showing and hiding - just that one plugin.

In fact - if I could have only ONE plugin - it might be that one....
You could never have one plugin. You always need XThreads. So if you were using template conditionals then you would have to count the number of plugins as two because XThreads is hiding at the base of the list. Toungue
(2012-12-31, 05:41 PM)JordanMussi Wrote: [ -> ]You could never have one plugin. You always need XThreads. So if you were using template conditionals then you would have to count the number of plugins as two because XThreads is hiding at the base of the list. Toungue

Nope, I can live without XThreads more than I can live without template conditionals. Honest. Really. I can do this......

* Leefish wails and clings onto xThreads
* JordanMussi wonders if Leefish will make her own MyBB package that has xThreads included but without the plugin file.
* JordanMussi wonders if this is possible.
* JordanMussi thinks if it is can a fish do it? Toungue
Pages: 1 2 3