Calling unapprove_posts function in plugin
#2
You will need to hook at newreply_do_newreply_end and initialize the moderation class and make sure to check if the post is visible.
function foo()
{
	global $postinfo, $url, $lang;

	if($postinfo['visible'] == -2)
	{
		// Draft post
	}
	elseif($postinfo['visible'] == 1)
	{
			// Visible post
	}
	else
	{
			// Moderated post
	}

	require_once MYBB_ROOT.'inc/class_moderation.php';
	$moderation = new Moderation;

	$moderation->unapprove_posts($postinfo['pid']);
}

Code is incomplete, hope it to be enough Smile
Reply


Messages In This Thread
RE: Calling unapprove_posts function in plugin - by Omar G. - 2013-01-13, 05:35 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)