MyBB Community Forums

Full Version: Notify mods about pending posts?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is there any way to have notifications sent to mods when there are posts awaiting moderation? Or to show that at the top of the page for them?
You can set this option for each forum.

Admin CP/Forums and Post/Edit Forum Settings

Then under Moderation Options, check moderate new post.
Tell them to use the modcp and select the Moderation Queue from the sidebar.
Right. That's how I have it set, and that's how we're checking for pending posts, but it would be nice to have a notice like for PMs.
(2012-08-23, 01:27 PM)fylliska Wrote: [ -> ]Right. That's how I have it set, and that's how we're checking for pending posts, but it would be nice to have a notice like for PMs.

I actually tried this, but you want only threads, post, or attachments? Also, all forums? It will increase one query by page too, probably more depending on what you exactly want (threads, post, attachments).
I ran a query from the cache to do it on my own site, but it is hardcoded (simple find replace)

<?php
/**
* Author: LeeFish
* Copyright: ? 2011 LeeFish
* Website:  http://www.leefish.nl
**/

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

// Plugin hook

$plugins->add_hook("global_end", "unapprovedthreads_global");

// Plugin info

function unapprovedthreads_info()
{
	return array(
		"name"			=> "Unapproved Threads",
		"description"	=> "Add a link in the welcomeblock.",
		"website"		=> "http://www.leefish.nl",
		"author"		=> "LeeFish",
		"authorsite"	=> "http://www.leefish.nl",
		"version"		=> "1.1",
		"compatibility" => "1*"
	);
}

// Run plugin

function unapprovedthreads_global()
{
    global $db, $mybb, $cache, $header;    
	if($mybb->user['usergroup']==4)
    {
	// Load stats cache
		$stats = $cache->read("stats");
		$unapproved_threads = ($stats['numunapprovedthreads']);
		$unapproved_posts = ($stats['numunapprovedposts']);

		if($stats['numunapprovedthreads'] == 0) 
		{
		$unapproved_threads = 0;
		}
		if($stats['numunapprovedposts'] == 0)
		{
		$unapproved_posts = 0;
		}
		else
		{
			$find = 'ACP</span>';
			$replace = "  <a href=\"".$mybb->settings['bburl']."/modcp.php\">To Review <span class=\"sigbutton\">$unapproved_threads/$unapproved_posts</span></a>";                   
			$header = str_replace($find, $find.$replace, $header);
		}
	}
}
?>
But what if the current online user can't moderate those threads/posts (In your code it only applies to admins, so they can always moderate)?

I would rather to go with the nicest way to approach it even it is runs one query.
Well, I have it as admin - I don't have any moderators, so I have not tested it. In theory - it should work.

It would not work for forum specific moderators (or it might give a false positive).

Did a test - for a moderator of all forums - it showed up. Just needed to change usergroup to 6 and look for MCP. Have not tested on forum specific mods.

For candy (which is what this is - the mods should check the MCP) then I prefer to keep it as simple as possible and avoid queries, I like to save my queries for real things. Big Grin
(2012-08-23, 09:14 PM)Leefish Wrote: [ -> ]I ran a query from the cache to do it on my own site, but it is hardcoded (simple find replace)

<?php
/**
* Author: LeeFish
* Copyright: ? 2011 LeeFish
* Website:  http://www.leefish.nl
**/

// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
	die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

// Plugin hook

$plugins->add_hook("global_end", "unapprovedthreads_global");

// Plugin info

function unapprovedthreads_info()
{
	return array(
		"name"			=> "Unapproved Threads",
		"description"	=> "Add a link in the welcomeblock.",
		"website"		=> "http://www.leefish.nl",
		"author"		=> "LeeFish",
		"authorsite"	=> "http://www.leefish.nl",
		"version"		=> "1.1",
		"compatibility" => "1*"
	);
}

// Run plugin

function unapprovedthreads_global()
{
    global $db, $mybb, $cache, $header;    
	if($mybb->user['usergroup']==4)
    {
	// Load stats cache
		$stats = $cache->read("stats");
		$unapproved_threads = ($stats['numunapprovedthreads']);
		$unapproved_posts = ($stats['numunapprovedposts']);

		if($stats['numunapprovedthreads'] == 0) 
		{
		$unapproved_threads = 0;
		}
		if($stats['numunapprovedposts'] == 0)
		{
		$unapproved_posts = 0;
		}
		else
		{
			$find = 'ACP</span>';
			$replace = "  <a href=\"".$mybb->settings['bburl']."/modcp.php\">To Review <span class=\"sigbutton\">$unapproved_threads/$unapproved_posts</span></a>";                   
			$header = str_replace($find, $find.$replace, $header);
		}
	}
}
?>
I'm trying to accomplish this. Has there been another method discovered or perhaps a plugin that I just can't find?

If not, then where did you insert this code exactly to get it working? Not sure what you mean about the cache. Is that a specific file?