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.
Code is incomplete, hope it to be enough
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
