PHP Code:
if (can_moderate()) {
$queryids = array(0);
foreach($imodcache AS $value) {
foreach($value AS $userid) {
if ($userid['userid'] == $bbuserinfo['userid']) {
$queryids[] = $userid['forumid'];
}
}
}
$getposts = $DB_site->query_first("
SELECT COUNT(*) AS total
FROM ".TABLE_PREFIX."moderation AS moderation
LEFT JOIN ".TABLE_PREFIX."thread AS thread USING(threadid)
WHERE thread.forumid IN(".implode(',', $queryids).")
");
if (!empty($getposts['total'])) {
eval('$moderatepopup = "' . fetch_template('moderate_popup') . '";'); //change this
}
}
Taken from my forums index.php, checks if there are any outstanding posts awating moderation in any of the forums the current user moderates. Change the fetch_template() line to do whatever you want if there are any posts awating.