/** * 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')); }
/** * 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)); }
/** * 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')); }
/** * 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'))); }
/** * 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()); }
/** * 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; }
/** * 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'))); }
/** * 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')))); }
/** * 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')); }
/** * 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')); }
/** * 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; } }
/** * 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')); }
/** * 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')); }
/** * 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')); }
/** * 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)); }
/** * 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('points')) { return array(); } return array(array('main_leader_board' => array('NO', 'YES')), array()); }
/** * 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')); }
/** * Standard modular run function. * * @return tempcode The result of execution. */ function run() { if (!addon_installed('calendar')) { return new ocp_tempcode(); } require_lang('calendar'); $bits = new ocp_tempcode(); if (get_option('calendar_show_stats_count_events', true) == '1') { $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS'), 'VALUE' => integer_format($GLOBALS['SITE_DB']->query_value('calendar_events', 'COUNT(*)'))))); } if (get_option('calendar_show_stats_count_events_this_week', true) == '1') { require_code('calendar'); $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 7)); $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_WEEK'), 'VALUE' => integer_format(count($events))))); } if (get_option('calendar_show_stats_count_events_this_month', true) == '1') { require_code('calendar'); $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 31)); $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_MONTH'), 'VALUE' => integer_format(count($events))))); } if (get_option('calendar_show_stats_count_events_this_year', true) == '1') { require_code('calendar'); $events = calendar_matches($GLOBALS['FORUM_DRIVER']->get_guest_id(), true, utctime_to_usertime(time()), utctime_to_usertime(time() + 60 * 60 * 24 * 365)); $bits->attach(do_template('BLOCK_SIDE_STATS_SUBLINE', array('KEY' => do_lang_tempcode('EVENTS_THIS_YEAR'), 'VALUE' => integer_format(count($events))))); } if ($bits->is_empty()) { return new ocp_tempcode(); } $section = do_template('BLOCK_SIDE_STATS_SECTION', array('SECTION' => do_lang_tempcode('CALENDAR'), 'CONTENT' => $bits)); return $section; }
/** * 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('backup')) { return array(); } return array(array('tools', 'backups', array('admin_backup', array('type' => 'misc'), get_module_zone('admin_backup')), do_lang_tempcode('BACKUPS'), 'DOC_BACKUPS')); }
/** * 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('occle')) { return array(); } return array(array('tools', 'occle', array('admin_occle', array('type' => 'misc'), get_module_zone('admin_occle')), do_lang_tempcode('OCCLE'))); }
/** * 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')); }
/** * 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('points')) { return array(); } return array(array('usage', 'pointslog', array('admin_points', array('type' => 'misc'), get_module_zone('admin_points')), do_lang_tempcode('GIFT_TRANSACTIONS'), 'DOC_POINTS')); }
/** * 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('random_quotes')) { return array(); } return array(array('main_quotes' => array('YES', 'NO')), array()); }
/** * Standard modular run function. * * @return array Results */ function run() { $ret = array('attachments' => 'ATTACHMENTS', 'attachment_references' => 'ATTACHMENT_REFERENCES', 'feedback' => '_FEEDBACK', 'permissions' => 'PERMISSIONS', 'themes' => 'THEMES', 'useronline_tracking' => 'USER_ONLINE_TRACKING', 'zones' => 'ZONES', 'ocf_emoticons' => 'EMOTICONS', 'ocf_members' => 'MEMBERS', 'ocf_member_files' => 'MEMBER_FILES', 'ocf_groups' => 'USERGROUPS', 'ocf_privileges' => 'PRIVILEGES', 'config' => 'CONFIGURATION', 'logs' => 'LOGS', 'pages' => 'COMCODE_PAGES', 'rss' => '_RSS', 'blocks' => '_BLOCK_LABEL', 'menu_items' => 'MENU_ITEMS', 'stafflinks' => 'STAFF_LINKS', 'customtasks' => 'CHECK_LIST', 'sitewatchlist' => 'SITE_WATCHLIST', 'searches_saved' => 'SAVED_SEARCHES', 'notifications' => 'NOTIFICATIONS'); if (addon_installed('ocf_cpfs')) { $ret['ocf_custom_profile_fields'] = 'CUSTOM_PROFILE_FIELDS'; } if (addon_installed('ocf_warnings')) { $ret['ocf_warnings'] = 'WARNINGS'; } if (addon_installed('custom_comcode')) { $ret['custom_comcode'] = 'CUSTOM_COMCODE'; } if (addon_installed('authors')) { $ret['authors'] = 'AUTHORS'; } if (addon_installed('welcome_emails')) { $ret['ocf_welcome_emails'] = 'WELCOME_EMAILS'; } if (addon_installed('securitylogging')) { $ret['ip_bans'] = 'BANNED_ADDRESSES'; } if (addon_installed('redirects_editor')) { $ret['redirects'] = 'REDIRECTS'; } if (addon_installed('match_key_permissions')) { $ret['match_key_messages'] = 'PAGE_MATCH_KEY_ACCESS'; } return $ret; }
/** * 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')); }
/** * Standard modular run function for RSS hooks. * * @param string A list of categories we accept from * @param TIME Cutoff time, before which we do not show results from * @param string Prefix that represents the template set we use * @set RSS_ ATOM_ * @param string The standard format of date to use for the syndication type represented in the prefix * @param integer The maximum number of entries to return, ordering by date * @return ?array A pair: The main syndication section, and a title (NULL: error) */ function run($_filters, $cutoff, $prefix, $date_string, $max) { if (!addon_installed('galleries')) { return NULL; } if (!has_actual_page_access(get_member(), 'galleries')) { return NULL; } $filters_1 = ocfilter_to_sqlfragment($_filters, 'name', 'galleries', 'parent_id', 'name', 'name', false, false); // Note that the parameters are fiddled here so that category-set and record-set are the same, yet SQL is returned to deal in an entirely different record-set (entries' record-set) $filters = ocfilter_to_sqlfragment($_filters, 'cat', 'galleries', 'parent_id', 'cat', 'name', false, false); // Note that the parameters are fiddled here so that category-set and record-set are the same, yet SQL is returned to deal in an entirely different record-set (entries' record-set) require_lang('galleries'); $content = new ocp_tempcode(); $_galleries = array(); if ($GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT COUNT(*) FROM ' . get_table_prefix() . 'galleries WHERE ' . $filters_1) < 3000) { $_galleries = $GLOBALS['SITE_DB']->query('SELECT fullname,name FROM ' . get_table_prefix() . 'galleries WHERE ' . $filters_1); foreach ($_galleries as $i => $_gallery) { $_galleries[$i]['text_original'] = get_translated_text($_gallery['fullname']); } } $galleries = collapse_2d_complexity('name', 'text_original', $_galleries); $rows1 = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'videos WHERE add_date>' . strval((int) $cutoff) . ' AND ' . $filters . (!has_specific_permission(get_member(), 'see_unvalidated') ? ' AND validated=1 ' : '') . ' ORDER BY add_date DESC', $max); $rows2 = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'images WHERE add_date>' . strval((int) $cutoff) . ' AND ' . $filters . (!has_specific_permission(get_member(), 'see_unvalidated') ? ' AND validated=1 ' : '') . ' ORDER BY add_date DESC', $max); $rows = array_merge($rows1, $rows2); foreach ($rows as $row) { $id = strval($row['id']); $author = $GLOBALS['FORUM_DRIVER']->get_username($row['submitter']); if (is_null($author)) { $author = ''; } $news_date = date($date_string, $row['add_date']); $edit_date = is_null($row['edit_date']) ? '' : date($date_string, $row['edit_date']); $news_title = xmlentities(do_lang('THIS_WITH_SIMPLE', array_key_exists('video_views', $row) ? do_lang('VIDEO') : do_lang('IMAGE'), strval($row['id']))); $_summary = get_translated_tempcode($row['comments']); $summary = xmlentities($_summary->evaluate()); $news = ''; if (!array_key_exists($row['cat'], $galleries)) { $_fullname = $GLOBALS['SITE_DB']->query_value_null_ok('galleries', 'fullname', array('name' => $row['cat'])); if (is_null($_fullname)) { continue; } $galleries[$row['cat']] = get_translated_text($_fullname); } $category = $galleries[$row['cat']]; $category_raw = $row['cat']; $view_url = build_url(array('page' => 'galleries', 'type' => array_key_exists('video_views', $row) ? 'video' : 'image', 'id' => $row['id']), get_module_zone('galleries'), NULL, false, false, true); if ($prefix == 'RSS_' && get_option('is_on_comments') == '1' && $row['allow_comments'] >= '1') { $if_comments = do_template('RSS_ENTRY_COMMENTS', array('_GUID' => '65dc0cec8c75f565c58c95fa1667aa1e', 'COMMENT_URL' => $view_url, 'ID' => strval($row['id']))); } else { $if_comments = new ocp_tempcode(); } require_code('images'); $enclosure_url = ensure_thumbnail($row['url'], $row['thumb_url'], 'galleries', array_key_exists('video_views', $row) ? 'videos' : 'images', $row['id']); list($enclosure_length, $enclosure_type) = get_enclosure_details($row['url'], $enclosure_url); $content->attach(do_template($prefix . 'ENTRY', array('ENCLOSURE_URL' => $enclosure_url, 'ENCLOSURE_LENGTH' => $enclosure_length, 'ENCLOSURE_TYPE' => $enclosure_type, 'VIEW_URL' => $view_url, 'SUMMARY' => $summary, 'EDIT_DATE' => $edit_date, 'IF_COMMENTS' => $if_comments, 'TITLE' => $news_title, 'CATEGORY_RAW' => $category_raw, 'CATEGORY' => $category, 'AUTHOR' => $author, 'ID' => $id, 'NEWS' => $news, 'DATE' => $news_date))); } require_lang('galleries'); return array($content, do_lang('GALLERIES')); }
/** * 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('realtime_rain')) { return array(); } return array(array('usage', 'realtime_rain', array('admin_realtime_rain', array('type' => 'misc'), get_module_zone('admin_realtime_rain')), do_lang_tempcode('_REALTIME_RAIN'), do_lang_tempcode('DOC_REALTIME_RAIN'))); }
/** * Gets the default value for the config option. * * @return ?string The default value (NULL: option is disabled) */ function get_default() { if (!addon_installed('captcha')) { return NULL; } return '1'; }
/** * Standard modular run function for RSS hooks. * * @param string A list of categories we accept from * @param TIME Cutoff time, before which we do not show results from * @param string Prefix that represents the template set we use * @set RSS_ ATOM_ * @param string The standard format of date to use for the syndication type represented in the prefix * @param integer The maximum number of entries to return, ordering by date * @return ?array A pair: The main syndication section, and a title (NULL: error) */ function run($_filters, $cutoff, $prefix, $date_string, $max) { if (!addon_installed('cedi')) { return NULL; } if (!has_actual_page_access(get_member(), 'cedi')) { return NULL; } $filters = ocfilter_to_sqlfragment($_filters, 'id', 'seedy_children', 'parent_id', 'parent_id', 'child_id'); $content = new ocp_tempcode(); $rows = $GLOBALS['SITE_DB']->query('SELECT * FROM ' . $GLOBALS['SITE_DB']->get_table_prefix() . 'seedy_pages WHERE ' . $filters . ' AND add_date>' . strval((int) $cutoff) . ' ORDER BY add_date DESC', $max); foreach ($rows as $row) { $id = strval($row['id']); if (!has_category_access(get_member(), 'seedy_page', strval($row['id']))) { continue; } $author = ''; $news_date = date($date_string, $row['add_date']); $edit_date = ''; $news_title = xmlentities(escape_html(get_translated_text($row['title']))); $_summary = get_translated_tempcode($row['description']); $summary = xmlentities($_summary->evaluate()); $news = ''; $category = ''; $category_raw = ''; $view_url = build_url(array('page' => 'cedi', 'type' => 'misc', 'id' => $row['id'] == db_get_first_id() ? NULL : $row['id']), get_module_zone('cedi'), NULL, false, false, true); $if_comments = new ocp_tempcode(); $content->attach(do_template($prefix . 'ENTRY', array('VIEW_URL' => $view_url, 'SUMMARY' => $summary, 'EDIT_DATE' => $edit_date, 'IF_COMMENTS' => $if_comments, 'TITLE' => $news_title, 'CATEGORY_RAW' => $category_raw, 'CATEGORY' => $category, 'AUTHOR' => $author, 'ID' => $id, 'NEWS' => $news, 'DATE' => $news_date))); } require_lang('cedi'); return array($content, do_lang('CEDI_PAGES')); }
/** * 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('syndication_blocks')) { return array(); } return array(array('main_rss' => array('YES', 'NO')), array('side_rss' => array('PANEL_NONE', 'PANEL_NONE'))); }