eval("\$unreadreports = \"".$templates->get("global_unreadreports")."\";");
}
}
$awaiting_moderation = '';
// This user is a moderator, super moderator or administrator
if($mybb->usergroup['cancp'] == 1 || $mybb->user['ismoderator'] && $mybb->usergroup['canmodcp'])
{
// Unapproved threads
$query = $db->simple_select("threads", "COUNT(tid) AS unapprovedthreads", "visible=0 {$flist}");
$unapproved_threads = $db->fetch_field($query, "unapprovedthreads");
// 0 or more unapproved threads currently exist
if($unapproved_threads > 0)
{
if($unapproved_threads == 1)
{
$lang->awaiting_moderation = $lang->awaiting_moderation_thread;
}
else
{
$lang->awaiting_moderation = $lang->sprintf($lang->awaiting_moderation_threads, $unapproved_threads);
}
eval("\$awaiting_moderation = \"".$templates->get("global_awaiting_moderation_threads")."\";");
}
$unreadreports = $unreadreports . $awaiting_moderation;
$awaiting_moderation = '';
// Unapproved posts
$query = $db->query("
SELECT COUNT(pid) AS unapprovedposts
FROM ".TABLE_PREFIX."posts p
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE p.visible='0' {$tflist} AND t.firstpost != p.pid
");
$unapproved_posts = $db->fetch_field($query, "unapprovedposts");
// 0 or more unapproved posts currently exist
if($unapproved_posts > 0)
{
if($unapproved_posts == 1)
{
$lang->awaiting_moderation = $lang->awaiting_moderation_post;
}
else
{
$lang->awaiting_moderation = $lang->sprintf($lang->awaiting_moderation_posts, $unapproved_posts);
}
eval("\$awaiting_moderation = \"".$templates->get("global_awaiting_moderation_posts")."\";");
}
$unreadreports = $unreadreports . $awaiting_moderation;
$awaiting_moderation = '';
// Unapproved attachments
$query = $db->query("
SELECT COUNT(aid) AS unapprovedattachments
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid)
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
WHERE a.visible='0' {$tflist}
");
$unapproved_attachments = $db->fetch_field($query, "unapprovedattachments");
// 0 or more unapproved attachments currently exist
if($unapproved_attachments > 0)
{
if($unapproved_attachments == 1)
{
$lang->awaiting_moderation = $lang->awaiting_moderation_attachment;
}
else
{
$lang->awaiting_moderation = $lang->sprintf($lang->awaiting_moderation_attachments, $unapproved_attachments);
}
eval("\$awaiting_moderation = \"".$templates->get("global_awaiting_moderation_attachments")."\";");
}
$unreadreports = $unreadreports . $awaiting_moderation;
}