本文整理汇总了PHP中get_module_zone函数的典型用法代码示例。如果您正苦于以下问题:PHP get_module_zone函数的具体用法?PHP get_module_zone怎么用?PHP get_module_zone使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_module_zone函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('chat')) {
return array();
}
return array(array('cms', 'chatrooms', array('cms_chat', array('type' => 'misc'), get_module_zone('cms_chat')), do_lang_tempcode('ITEMS_HERE', do_lang_tempcode('ROOMS'), make_string_tempcode(escape_html(integer_format($GLOBALS['SITE_DB']->query_value_null_ok('chat_rooms', 'COUNT(*)', NULL, '', true))))), 'DOC_CHAT'), array('structure', 'chatrooms', array('admin_chat', array('type' => 'misc'), get_module_zone('admin_chat')), do_lang_tempcode('ROOMS'), 'DOC_CHAT'));
}
示例2: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('bulkupload')) {
return array();
}
return array(array('tools', 'bulkupload', array('admin_bulkupload', array(), get_module_zone('admin_bulkupload')), do_lang_tempcode('BULK_UPLOAD'), 'DOC_BULK_UPLOAD'));
}
示例3: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('downloads')) {
return array();
}
return array(array('cms', 'downloads', array('cms_downloads', array('type' => 'misc'), get_module_zone('cms_downloads')), do_lang_tempcode('ITEMS_HERE', do_lang_tempcode('SECTION_DOWNLOADS'), make_string_tempcode(escape_html(integer_format($GLOBALS['SITE_DB']->query_value_null_ok('download_downloads', 'COUNT(*)', NULL, '', true))))), 'DOC_DOWNLOADS'));
}
示例4: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('newsletter')) {
return array();
}
return array(array('tools', 'newsletters', array('admin_newsletter', array('type' => 'misc'), get_module_zone('admin_newsletter')), do_lang_tempcode('NEWSLETTER'), 'DOC_NEWSLETTER'));
}
示例5: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
require_code('downloads');
require_css('downloads');
require_lang('downloads');
$zone = array_key_exists('zone', $map) ? $map['zone'] : get_module_zone('downloads');
global $NON_CANONICAL_PARAMS;
$NON_CANONICAL_PARAMS[] = 'max';
$max = get_param_integer('max', 10);
if ($max < 1) {
$max = 1;
}
$start = get_param_integer('start', 0);
$rows = $GLOBALS['SITE_DB']->query_select('download_downloads', array('*'), array('validated' => 1), 'ORDER BY num_downloads DESC', $max, $start);
$content = new ocp_tempcode();
foreach ($rows as $i => $row) {
if ($i != 0) {
$content->attach(do_template('BLOCK_SEPARATOR'));
}
$content->attach(get_download_html($row, true, true, $zone));
}
$page_num = intval(floor(floatval($start) / floatval($max))) + 1;
$count = $GLOBALS['SITE_DB']->query_value('download_downloads', 'COUNT(*)', array('validated' => 1));
$num_pages = intval(ceil(floatval($count) / floatval($max)));
if ($num_pages == 0) {
$page_num = 0;
}
$previous_url = $start == 0 ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'start' => $start - $max), '_SELF');
$next_url = $page_num == $num_pages ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'start' => $start + $max), '_SELF');
$browse = do_template('NEXT_BROWSER_BROWSE_NEXT', array('_GUID' => '15ca70ec400629f67edefa869fb1f1a8', 'NEXT_LINK' => $next_url, 'PREVIOUS_LINK' => $previous_url, 'PAGE_NUM' => integer_format($page_num), 'NUM_PAGES' => integer_format($num_pages)));
return do_template('BLOCK_MAIN_DOWNLOAD_TEASE', array('_GUID' => 'a164e33c0b4ace4bae945c39f2f00ca9', 'CONTENT' => $content, 'BROWSE' => $browse));
}
示例6: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('ldap')) {
return array();
}
return array(get_forum_type() != 'ocf' ? NULL : array('security', 'ldap', array('admin_ocf_ldap', array('type' => 'misc'), get_module_zone('admin_ocf_ldap')), do_lang_tempcode('LDAP'), 'DOC_LDAP'));
}
示例7: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (get_forum_type() != 'ocf') {
return array();
}
return array(array('setup', 'notifications', array('admin_notifications', array('type' => 'misc'), get_module_zone('admin_notifications')), do_lang_tempcode('NOTIFICATIONS_LOCKDOWN'), 'DOC_NOTIFICATIONS'));
}
示例8: run
/**
* Standard modular run function for CRON hooks. Searches for tasks to perform.
*/
function run()
{
if (get_forum_type() != 'ocf') {
return;
}
$time = time();
$last_time = intval(get_value('last_confirm_reminder_time'));
if ($last_time > time() - 24 * 60 * 60 * 2) {
return;
}
set_value('last_confirm_reminder_time', strval($time));
require_code('mail');
require_lang('ocf');
$GLOBALS['NO_DB_SCOPE_CHECK'] = true;
$rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'f_members WHERE ' . db_string_not_equal_to('m_validated_email_confirm_code', '') . ' AND m_join_time>' . strval($last_time));
$GLOBALS['NO_DB_SCOPE_CHECK'] = false;
foreach ($rows as $row) {
$coppa = get_option('is_on_coppa') == '1' && utctime_to_usertime(time() - mktime(0, 0, 0, $row['m_dob_month'], $row['m_dob_day'], $row['m_dob_year'])) / 31536000.0 < 13.0;
if (!$coppa) {
$zone = get_module_zone('join');
if ($zone != '') {
$zone .= '/';
}
$url = get_base_url() . '/' . $zone . 'index.php?page=join&type=step4&email=' . rawurlencode($row['m_email_address']) . '&code=' . $row['m_validated_email_confirm_code'];
$url_simple = get_base_url() . '/' . $zone . 'index.php?page=join&type=step4';
$message = do_lang('OCF_SIGNUP_TEXT', comcode_escape(get_site_name()), comcode_escape($url), array($url_simple, $row['m_email_address'], strval($row['m_validated_email_confirm_code'])), $row['m_language']);
mail_wrap(do_lang('CONFIRM_EMAIL_SUBJECT', get_site_name(), NULL, NULL, $row['m_language']), $message, array($row['m_email_address']), $row['m_username']);
}
}
}
示例9: run
/**
* Standard modular run function.
*
* @return array An array of tuples: The task row to show, the number of seconds until it is due (or NULL if not on a timer), the number of things to sort out (or NULL if not on a queue), The name of the config option that controls the schedule (or NULL if no option).
*/
function run()
{
if (!addon_installed('iotds')) {
return array();
}
if (get_option('iotd_update_time') == '') {
return array();
}
require_lang('iotds');
$date = $GLOBALS['SITE_DB']->query_value_null_ok('iotd', 'date_and_time', array('is_current' => 1));
$limit_hours = intval(get_option('iotd_update_time'));
$seconds_ago = mixed();
if (!is_null($date)) {
$seconds_ago = time() - $date;
$status = $seconds_ago > $limit_hours * 60 * 60 ? 0 : 1;
} else {
$status = 0;
}
$_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
$config_row = $GLOBALS['SITE_DB']->query_select('config', array('the_page', 'section'), array('the_name' => 'iotd_update_time'), '', 1);
if (array_key_exists(0, $config_row)) {
$_config_url = build_url(array('page' => 'admin_config', 'type' => 'category', 'id' => $config_row[0]['the_page']), get_module_zone('admin_config'));
$config_url = $_config_url->evaluate();
$config_url .= '#group_' . $config_row[0]['section'];
} else {
$config_url = NULL;
}
$url = build_url(array('page' => 'cms_iotds', 'type' => 'ed'), get_module_zone('cms_iotds'));
$num_queue = $this->get_num_iotd_queue();
list($info, $seconds_due_in) = staff_checklist_time_ago_and_due($seconds_ago, $limit_hours);
$info->attach(do_lang_tempcode('NUM_QUEUE', integer_format($num_queue)));
$tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('_GUID' => '5c55aed7bedca565c8aa553548b88e64', 'CONFIG_URL' => $config_url, 'URL' => $url, 'STATUS' => $_status, 'TASK' => do_lang_tempcode('PT_choose_iotd'), 'INFO' => $info));
return array(array($tpl, $seconds_due_in, NULL, 'iotd_update_time'));
}
示例10: run
/**
* Standard modular run function for OcCLE notification hooks.
*
* @param ?integer The "current" time on which to base queries (NULL: now)
* @return ~array Array of section, type and message responses (false: nothing)
*/
function run($timestamp = NULL)
{
if (!addon_installed('chat')) {
return false;
}
if (!is_null(get_value('occle_watched_chatroom'))) {
require_lang('chat');
if (is_null($timestamp)) {
$timestamp = time();
}
$room = intval(get_value('occle_watched_chatroom'));
$room_messages = $GLOBALS['SITE_DB']->query('SELECT COUNT(*) AS cnt FROM ' . get_table_prefix() . 'chat_messages WHERE room_id=' . strval($room) . ' AND date_and_time>=' . strval((int) $timestamp));
if (!array_key_exists(0, $room_messages)) {
return false;
}
if ($room_messages[0]['cnt'] > 0) {
$rooms = array();
$messages = $room_messages[0]['cnt'];
$room_data = $GLOBALS['SITE_DB']->query_value_null_ok('chat_rooms', 'room_name', array('id' => $room));
if (is_null($room_data)) {
return false;
}
// Selected room deleted
$rooms[$room_data] = build_url(array('page' => 'chat', 'type' => 'room', 'id' => $room), get_module_zone('chat'));
return array(do_lang('SECTION_CHAT'), do_lang('NEW_MESSAGES'), do_template('OCCLE_CHAT_NOTIFICATION', array('MESSAGE_COUNT' => integer_format($messages), 'ROOMS' => $rooms)));
} else {
return false;
}
} else {
return false;
}
}
示例11: run
/**
* Standard modular run function.
*
* @return array An array of tuples: The task row to show, the number of seconds until it is due (or NULL if not on a timer), the number of things to sort out (or NULL if not on a queue), The name of the config option that controls the schedule (or NULL if no option).
*/
function run()
{
if (!addon_installed('backup')) {
return array();
}
if (get_option('backup_time', true) == '') {
return array();
}
$limit_hours = intval(get_option('backup_time', true));
require_lang('backups');
$date = intval(get_value('last_backup'));
$seconds_ago = mixed();
if ($date != 0) {
$seconds_ago = time() - $date;
$status = intval($seconds_ago) > $limit_hours * 60 * 60 ? 0 : 1;
} else {
$status = 0;
}
$_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
$config_row = $GLOBALS['SITE_DB']->query_select('config', array('the_page', 'section'), array('the_name' => 'backup_time'), '', 1);
if (array_key_exists(0, $config_row)) {
$_config_url = build_url(array('page' => 'admin_config', 'type' => 'category', 'id' => $config_row[0]['the_page']), get_module_zone('admin_config'));
$config_url = $_config_url->evaluate();
$config_url .= '#group_' . $config_row[0]['section'];
} else {
$config_url = NULL;
}
$url = build_url(array('page' => 'admin_backup', 'type' => 'misc'), 'adminzone');
list($info, $seconds_due_in) = staff_checklist_time_ago_and_due($seconds_ago, $limit_hours);
$tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('_GUID' => '432685ec6c9f7548ce8b488b6ce00030', 'CONFIG_URL' => $config_url, 'URL' => $url, 'STATUS' => $_status, 'TASK' => do_lang_tempcode('BACKUP'), 'INFO' => $info));
return array(array($tpl, $seconds_due_in, NULL, 'backup_time'));
}
示例12: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('galleries')) {
return array();
}
return array(array('cms', 'galleries', array('cms_galleries', array('type' => 'misc'), get_module_zone('cms_galleries')), do_lang_tempcode('ITEMS_HERE', do_lang_tempcode('GALLERIES'), make_string_tempcode(escape_html(integer_format($GLOBALS['SITE_DB']->query_value_null_ok('images', 'COUNT(*)', NULL, '', true) + $GLOBALS['SITE_DB']->query_value_null_ok('videos', 'COUNT(*)', NULL, '', true))))), 'DOC_GALLERIES'));
}
示例13: run
/**
* Standard modular run function for do_next_menu hooks. They find links to put on standard navigation menus of the system.
*
* @return array Array of links and where to show
*/
function run()
{
if (!addon_installed('quizzes')) {
return array();
}
return array(array('usage', 'quiz', array('admin_quiz', array('type' => 'misc'), get_module_zone('admin_quiz')), do_lang_tempcode('QUIZZES'), 'DOC_QUIZZES'), array('cms', 'quiz', array('cms_quiz', array('type' => 'misc'), get_module_zone('cms_quiz')), do_lang_tempcode('ITEMS_HERE', do_lang_tempcode('QUIZZES'), make_string_tempcode(escape_html(integer_format($GLOBALS['SITE_DB']->query_value_null_ok('quizzes', 'COUNT(*)', NULL, '', true))))), 'DOC_QUIZZES'));
}
示例14: info
/**
* Standard modular info function for award hooks. Provides information to allow task reporting, randomisation, and add-screen linking, to function.
*
* @return ?array Map of award content-type info (NULL: disabled).
*/
function info()
{
$info = array();
$info['connection'] = $GLOBALS['SITE_DB'];
$info['table'] = 'videos';
$info['date_field'] = 'add_date';
$info['id_field'] = 'id';
$info['add_url'] = has_submit_permission('mid', get_member(), get_ip_address(), 'cms_galleries') ? build_url(array('page' => 'cms_galleries', 'type' => 'av'), get_module_zone('cms_galleries')) : new ocp_tempcode();
$info['category_field'] = 'cat';
$info['category_type'] = 'galleries';
$info['parent_spec__table_name'] = 'galleries';
$info['parent_spec__parent_name'] = 'parent_id';
$info['parent_spec__field_name'] = 'name';
$info['parent_field_name'] = 'cat';
$info['submitter_field'] = 'submitter';
$info['id_is_string'] = false;
require_lang('galleries');
$info['title'] = do_lang_tempcode('VIDEOS');
$info['validated_field'] = 'validated';
$info['category_is_string'] = true;
$info['archive_url'] = build_url(array('page' => 'galleries'), get_module_zone('galleries'));
$info['cms_page'] = 'cms_galleries';
$info['where'] = 'cat NOT LIKE \'' . db_encode_like('download\\_%') . '\'';
$info['views_field'] = 'video_views';
$info['supports_custom_fields'] = true;
return $info;
}
示例15: run
/**
* Standard modular run function.
*
* @return array An array of tuples: The task row to show, the number of seconds until it is due (or NULL if not on a timer), the number of things to sort out (or NULL if not on a queue), The name of the config option that controls the schedule (or NULL if no option).
*/
function run()
{
if (!addon_installed('tickets')) {
return array();
}
require_lang('tickets');
require_code('tickets');
require_code('tickets2');
$outstanding = 0;
$tickets = get_tickets(get_member(), NULL, false, true);
if (!is_null($tickets)) {
foreach ($tickets as $topic) {
if ($topic['closed'] == 0) {
$outstanding++;
}
}
}
if ($outstanding > 0) {
$status = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0', array('_GUID' => 'g578142633c6f3d37776e82a869deb91'));
} else {
$status = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1', array('_GUID' => 'h578142633c6f3d37776e82a869deb91'));
}
$url = build_url(array('page' => 'tickets', 'type' => 'misc'), get_module_zone('tickets'));
$tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('URL' => $url, 'STATUS' => $status, 'TASK' => do_lang_tempcode('SUPPORT_TICKETS'), 'INFO' => do_lang_tempcode('NUM_QUEUE', escape_html(integer_format($outstanding)))));
return array(array($tpl, NULL, $outstanding, NULL));
}