Email Notification for Moderation Queue

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Anti-Spam Guide
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Airdrie, UK (127.0.0.1)
Name: Kenny Cameron
Contact:

Re: Email Notification for Moderation Queue

Post by stickerboy » Fri Dec 05, 2008 11:58 am

I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || BandCamp || phpBB Snippets ||
Formerly known as cherokee red

User avatar
eblom00
Registered User
Posts: 36
Joined: Sat May 21, 2005 5:24 pm
Contact:

Re: Email Notification for Moderation Queue

Post by eblom00 » Mon Feb 16, 2009 2:31 am

It probably isn't a standard feature because if you get a spambot attack sending thousands of messages to a moderated forum.. you're going to get thousands of emails at once..
I don't understand this statement. Would you also get a flood of emails if a spam bot started posting and emails started being sent out to every user who was watching that forum? In the watch forum case I think the mail bomb does not happen because a user only gets an email the first time a new topic is created after they have a valid session. The same could be done with emailing moderators on posts waiting for them. This way just one email is sent even if there is a spam attach.

I have no php skills else I would write this myself. I agree with other's comments that this seems like a much needed feature. I'd call this feature push moderator notifications. Currently phpBB3 uses a pull notification system because a moderator has to login to be notified. Where as with email to SMS gateways, push email, and Blackberries a simple email on the first moderator activity since the last log in would go a long way to shortening the moderators response time.

Just my $0.02.

Eric

T77HAS
Registered User
Posts: 4
Joined: Tue Apr 28, 2009 10:06 am

Re: Email Notification for Moderation Queue

Post by T77HAS » Thu Apr 30, 2009 2:31 pm

Is there a fix for version 3?

kbriggs
Registered User
Posts: 3
Joined: Sat May 30, 2009 6:29 pm

Re: Email Notification for Moderation Queue

Post by kbriggs » Sat May 30, 2009 6:38 pm

A year later and still no solution? This is a huge missing feature. Am I supposed to login to my forum every 5 minutes just to see if a new user posted his first message so I can approve it? That's ridiculous, I should have the option of getting an email notification. I had to implement first post moderation to stop the spammers. Now I'm going to forget to look and will probably have messages queued up for days. Yeah, that'll look like great support on my part. :cry:

nick-b
Registered User
Posts: 4
Joined: Fri May 09, 2008 12:26 am

Re: Email Notification for Moderation Queue

Post by nick-b » Sun May 31, 2009 7:55 am

Well, join the club... Many of us are still waiting for a good solution to this forgotten feature. I wish I could write the mod myself. Don't get me wrong... I realize that phpBB is free, and the support is great to have... I just don't understand why some ambitious coder/programmer hasn't tackled this yet.
- Nick-b -

User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan
Contact:

Re: Email Notification for Moderation Queue

Post by muggins » Mon Jun 01, 2009 2:54 pm

Have a look at this mod and see if it suits your needs.
Muggins

nick-b
Registered User
Posts: 4
Joined: Fri May 09, 2008 12:26 am

Re: Email Notification for Moderation Queue

Post by nick-b » Mon Jun 01, 2009 5:42 pm

After careful review of the related pages, this looks PERFECT! I'll let you know how it turns out! :-)
- Nick-b -

User avatar
muggins
Registered User
Posts: 1183
Joined: Fri Feb 22, 2008 5:12 pm
Location: Texas
Name: Donovan
Contact:

Re: Email Notification for Moderation Queue

Post by muggins » Mon Jun 01, 2009 8:21 pm

Please do! You can test it for me before I install it. :lol:
Muggins

Slartey
Registered User
Posts: 2
Joined: Mon Oct 05, 2009 8:36 pm

Re: Email Notification for Moderation Queue

Post by Slartey » Mon Oct 12, 2009 6:49 pm

Well? Did that mod work? I am going to assume that since there was no feedback, that it solved the problem.

Simon

mtrs
Registered User
Posts: 2049
Joined: Sat Sep 22, 2007 2:39 pm

Re: Email Notification for Moderation Queue

Post by mtrs » Mon Oct 12, 2009 7:18 pm

This mod sends unapproved post e-mail notification (containg the the post).
I abandoned all of my mods.

User avatar
eblom00
Registered User
Posts: 36
Joined: Sat May 21, 2005 5:24 pm
Contact:

Re: Email Notification for Moderation Queue

Post by eblom00 » Sun Nov 08, 2009 6:35 pm

I've been using the Perl script below to keep tabs on my reported posts and posts waiting approval. What I like about this script is that I've set it up to send me an SMS message, so, I don't have to check my email through out the day. I've also put the URL to the Moderator Control Panel in the SMS so all I have to do is tap on the URL in the text message (SMS) on my phone to access the MCP.

I've set this script up to run as an hourly cron job.

Cheers,
Eric


Perl Script

Code: Select all

#!/usr/bin/perl

use DBI;
use POSIX;

# The next three lines are the only ones you should need to change. 
$database_name = ""; # your database name, the same one phpBB uses
$database_username = ""; # your database username, the same one phpbB uses
$database_password = ""; # your data base password, the same one phpBB uses
$forum_address = ""; # http://www.example.com/forums
$email = ""; # email address you want notifications to go to
$sms_email = ""; # sms email address for your cell phone

$post_approval_count = 0;
$post_report_count = 0;

open FILE, ">", "check_moderator_queue.tmp" or die $!;

# No changes below this line.
$database_name = "dbi:mysql:".$database_name;
$dbh = DBI->connect($database_name,$database_username,$database_password);

# Check for Posts Needing Approval
$report_index = 0;
@col_titles[$report_index] = "Posts";
# Create a query of the data base.
$sql = "SELECT `poster_id`, `post_subject`, `post_text` FROM `phpbb_posts` WHERE post_approved=0";
# Give the data base a chance to prepare. Perhaps it will compile the request.
$sth = $dbh->prepare($sql);
# Run the query.
$sth->execute || die "Could not execute SQL statement ... maybe invalid?";
while (@row=$sth->fetchrow_array) {
	$post_approval_count++;
	$sql = "SELECT `username` FROM `phpbb_users` WHERE user_id=$row[0]";
	$sth2 = $dbh->prepare($sql);
	$sth2->execute || die "Could not execute SQL statement ... maybe invalid?";
	while (@row2=$sth2->fetchrow_array) {
		$name = $row2[0];
	}
	printf (FILE "Name: $name ($row[0])\nSubject: $row[1]\nText: $row[2]\n\n");
}

# Check for Reported Posts 
$report_index = 0;
@col_titles[$report_index] = "Posts";
# Create a query of the data base.
$sql = "SELECT `poster_id`, `post_subject`, `post_text` FROM `phpbb_posts` WHERE post_reported=1";
# Give the data base a chance to prepare. Perhaps it will compile the request.
$sth = $dbh->prepare($sql);
# Run the query.
$sth->execute || die "Could not execute SQL statement ... maybe invalid?";
while (@row=$sth->fetchrow_array) {
	$post_report_count++;
	$sql = "SELECT `username` FROM `phpbb_users` WHERE user_id=$row[0]";
	$sth2 = $dbh->prepare($sql);
	$sth2->execute || die "Could not execute SQL statement ... maybe invalid?";
	while (@row2=$sth2->fetchrow_array) {
		$name = $row2[0];
	}
	printf (FILE "Name: $name ($row[0])\nSubject: $row[1]\nText: $row[2]\n\n");
}

printf (FILE "--\n$forum_address/mcp.php?i=main&mode=front\n");
printf (FILE "Posts to Approve: $post_approval_count\n"); 
printf (FILE "Posts to Review: $post_report_count\n"); 
if ($post_approval_count+$post_report_count > 0) 
{
	system ( "mail $email -s \"PSD Moderator Queue\" < check_moderator_queue.tmp");
}
close (FILE);
open FILE, ">", "check_moderator_queue.tmp" or die $!;
printf(FILE "Approve $post_approval_count, Reported $post_report_count");
printf (FILE "\n$forum_address/mcp.php?i=main&mode=front");
if ($post_approval_count+$post_report_count > 0) 
{
	system ( "mail $sms_email -s \"PSD\" < check_moderator_queue.tmp");
}
close (FILE);

Crontab entry.

Code: Select all

0 * * * *      $HOME/scripts/check_moderator_q.pl

andreaplanet
Registered User
Posts: 8
Joined: Mon Apr 15, 2002 4:42 pm
Contact:

Re: Email Notification for Moderation Queue

Post by andreaplanet » Sun Dec 13, 2009 6:52 pm

Diet Ebola Cola wrote: It probably isn't a standard feature because if you get a spambot attack sending thousands of messages to a moderated forum.. you're going to get thousands of emails at once..
This feature could be easily implemented as standard by sending only ONE email if there are one or more posts to be approved. Just the first email is enough, not one email for each post to be approved.

I also need this feature because moderation is a must for the massive amounts of spams on my small forum. Small forums don't receive many posts (less than spams), and I must check daily if there are some new posts to approve. Does anyone knows if the latest phpBB version 3.0.6 has this feature as standard? I don't want to install mods.

Andrea
:)

User avatar
eblom00
Registered User
Posts: 36
Joined: Sat May 21, 2005 5:24 pm
Contact:

Re: Email Notification for Moderation Queue

Post by eblom00 » Sun Dec 13, 2009 7:50 pm

Andrea,
If you are comfortable with the command line in a Unix environment try my script above. Getting a text message for each new post that needs approval is working great for me.

Eric

andreaplanet
Registered User
Posts: 8
Joined: Mon Apr 15, 2002 4:42 pm
Contact:

Re: Email Notification for Moderation Queue

Post by andreaplanet » Sun Dec 13, 2009 8:05 pm

eblom00 wrote:Andrea,
If you are comfortable with the command line in a Unix environment try my script above. Getting a text message for each new post that needs approval is working great for me.

Eric
Nice Script and I like that I don't have to change the Forum to make it work, I will give it a try.

P.S.: Why you placed the Close(FILE) instructions after the sendmail? Unless there is a flush (file save) at each printf you will loose some of the text (from the file) that is sent by email.

User avatar
eblom00
Registered User
Posts: 36
Joined: Sat May 21, 2005 5:24 pm
Contact:

Re: Email Notification for Moderation Queue

Post by eblom00 » Sun Dec 13, 2009 11:50 pm

Good point on the file close. Let me know how it works for you.

Eric

Locked

Return to “[3.0.x] MOD Requests”

Who is online

Users browsing this forum: Google [Bot] and 21 guests

cron