// Let the templates know whether we have new private messages. $PHORUM["DATA"]["NEW_PRIVATE_MESSAGES"] = 0; if ( $PHORUM["enable_pm"] && isset($PHORUM["user"]["new_private_messages"]) ) { $PHORUM["DATA"]["NEW_PRIVATE_MESSAGES"] = $PHORUM["user"]["new_private_messages"]; } $PHORUM["DATA"]["notice_messages"] = false; $PHORUM["DATA"]["notice_users"] = false; $PHORUM["DATA"]["notice_groups"] = false; // if moderator notifications are on and the person is a mod, lets find out if anything is new if ( $PHORUM["enable_moderator_notifications"] ) { $forummodlist = phorum_user_access_list( PHORUM_USER_ALLOW_MODERATE_MESSAGES ); if ( count( $forummodlist ) > 0 ) { $PHORUM["DATA"]["notice_messages"] = ( count( phorum_db_get_unapproved_list( $forummodlist, true ) ) > 0 ); $PHORUM["DATA"]["notice_messages_url"] = phorum_get_url( PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_UNAPPROVED ); } if ( phorum_user_access_allowed( PHORUM_USER_ALLOW_MODERATE_USERS ) ) { $PHORUM["DATA"]["notice_users"] = ( count( phorum_db_user_get_unapproved() ) > 0 ); $PHORUM["DATA"]["notice_users_url"] = phorum_get_url( PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_USERS ); } if ( phorum_user_allow_moderate_group() ) { $groups = phorum_user_get_moderator_groups(); if ( count( $groups ) > 0 ) { $PHORUM["DATA"]["notice_groups"] = count( phorum_db_get_group_members( array_keys( $groups ), PHORUM_USER_GROUP_UNAPPROVED ) ); $PHORUM["DATA"]["notice_groups_url"] = phorum_get_url( PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_GROUP_MODERATION ); } } }
} } } } $PHORUM['DATA']['PREPOST'] = array(); if ($gotforums) { $foruminfo = phorum_db_get_forums($mod_forums, NULL, $PHORUM['vroot']); } else { $foruminfo = array(); } foreach ($mod_forums as $forum => $rest) { $checkvar = 1; // Get the threads $rows = array(); // get the thread set started $rows = phorum_db_get_unapproved_list($forum, $showwaiting, $moddays); // loop through and read all the data in. foreach ($rows as $key => $row) { $numunapproved++; $rows[$key]['forumname'] = $foruminfo[$forum]['name']; $rows[$key]['checkvar'] = $checkvar; if ($checkvar) { $checkvar = 0; } $rows[$key]['forum_id'] = $forum; $rows[$key]["URL"]["READ"] = phorum_get_url(PHORUM_FOREIGN_READ_URL, $forum, $row["thread"], $row['message_id']); // we need to fake the forum_id here $PHORUM["forum_id"] = $forum; $rows[$key]["URL"]["APPROVE_MESSAGE"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_APPROVE_MESSAGE, $row["message_id"], "prepost=1", "old_forum=" . $oldforum, "onlyunapproved=" . $showwaiting, "moddays=" . $moddays); $rows[$key]["URL"]["APPROVE_TREE"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_APPROVE_MESSAGE_TREE, $row["message_id"], "prepost=1", "old_forum=" . $oldforum, "onlyunapproved=" . $showwaiting, "moddays=" . $moddays); $rows[$key]["URL"]["DELETE"] = phorum_get_url(PHORUM_MODERATION_URL, PHORUM_DELETE_TREE, $row["message_id"], "prepost=1", "old_forum=" . $oldforum, "onlyunapproved=" . $showwaiting, "moddays=" . $moddays);
$PHORUM["user"]["NOTICE"]["GROUPS"] = false; if ($PHORUM["DATA"]["LOGGEDIN"]) { // By default, only bug the user on the list, index and cc pages. // The template can override this behaviour by setting a comma // separated list of phorum_page names in a template define statement // like this: {DEFINE show_notify_for_pages "page 1,page 2,..,page n"} if (isset($PHORUM["TMP"]["show_notify_for_pages"])) { $show_notify_for_pages = explode(",", $PHORUM["TMP"]["show_notify_for_pages"]); } else { $show_notify_for_pages = array('index', 'list', 'cc'); } if (in_array(phorum_page, $show_notify_for_pages)) { if ($PHORUM["enable_moderator_notifications"]) { $forummodlist = phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_MESSAGES, PHORUM_ACCESS_LIST); if (count($forummodlist) > 0) { $PHORUM["user"]["NOTICE"]["MESSAGES"] = phorum_db_get_unapproved_list($forummodlist, true, 0, true) > 0; $PHORUM["DATA"]["URL"]["NOTICE"]["MESSAGES"] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_UNAPPROVED); } if (phorum_api_user_check_access(PHORUM_USER_ALLOW_MODERATE_USERS)) { $PHORUM["user"]["NOTICE"]["USERS"] = count(phorum_db_user_get_unapproved()) > 0; $PHORUM["DATA"]["URL"]["NOTICE"]["USERS"] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_USERS); } $groups = phorum_api_user_check_group_access(PHORUM_USER_GROUP_MODERATOR, PHORUM_ACCESS_LIST); if (count($groups) > 0) { $PHORUM["user"]["NOTICE"]["GROUPS"] = count(phorum_db_get_group_members(array_keys($groups), PHORUM_USER_GROUP_UNAPPROVED)); $PHORUM["DATA"]["URL"]["NOTICE"]["GROUPS"] = phorum_get_url(PHORUM_CONTROLCENTER_URL, "panel=" . PHORUM_CC_GROUP_MODERATION); } } $PHORUM["user"]["NOTICE"]["SHOW"] = $PHORUM["user"]["NOTICE"]["MESSAGES"] || $PHORUM["user"]["NOTICE"]["USERS"] || $PHORUM["user"]["NOTICE"]["GROUPS"]; } }