MyBB Community Forums

Full Version: Need help with editud to check for group.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
labrocca Wrote:Yes I have tried that...it displays the logged in users YES or NO. I am testing with 2 browsers...on one I am logged in as a moderator and the others as a normal user.

$uid needs to be $post['edituid']

Now I know that the functions pulls $post['edituid'] BUT...I don't know if the $post['edituid'] is being pushed or used properly in the is_moderator() function.

I am trying to rebuild the is_moderator() function directly in the plugin and attemting to simply use $post['edituid'] instead of $uid. So far now luck.

You had $uid = $post['edituid']; in your code, so technically, it was correct. rebuilding the is_moderator function won't help. It works right.

As a guest, I am not able to see the mod tag parsed, so it seems to be working?
No it's not working right...however I got it fixed. I will post the code shortly after all is cleaned up. What I had to do was create a function that simply pulled the usergoup using the edituid to search the uid.  Then I had it check to see if that is in array group 3,4, or 6.  

It will do.  After I release if you think you can improve it by using the is_moderator go ahead. I just spend like 6 hours trying just to get that to work and no good.

Thanks for the help though you actually did get me on the right track.

here is my new function btw.

function is_moderator2($euid){

	global $mybb, $post, $fid, $euid, $db;

		$query = $db->query("SELECT usergroup FROM ".TABLE_PREFIX."users WHERE uid=" .$euid ."");
		$usergroup = $db->fetch_field($query, "usergroup");

	return $usergroup;
}

note: If you just checked the site in the past 5 minutes you may have seen it after I fixed it up.
Pages: 1 2