本文整理汇总了PHP中get_forum_type函数的典型用法代码示例。如果您正苦于以下问题:PHP get_forum_type函数的具体用法?PHP get_forum_type怎么用?PHP get_forum_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_forum_type函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Standard modular run function.
*
* @return tempcode Results
*/
function run()
{
if (get_forum_type() != 'ocf') {
return new ocp_tempcode();
} else {
ocf_require_all_forum_stuff();
}
if (function_exists('set_time_limit')) {
@set_time_limit(0);
}
require_code('ocf_posts_action');
require_code('ocf_posts_action2');
// Members
$start = 0;
do {
$members = $GLOBALS['FORUM_DB']->query_select('f_members', array('id'), NULL, '', 500, $start);
foreach ($members as $member) {
ocf_force_update_member_post_count($member['id']);
$num_warnings = $GLOBALS['FORUM_DB']->query_value('f_warnings', 'COUNT(*)', array('w_member_id' => $member['id'], 'w_is_warning' => 1));
$GLOBALS['FORUM_DB']->query_update('f_members', array('m_cache_warnings' => $num_warnings), array('id' => $member['id']), '', 1);
}
$start += 500;
} while (array_key_exists(0, $members));
return new ocp_tempcode();
}
示例2: run_start
/**
* Standard aed_module run_start.
*
* @param ID_TEXT The type of module execution
* @return tempcode The output of the run
*/
function run_start($type)
{
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/forums';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_forums';
$this->add_one_label = do_lang_tempcode('ADD_FORUM');
$this->edit_this_label = do_lang_tempcode('EDIT_THIS_FORUM');
$this->edit_one_label = do_lang_tempcode('EDIT_FORUM');
global $C_TITLE;
$C_TITLE = NULL;
if (get_forum_type() != 'ocf') {
warn_exit(do_lang_tempcode('NO_OCF'));
} else {
ocf_require_all_forum_stuff();
}
require_code('ocf_forums_action');
require_code('ocf_forums_action2');
require_code('ocf_forums2');
require_css('ocf');
load_up_all_module_category_permissions($GLOBALS['FORUM_DRIVER']->get_guest_id(), 'forums');
if ($type == 'misc') {
return $this->misc();
}
if ($type == 'reorder') {
return $this->reorder();
}
return new ocp_tempcode();
}
示例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 (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'));
}
示例4: run
/**
* Standard modular run function.
*
* @return tempcode The result of execution.
*/
function run()
{
if (get_forum_type() != 'ocf') {
warn_exit(do_lang_tempcode('NO_OCF'));
} else {
ocf_require_all_forum_stuff();
}
require_code('ocf_forumview');
if (is_guest()) {
access_denied('NOT_AS_GUEST');
}
require_css('ocf');
$type = get_param('type', 'misc');
if ($type == 'misc') {
list($title, $content) = $this->new_posts();
} elseif ($type == 'unread') {
list($title, $content) = $this->unread_topics();
} elseif ($type == 'recently_read') {
list($title, $content) = $this->recently_read();
} else {
$title = new ocp_tempcode();
$content = new ocp_tempcode();
}
$ret = ocf_wrapper($title, do_template('OCF_VFORUM', array('_GUID' => '8dca548982d65500ab1800ceec2ddc61', 'CONTENT' => $content)));
return $ret;
}
示例5: 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'));
}
示例6: get_default
/**
* Gets the default value for the config option.
*
* @return ?string The default value (NULL: option is disabled)
*/
function get_default()
{
if (get_forum_type() != 'ocf') {
return NULL;
}
return '1';
}
示例7: run_start
/**
* Standard aed_module run_start.
*
* @param ID_TEXT The type of module execution
* @return tempcode The output of the run
*/
function run_start($type)
{
$GLOBALS['NO_DB_SCOPE_CHECK'] = true;
$GLOBALS['HELPER_PANEL_PIC'] = 'pagepics/customprofilefields';
$GLOBALS['HELPER_PANEL_TUTORIAL'] = 'tut_adv_members';
if (get_forum_type() != 'ocf') {
warn_exit(do_lang_tempcode('NO_OCF'));
} else {
ocf_require_all_forum_stuff();
}
require_code('ocf_members_action');
require_code('ocf_members_action2');
require_lang('fields');
require_lang('ocf');
$this->add_one_label = do_lang_tempcode('ADD_CUSTOM_PROFILE_FIELD');
$this->edit_this_label = do_lang_tempcode('EDIT_THIS_CUSTOM_PROFILE_FIELD');
$this->edit_one_label = do_lang_tempcode('EDIT_CUSTOM_PROFILE_FIELD');
if ($type == 'misc') {
return $this->misc();
}
if ($type == 'stats') {
return $this->stats();
}
if ($type == '_stats') {
return $this->_stats();
}
return new ocp_tempcode();
}
示例8: run
/**
* Standard modular run function for OcCLE hooks.
*
* @param array The options with which the command was called
* @param array The parameters with which the command was called
* @param array A reference to the OcCLE filesystem object
* @return ~array Array of stdcommand, stdhtml, stdout, and stderr responses (false: error)
*/
function run($options, $parameters, &$occle_fs)
{
if (array_key_exists('h', $options) || array_key_exists('help', $options)) {
return array('', do_command_help('ban_member', array('h', 'u'), array(true, true)), '', '');
} else {
if (get_forum_type() != 'ocf') {
return array('', '', '', do_lang('NO_OCF'));
}
if (!array_key_exists(0, $parameters)) {
return array('', '', '', do_lang('MISSING_PARAM', '1', 'ban_member'));
}
require_code('ocf_members_action');
require_code('ocf_members_action2');
require_lang('ocf');
if (is_numeric($parameters[0])) {
$member_id = $parameters[0];
} else {
$member_id = $GLOBALS['FORUM_DRIVER']->get_member_from_username($parameters[0]);
}
if (is_null($member_id)) {
return array('', '', '', do_lang('USER_NO_EXIST'));
}
if (array_key_exists('u', $options) || array_key_exists('unban', $options)) {
ocf_unban_member($member_id);
} else {
ocf_ban_member($member_id);
}
return array('', '', do_lang('SUCCESS'), '');
}
}
示例9: 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()
{
if (get_forum_type() != 'ocf') {
return NULL;
}
$info = array();
$info['connection'] = $GLOBALS['FORUM_DB'];
$info['table'] = 'f_topics';
$info['date_field'] = 't_cache_first_time';
$info['id_field'] = 'id';
$info['add_url'] = '';
$info['category_field'] = 't_forum_id';
$info['category_type'] = 'forums';
$info['parent_spec__table_name'] = 'f_forums';
$info['parent_spec__parent_name'] = 'f_parent_forum';
$info['parent_spec__field_name'] = 'id';
$info['parent_field_name'] = 't_forum_id';
$info['submitter_field'] = 't_cache_first_member_id';
$info['id_is_string'] = false;
require_lang('ocf');
$info['title'] = do_lang_tempcode('SPECIFIC_FORUM_TOPICS');
$info['validated_field'] = 't_validated';
$info['category_is_string'] = false;
$info['archive_url'] = build_url(array('page' => 'forumview'), get_module_zone('forumview'));
$info['cms_page'] = 'topics';
$info['views_field'] = 't_num_views';
$info['supports_custom_fields'] = true;
return $info;
}
示例10: run
/**
* Standard modular run function for search results.
*
* @param string Search string
* @param boolean Whether to only do a META (tags) search
* @param ID_TEXT Order direction
* @param integer Start position in total results
* @param integer Maximum results to return in total
* @param boolean Whether only to search titles (as opposed to both titles and content)
* @param string Where clause that selects the content according to the main search string (SQL query fragment) (blank: full-text search)
* @param SHORT_TEXT Username/Author to match for
* @param ?MEMBER Member-ID to match for (NULL: unknown)
* @param TIME Cutoff date
* @param string The sort type (gets remapped to a field in this function)
* @set title add_date
* @param integer Limit to this number of results
* @param string What kind of boolean search to do
* @set or and
* @param string Where constraints known by the main search code (SQL query fragment)
* @param string Comma-separated list of categories to search under
* @param boolean Whether it is a boolean search
* @return array List of maps (template, orderer)
*/
function run($content, $only_search_meta, $direction, $max, $start, $only_titles, $content_where, $author, $author_id, $cutoff, $sort, $limit_to, $boolean_operator, $where_clause, $search_under, $boolean_search)
{
unset($limit_to);
if (get_forum_type() != 'ocf') {
return array();
}
$remapped_orderer = '';
switch ($sort) {
case 'title':
$remapped_orderer = 'g_name';
break;
}
require_lang('ocf');
// Calculate our where clause (search)
$sq = build_search_submitter_clauses('g_group_leader', $author_id, $author);
if (is_null($sq)) {
return array();
} else {
$where_clause .= $sq;
}
$where_clause .= ' AND ';
$where_clause .= 'g_hidden=0 AND g_is_private_club=1';
// Calculate and perform query
$rows = get_search_rows(NULL, NULL, $content, $boolean_search, $boolean_operator, $only_search_meta, $direction, $max, $start, $only_titles, 'f_groups r', array('!', 'r.g_name', 'r.g_title'), $where_clause, $content_where, $remapped_orderer, 'r.*');
$out = array();
foreach ($rows as $i => $row) {
$out[$i]['data'] = $row;
unset($rows[$i]);
if ($remapped_orderer != '' && array_key_exists($remapped_orderer, $row)) {
$out[$i]['orderer'] = $row[$remapped_orderer];
}
}
return $out;
}
示例11: get_attachments
/**
* Get what we need to get attachments in a form-field interface.
*
* @param ID_TEXT The name of the field attachments are for
* @return array A pair: the attachments UI (tempcode), the hidden attachment field
*/
function get_attachments($posting_field_name)
{
$image_types = str_replace(',', ', ', get_option('valid_images'));
require_lang('javascript');
require_javascript('javascript_swfupload');
require_css('swfupload');
require_code('files2');
$max_attach_size = get_max_file_size(get_member(), $GLOBALS['SITE_DB']);
$attach_size_field = form_input_hidden('MAX_FILE_SIZE', strval($max_attach_size));
$num_attachments = post_param_integer('num_attachments', has_js() ? 1 : 3);
$attachments = new ocp_tempcode();
for ($i = 1; $i <= $num_attachments; $i++) {
$attachments->attach(do_template('ATTACHMENT', array('_GUID' => 'c3b38ca70cbd1c5f9cf91bcae9ed1134', 'POSTING_FIELD_NAME' => $posting_field_name, 'I' => strval($i))));
}
if (get_forum_type() == 'ocf') {
require_code('ocf_groups');
require_lang('ocf');
$max_attachments = ocf_get_member_best_group_property(get_member(), 'max_attachments_per_post');
} else {
$max_attachments = 100;
}
$attachment_template = do_template('ATTACHMENT', array('_GUID' => 'c3b38ca70cbd1c5f9cf91bcae9ed11dsds', 'POSTING_FIELD_NAME' => $posting_field_name, 'I' => '__num_attachments__'));
$attachments = do_template('ATTACHMENTS', array('_GUID' => '054921e7c09412be479676759accf222', 'POSTING_FIELD_NAME' => $posting_field_name, 'ATTACHMENT_TEMPLATE' => $attachment_template, 'IMAGE_TYPES' => $image_types, 'ATTACHMENTS' => $attachments, 'MAX_ATTACHMENTS' => strval($max_attachments), 'NUM_ATTACHMENTS' => strval($num_attachments)));
return array($attachments, $attach_size_field);
}
示例12: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
$forum = get_forum_type();
$out = new ocp_tempcode();
if ($forum != 'none') {
// Standard welcome back vs into greeting
$member = get_member();
if (is_guest($member)) {
$redirect = get_self_url(true, true);
$login_url = build_url(array('page' => 'login', 'type' => 'misc', 'redirect' => $redirect), get_module_zone('login'));
$join_url = $GLOBALS['FORUM_DRIVER']->join_url();
$join_bits = do_template('JOIN_OR_LOGIN', array('LOGIN_URL' => $login_url, 'JOIN_URL' => $join_url));
$p = do_lang_tempcode('WELCOME', $join_bits);
$out->attach(paragraph($p, 'hhrt4dsgdsgd'));
} else {
$out->attach(paragraph(do_lang_tempcode('WELCOME_BACK', escape_html($GLOBALS['FORUM_DRIVER']->get_username($member))), 'gfgdf9gjd'));
}
}
$message = get_option('welcome_message');
if (has_actual_page_access(get_member(), 'admin_config')) {
if ($message != '') {
$message .= ' [[page="_SEARCH:admin_config:category:SITE#group_GENERAL"]' . do_lang('EDIT') . '[/page]]';
}
}
$out->attach(comcode_to_tempcode($message, NULL, true));
return $out;
}
示例13: run
/**
* Standard modular run function.
*
* @param array A map of parameters.
* @return tempcode The result of execution.
*/
function run($map)
{
unset($map);
require_lang('custom_comcode');
$tags = array();
$wmap = array('tag_enabled' => 1);
if (!has_specific_permission(get_member(), 'comcode_dangerous')) {
$wmap['tag_dangerous_tag'] = 0;
}
$tags = array_merge($tags, $GLOBALS['SITE_DB']->query_select('custom_comcode', array('tag_title', 'tag_description', 'tag_example', 'tag_parameters', 'tag_replace', 'tag_tag', 'tag_dangerous_tag', 'tag_block_tag', 'tag_textual_tag'), $wmap));
if (isset($GLOBALS['FORUM_DB']) && $GLOBALS['FORUM_DB']->connection_write != $GLOBALS['SITE_DB']->connection_write && get_forum_type() == 'ocf') {
$tags = array_merge($tags, $GLOBALS['FORUM_DB']->query_select('custom_comcode', array('tag_title', 'tag_description', 'tag_example', 'tag_parameters', 'tag_replace', 'tag_tag', 'tag_dangerous_tag', 'tag_block_tag', 'tag_textual_tag'), $wmap));
}
// From Comcode hooks
$hooks = find_all_hooks('systems', 'comcode');
foreach (array_keys($hooks) as $hook) {
require_code('hooks/systems/comcode/' . filter_naughty_harsh($hook));
$object = object_factory('Hook_comcode_' . filter_naughty_harsh($hook), true);
$tags[] = $object->get_tag();
}
if (!array_key_exists(0, $tags)) {
return paragraph(do_lang_tempcode('NONE_EM'), '', 'nothing_here');
}
$content = new ocp_tempcode();
foreach ($tags as $tag) {
$content->attach(do_template('CUSTOM_COMCODE_TAG_ROW', array('_GUID' => '28c257f5d0c596aa828fd9556b0df4a9', 'TITLE' => is_string($tag['tag_title']) ? $tag['tag_title'] : get_translated_text($tag['tag_title']), 'DESCRIPTION' => is_string($tag['tag_description']) ? $tag['tag_description'] : get_translated_text($tag['tag_description']), 'EXAMPLE' => $tag['tag_example'])));
}
return do_template('BLOCK_MAIN_CUSTOM_COMCODE_TAGS', array('_GUID' => 'b8d3436e6e5fe679ae9b0a368e607610', 'TAGS' => $content));
}
示例14: restrictify
/**
* Add ocPortal's strictness, after finishing with third-party code. To be run optionally at some point after destrictify().
*/
function restrictify()
{
global $_CREATED_FILES, $_MODIFIED_FILES;
// Reset functions
if (isset($_CREATED_FILES)) {
$_CREATED_FILES = array();
}
if (isset($_MODIFIED_FILES)) {
$_MODIFIED_FILES = array();
}
// Put back strictness
error_reporting(E_ALL);
if (function_exists('set_time_limit')) {
@set_time_limit(25);
}
if (get_forum_type() == 'ocf') {
$GLOBALS['SITE_DB']->query('SET sql_mode=STRICT_ALL_TABLES', NULL, NULL, true);
}
if ($GLOBALS['DEBUG_MODE']) {
@ini_set('ocproducts.type_strictness', '1');
global $PREVIOUS_XSS_STATE;
//safe_ini_set('ocproducts.xss_detect',array_pop($PREVIOUS_XSS_STATE)); We don't maintain this in v8, since we increased checking strength but are not fixing all the new false-positives. Real issues are found in v9 and back-ported.
}
@ini_set('include_path', '');
@ini_set('allow_url_fopen', '0');
@ini_set('suhosin.executor.disable_emodifier', '1');
@ini_set('suhosin.executor.multiheader', '1');
$GLOBALS['NO_DB_SCOPE_CHECK'] = false;
//$GLOBALS['NO_QUERY_LIMIT']=false; Leave off, may have been set elsewhere than destrictify();
}
示例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('ocf_forum')) {
return array();
}
if (get_forum_type() != 'ocf') {
return array();
}
require_lang('ocf_config');
$forum_id = $GLOBALS['FORUM_DRIVER']->forum_id_from_name(get_option('reported_posts_forum'));
if (is_null($forum_id)) {
return array();
}
$where = 't_forum_id=' . strval($forum_id) . ' AND t_is_open=1';
$query = 'SELECT COUNT(*) FROM ' . $GLOBALS['FORUM_DB']->get_table_prefix() . 'f_topics WHERE ' . $where;
$outstanding = $GLOBALS['FORUM_DB']->query_value_null_ok_full($query);
if ($outstanding > 0) {
$status = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_0', array('_GUID' => 'e578142633c6f3d37776e82a869deb91'));
} else {
$status = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM_STATUS_1', array('_GUID' => 'f578142633c6f3d37776e82a869deb91'));
}
$url = $GLOBALS['FORUM_DRIVER']->forum_url($forum_id);
$tpl = do_template('BLOCK_MAIN_STAFF_CHECKLIST_ITEM', array('URL' => $url, 'STATUS' => $status, 'TASK' => do_lang_tempcode('REPORTED_POSTS_FORUM'), 'INFO' => do_lang_tempcode('NUM_QUEUE', escape_html(integer_format($outstanding)))));
return array(array($tpl, NULL, $outstanding, NULL));
}