BirdOPrey5
03-20-2014, 11:35 AM
It seems the default behavior on VB4 is not to email a blog owner when a moderated comment has been posted. An admin on vbulletin.com was asking for some way to email blog owners to let them know a comment is awaiting moderation.
This quick plugin will do that.
Go to Admin CP -> Plugins & Products -> Add new Plugin
Product: vBulletin
Hook Location: blog_post_updatecomment_complete
Title: Send Mail When Moderated Comment
Execution Order: 5
PHP Code:
if (($bloginfo['moderatecomments'] OR $vbulletin->options['blog_commentmoderation'] OR !($vbulletin->userinfo['permissions']['vbblog_comment_permissions'] & $vbulletin->bf_ugp_vbblog_comment_permissions['blog_followcommentmoderation'])) AND !can_moderate_blog('canmoderatecomments') AND $bloginfo['userid'] != $vbulletin->userinfo['userid'])
{
if ($vbulletin->options['vbblog_url'])
{
$bce_url = $vbulletin->options['vbblog_url'];
}
else
{
$bce_url = $vbulletin->options['bburl'];
}
$bce_url .= '/entry.php/' . $bloginfo['blogid'];
$bce_subject = 'A moderated comment has been posted to your blog';
$bce_messgae = "A moderated comment was posted to your blog: {$bloginfo[title]}\r\n\r\nLink to Blog: $bce_url";
vbmail($bloginfo['email'], $bce_subject, $bce_messgae, true);
}
Set Active to YES and save.
As always test and make sure it is working and you have not broken your comment posting. If something isn't working simply set active to No and check your work.
I've tested this on VB 4.2.2 Patch 1 and it appears to be working. It will email the blog owner when a moderated comment is posted.
I've kept this very simple, anyone interested could add more options , details, or use phrases rather than hard coded text.
This quick plugin will do that.
Go to Admin CP -> Plugins & Products -> Add new Plugin
Product: vBulletin
Hook Location: blog_post_updatecomment_complete
Title: Send Mail When Moderated Comment
Execution Order: 5
PHP Code:
if (($bloginfo['moderatecomments'] OR $vbulletin->options['blog_commentmoderation'] OR !($vbulletin->userinfo['permissions']['vbblog_comment_permissions'] & $vbulletin->bf_ugp_vbblog_comment_permissions['blog_followcommentmoderation'])) AND !can_moderate_blog('canmoderatecomments') AND $bloginfo['userid'] != $vbulletin->userinfo['userid'])
{
if ($vbulletin->options['vbblog_url'])
{
$bce_url = $vbulletin->options['vbblog_url'];
}
else
{
$bce_url = $vbulletin->options['bburl'];
}
$bce_url .= '/entry.php/' . $bloginfo['blogid'];
$bce_subject = 'A moderated comment has been posted to your blog';
$bce_messgae = "A moderated comment was posted to your blog: {$bloginfo[title]}\r\n\r\nLink to Blog: $bce_url";
vbmail($bloginfo['email'], $bce_subject, $bce_messgae, true);
}
Set Active to YES and save.
As always test and make sure it is working and you have not broken your comment posting. If something isn't working simply set active to No and check your work.
I've tested this on VB 4.2.2 Patch 1 and it appears to be working. It will email the blog owner when a moderated comment is posted.
I've kept this very simple, anyone interested could add more options , details, or use phrases rather than hard coded text.