Calling unapprove_posts function in plugin

What would be the best approach to using the unapprove_posts function within a plugin that is hooked to the post datahandler?

I want a post to be unapproved immediately upon being posted.
Need web hosting? Try MyBBWebHost!
#1 for Running MyBB Communities
The world's only premium web host dedicated to MyBB forums.

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
			// Moderated post

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


Code is incomplete, hope it to be enough Smile

Forum Jump:

Users browsing this thread: 1 Guest(s)