本文整理汇总了PHP中addon_installed函数的典型用法代码示例。如果您正苦于以下问题:PHP addon_installed函数的具体用法?PHP addon_installed怎么用?PHP addon_installed使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addon_installed函数的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.
*
* @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('flagrant')) {
return array();
}
require_lang('flagrant');
$rows = $GLOBALS['SITE_DB']->query_select('text', array('activation_time', 'days'), array('active_now' => 1), '', NULL, NULL, true);
if (is_null($rows)) {
return array();
}
$seconds_due_in = mixed();
if (array_key_exists(0, $rows)) {
$activation_time = $rows[0]['activation_time'];
$days = $rows[0]['days'];
$date = $activation_time + $days * 24 * 60 * 60;
$seconds_due_in = $date - time();
$status = $seconds_due_in <= 0 ? 0 : 1;
} else {
$status = 1;
}
$_status = $status == 0 ? do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0') : do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1');
$url = build_url(array('page' => 'admin_flagrant', 'type' => 'misc'), 'adminzone');
$num_queue = $this->get_num_flagrant_queue();
list($info, $seconds_due_in) = staff_checklist_time_ago_and_due($seconds_due_in);
$info->attach(do_lang_tempcode('NUM_QUEUE', escape_html(integer_format($num_queue))));
$tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('_GUID' => '820e0e3cd80754dc7dfd9a0d05a43ec0', 'URL' => $url, 'STATUS' => $_status, 'TASK' => do_lang_tempcode('CHOOSE_FLAGRANT'), 'INFO' => $info));
return array(array($tpl, $seconds_due_in, NULL, NULL));
}
示例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: get_blocks
/**
* Standard modular run function for blocks in the setup wizard.
*
* @return array Map of block names, to display types.
*/
function get_blocks()
{
if (!addon_installed('newsletter')) {
return array();
}
return array(array(), array('main_newsletter_signup' => array('PANEL_NONE', 'PANEL_RIGHT')));
}
示例5: get_blocks
/**
* Standard modular run function for blocks in the setup wizard.
*
* @return array Map of block names, to display types.
*/
function get_blocks()
{
if (!addon_installed('polls')) {
return array();
}
return array(array('main_poll' => array('NO', 'YES_CELL')), array());
}
示例6: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (!addon_installed('downloads')) {
return new ocp_tempcode();
}
require_lang('downloads');
require_code('downloads_stats');
$bits = new ocp_tempcode();
if (get_option('downloads_show_stats_count_total', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'ff2bd884d88ddc8c5a81cff897f99a5a', 'KEY' => do_lang_tempcode('COUNT_TOTAL'), 'VALUE' => integer_format(get_num_archive_downloads()))));
}
if (get_option('downloads_show_stats_count_archive', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '3d221f2145581a3af51c8948f28b7ac7', 'KEY' => do_lang_tempcode('COUNT_ARCHIVE'), 'VALUE' => get_download_archive_size())));
}
if (get_option('downloads_show_stats_count_downloads', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => '47c544ef053f9be47e2c48c3a694da1c', 'KEY' => do_lang_tempcode('COUNT_DOWNLOADS'), 'VALUE' => integer_format(get_num_downloads_downloaded()))));
}
if (get_option('downloads_show_stats_count_bandwidth', true) == '1') {
$bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('_GUID' => 'b2589ae83652953ece220267043d75c9', 'KEY' => do_lang_tempcode('COUNT_BANDWIDTH'), 'VALUE' => clean_file_size(get_download_bandwidth()))));
}
if ($bits->is_empty()) {
return new ocp_tempcode();
}
$files = do_template('BLOCK_SIDE_STATS_SECTION', array('_GUID' => '99ae3f35b3e5eda18901e97ac385d99c', 'SECTION' => do_lang_tempcode('SECTION_DOWNLOADS'), 'CONTENT' => $bits));
return $files;
}
示例7: get_blocks
/**
* Standard modular run function for blocks in the setup wizard.
*
* @return array Map of block names, to display types.
*/
function get_blocks()
{
if (!addon_installed('galleries')) {
return array();
}
return array(array('main_image_fader' => array('NO', 'NO'), 'main_top_galleries' => array('YES', 'NO'), 'main_recent_galleries' => array('YES', 'NO')), array('side_root_galleries' => array('PANEL_NONE', 'PANEL_NONE')));
}
示例8: run
/**
* Standard modular run function for CRON hooks. Searches for tasks to perform.
*/
function run()
{
if (!addon_installed('stats')) {
return;
}
$GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'stats WHERE date_and_time<' . strval(time() - 60 * 60 * 24 * intval(get_option('stats_store_time'))));
}
示例9: 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('pointstore')) {
return array();
}
return array(array('usage', 'pointstorelog', array('admin_pointstore', array('type' => 'misc'), get_module_zone('admin_pointstore')), do_lang_tempcode('POINTSTORE_MANAGE_SALES'), 'DOC_POINT_STORE'), array('setup', 'pointstore', array('admin_pointstore', array('type' => 'p'), get_module_zone('admin_pointstore')), do_lang_tempcode('POINTSTORE_MANAGE_INVENTORY'), 'DOC_POINT_STORE'));
}
示例10: 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'));
}
示例11: 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;
}
}
示例12: 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'));
}
示例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('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'));
}
示例14: 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'));
}
示例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));
}