当前位置: 首页>>代码示例>>PHP>>正文


PHP get_param_integer函数代码示例

本文整理汇总了PHP中get_param_integer函数的典型用法代码示例。如果您正苦于以下问题:PHP get_param_integer函数的具体用法?PHP get_param_integer怎么用?PHP get_param_integer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了get_param_integer函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
  *
  * @return tempcode  The snippet
  */
 function run()
 {
     $type = get_param('type');
     if (!has_zone_access(get_member(), 'adminzone')) {
         return new ocp_tempcode();
     }
     decache('main_staff_checklist');
     require_lang('staff_checklist');
     switch ($type) {
         case 'add':
             $recurinterval = get_param_integer('recurinterval', 0);
             $task_title = get_param('tasktitle', false, true);
             $id = $GLOBALS['SITE_DB']->query_insert('customtasks', array('tasktitle' => $task_title, 'datetimeadded' => time(), 'recurinterval' => $recurinterval, 'recurevery' => get_param('recurevery'), 'taskisdone' => NULL), true);
             require_code('notifications');
             $subject = do_lang('CT_NOTIFICATION_MAIL_SUBJECT', get_site_name(), $task_title);
             $mail = do_lang('CT_NOTIFICATION_MAIL', comcode_escape(get_site_name()), comcode_escape($task_title));
             dispatch_notification('checklist_task', NULL, $subject, $mail);
             return do_template('BLOCK_MAIN_STAFF_CHECKLIST_CUSTOM_TASK', array('TASKTITLE' => comcode_to_tempcode(get_param('tasktitle', false, true)), 'DATETIMEADDED' => display_time_period(time()), 'RECURINTERVAL' => $recurinterval == 0 ? '' : integer_format($recurinterval), 'RECUREVERY' => get_param('recurevery'), 'TASKDONE' => 'not_completed', 'ID' => strval($id)));
         case 'delete':
             $GLOBALS['SITE_DB']->query_delete('customtasks', array('id' => get_param_integer('id')), '', 1);
             break;
         case 'mark_done':
             $GLOBALS['SITE_DB']->query_update('customtasks', array('taskisdone' => time()), array('id' => get_param_integer('id')), '', 1);
             break;
         case 'mark_undone':
             $GLOBALS['SITE_DB']->query_update('customtasks', array('taskisdone' => NULL), array('id' => get_param_integer('id')), '', 1);
             break;
     }
     return new ocp_tempcode();
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:35,代码来源:checklist_task_manage.php

示例2: ocf_make_poll

/**
 * Add a forum poll.
 *
 * @param  AUTO_LINK		The ID of the topic to add the poll to.
 * @param  SHORT_TEXT	The question.
 * @param  BINARY			Whether the result tallies are kept private until the poll is made non-private.
 * @param  BINARY			Whether the poll is open for voting.
 * @param  integer		The minimum number of selections that may be made.
 * @param  integer		The maximum number of selections that may be made.
 * @param  BINARY			Whether members must have a post in the topic before they made vote.
 * @param  array			A list of pairs of the potential voteable answers and the number of votes.
 * @param  boolean		Whether to check there are permissions to make the poll.
 * @return AUTO_LINK 	The ID of the newly created forum poll.
 */
function ocf_make_poll($topic_id, $question, $is_private, $is_open, $minimum_selections, $maximum_selections, $requires_reply, $answers, $check_permissions = true)
{
    require_code('ocf_polls');
    if ($check_permissions && !ocf_may_attach_poll($topic_id)) {
        access_denied('I_ERROR');
    }
    $poll_id = $GLOBALS['FORUM_DB']->query_insert('f_polls', array('po_question' => $question, 'po_cache_total_votes' => 0, 'po_is_private' => $is_private, 'po_is_open' => $is_open, 'po_minimum_selections' => $minimum_selections, 'po_maximum_selections' => $maximum_selections, 'po_requires_reply' => $requires_reply), true);
    foreach ($answers as $answer) {
        if (is_array($answer)) {
            list($answer, $num_votes) = $answer;
        } else {
            $num_votes = 0;
        }
        $GLOBALS['FORUM_DB']->query_insert('f_poll_answers', array('pa_poll_id' => $poll_id, 'pa_answer' => $answer, 'pa_cache_num_votes' => $num_votes));
    }
    $map = array('t_poll_id' => $poll_id);
    // Now make the topic validated if this is attaching immediately
    if (get_param_integer('re_validate', 0) == 1) {
        $forum_id = $GLOBALS['FORUM_DB']->query_value('f_topics', 't_forum_id', array('id' => $topic_id));
        if (is_null($forum_id) || has_specific_permission(get_member(), 'bypass_validation_midrange_content', 'topics', array('forums', $forum_id))) {
            $map['t_validated'] = 1;
        }
    }
    $GLOBALS['FORUM_DB']->query_update('f_topics', $map, array('id' => $topic_id), '', 1);
    return $poll_id;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:40,代码来源:ocf_polls_action.php

示例3: chat_poller

/**
 * Function to quickly (efficiently) check to see if there's been any chat activity.
 */
function chat_poller()
{
    $message_id = get_param_integer('message_id', -1);
    $event_id = get_param_integer('event_id', -1);
    if (file_exists(get_custom_file_base() . '/data_custom/modules/chat/chat_last_full_check.dat') && filemtime(get_custom_file_base() . '/data_custom/modules/chat/chat_last_full_check.dat') > time() - 3 && ($message_id != -1 && file_exists(get_custom_file_base() . '/data_custom/modules/chat/chat_last_msg.dat') && intval(file_get_contents(get_custom_file_base() . '/data_custom/modules/chat/chat_last_msg.dat', FILE_TEXT)) <= $message_id) && ($event_id != -1 && file_exists(get_custom_file_base() . '/data_custom/modules/chat/chat_last_event.dat') && intval(file_get_contents(get_custom_file_base() . '/data_custom/modules/chat/chat_last_event.dat', FILE_TEXT)) <= $event_id)) {
        load_user_stuff();
        require_code('zones');
        // Zone is needed because zones are where all ocPortal pages reside
        require_code('config');
        // Config is needed for much active stuff
        require_code('users');
        // Users are important due to permissions
        $room_id = get_param_integer('room_id', -1);
        require_code('chat');
        chat_room_prune($room_id);
        header("Cache-Control: no-cache, must-revalidate");
        // HTTP/1.1
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        // Date in the past
        header('Content-Type: application/xml');
        $output = '<?xml version="1.0" encoding="' . get_charset() . '" ?' . '>
			<response>
				<result>
					<chat_null>' . strval($room_id) . '</chat_null>
				</result>
			</response>';
        exit($output);
    }
    touch(get_custom_file_base() . '/data_custom/modules/chat/chat_last_full_check.dat');
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:chat_poller.php

示例4: _handle_permission_check_logging

/**
 * Log permission checks to the permission_checks.log file
 *
 * @param  MEMBER         The user checking against
 * @param  ID_TEXT        The function that was called to check a permission
 * @param  array          Parameters to this permission-checking function
 * @param  boolean        Whether the permission was held
 */
function _handle_permission_check_logging($member, $op, $params, $result)
{
    global $PERMISSION_CHECK_LOGGER;
    if ($op == 'has_specific_permission') {
        require_all_lang();
        $params[0] = $params[0] . ' ("' . do_lang('PT_' . $params[0]) . '")';
    }
    $str = $op;
    if (count($params) != 0) {
        $str .= ': ';
        foreach ($params as $i => $p) {
            if ($i != 0) {
                $str .= ',';
            }
            $str .= is_string($p) ? $p : (is_null($p) ? '' : strval($p));
        }
    }
    if ($PERMISSION_CHECK_LOGGER !== false && !$result) {
        fwrite($PERMISSION_CHECK_LOGGER, "\t" . $str);
        $username = $GLOBALS['FORUM_DRIVER']->get_username($member);
        if (is_null($username)) {
            $username = do_lang('UNKNOWN');
        }
        if ($member != get_member()) {
            fwrite($PERMISSION_CHECK_LOGGER, ' -- ' . $username);
        }
        //	fwrite($PERMISSION_CHECK_LOGGER,' --> '.($result?do_lang('YES'):do_lang('NO')).chr(10));
        fwrite($PERMISSION_CHECK_LOGGER, chr(10));
        sync_file(get_custom_file_base() . '/data_custom/permissioncheckslog.php');
    }
    if (function_exists('fb') && get_param_integer('keep_firephp', 0) == 1 && !headers_sent()) {
        fb('Permission check ' . ($result ? 'PASSED' : 'FAILED') . ': ' . $str);
    }
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:42,代码来源:permissions2.php

示例5: rules_script

/**
 * Pop-up some rules.
 */
function rules_script()
{
    $id = get_param_integer('id', NULL);
    if (is_null($id)) {
        require_code('site');
        $output = request_page('rules', true);
        $title = do_lang_tempcode('RULES');
    } else {
        if (!has_category_access(get_member(), 'forums', strval($id))) {
            warn_exit(do_lang_tempcode('ACCESS_DENIED'));
        }
        $forum_rows = $GLOBALS['FORUM_DB']->query_select('f_forums', array('*'), array('id' => $id), '', 1);
        if (!array_key_exists(0, $forum_rows)) {
            warn_exit(do_lang_tempcode('MISSING_RESOURCE'));
        }
        $forum_row = $forum_rows[0];
        require_lang('ocf');
        $question = get_translated_tempcode($forum_row['f_intro_question'], $GLOBALS['FORUM_DB']);
        $answer = $forum_row['f_intro_answer'];
        $output = do_template('OCF_FORUM_INTRO_QUESTION_POPUP', array('_GUID' => '6f2dc12b616219ff982654b73ef979b2', 'QUESTION' => $question, 'ANSWER' => $answer));
        $title = $answer == '' ? do_lang_tempcode('FORUM_RULES') : do_lang_tempcode('INTRO_QUESTION');
    }
    $tpl = do_template('POPUP_HTML_WRAP', array('_GUID' => '26c4dbc7a4737310f089583f1048cb13', 'TITLE' => $title, 'TARGET' => '_top', 'CONTENT' => $output));
    $tpl->evaluate_echo();
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:28,代码来源:ocf_popups.php

示例6: init__database__xml

/**
 * Standard code module initialisation function.
 */
function init__database__xml()
{
    global $SCHEMA_CACHE, $DIR_CONTENTS_CACHE;
    $SCHEMA_CACHE = array();
    $DIR_CONTENTS_CACHE = array();
    global $DELIMITERS_FLIPPED, $DELIMITERS, $SYMBOL_DELIMINITER, $DELIMITERS_ALPHA;
    $DELIMITERS = array_merge(array("\t", ' ', "\n"), _get_sql_keywords());
    sort($DELIMITERS);
    $DELIMITERS_FLIPPED = array_flip($DELIMITERS);
    $SYMBOL_DELIMINITER = array_flip(array("\t", ' ', "\n", '+', '-', '*', '/', '>', '<', '=', "'", '"', "\\'", '(', ')', ','));
    foreach ($DELIMITERS as $d) {
        if (!isset($DELIMITERS_ALPHA[$d[0]])) {
            $DELIMITERS_ALPHA[$d[0]] = array();
        }
        $DELIMITERS_ALPHA[$d[0]][] = $d;
    }
    global $TABLE_BASES;
    $TABLE_BASES = array();
    // Support for chaining a DB- to make reads faster
    global $SITE_INFO;
    if (array_key_exists('db_chain_type', $SITE_INFO) && !running_script('xml_db_import') && get_param_integer('keep_no_chain', 0) != 1) {
        require_code('database/' . $SITE_INFO['db_chain_type']);
        $GLOBALS['XML_CHAIN_DB'] = new database_driver($SITE_INFO['db_chain'], $SITE_INFO['db_chain_host'], $SITE_INFO['db_chain_user'], $SITE_INFO['db_chain_password'], get_table_prefix(), false, object_factory('Database_Static_' . $SITE_INFO['db_chain_type']));
    } else {
        $GLOBALS['XML_CHAIN_DB'] = NULL;
    }
    if (function_exists('set_time_limit')) {
        @set_time_limit(100);
    }
    // XML DB is *slow*
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:34,代码来源:xml.php

示例7: auth_set

 function auth_set($member_id, $oauth_url)
 {
     require_lang('twitter');
     require_code('twitter');
     $api_key = get_option('twitter_api_key', true);
     $api_secret = get_option('twitter_api_secret', true);
     $twitter = new Twitter($api_key, $api_secret);
     if (get_param_integer('oauth_in_progress', 0) == 0) {
         $response = $twitter->oAuthRequestToken($oauth_url->evaluate());
         $twitter->oAuthAuthorize($response['oauth_token']);
         exit;
     }
     $response = $twitter->oAuthAccessToken(get_param('oauth_token'), get_param('oauth_verifier'));
     if (!isset($response['oauth_token'])) {
         attach_message(do_lang_tempcode('TWITTER_OAUTH_FAIL', escape_html($response['message'])), 'warn');
         return false;
     }
     $save_to = 'twitter_oauth_token';
     if (!is_null($member_id)) {
         $save_to .= '__' . strval($member_id);
     }
     set_long_value($save_to, $response['oauth_token']);
     $save_to = 'twitter_oauth_token_secret';
     if (!is_null($member_id)) {
         $save_to .= '__' . strval($member_id);
     }
     set_long_value($save_to, $response['oauth_token_secret']);
     return true;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:29,代码来源:twitter.php

示例8: run

 /**
  * Standard modular run function for snippet hooks. Generates XHTML to insert into a page using AJAX.
  *
  * @return tempcode  The snippet
  */
 function run()
 {
     $sup = get_param('block_map_sup', '', true);
     $_map = get_param('block_map', false, true);
     if ($sup != '') {
         $_map .= ',' . $sup;
     }
     require_code('blocks');
     $map = block_params_str_to_arr($_map);
     if (!array_key_exists('block', $map)) {
         return new ocp_tempcode();
     }
     $auth_key = get_param_integer('auth_key');
     // Check permissions
     $test = $GLOBALS['SITE_DB']->query_value_null_ok('temp_block_permissions', 'p_block_constraints', array('p_session_id' => get_session_id(), 'id' => $auth_key));
     if (is_null($test) || !block_signature_check(block_params_str_to_arr($test), $map)) {
         require_lang('permissions');
         return paragraph(do_lang_tempcode('ACCESS_DENIED__ACCESS_DENIED', escape_html($map['block'])));
     }
     // Cleanup
     $GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'temp_block_permissions WHERE p_time<' . strval(time() - 60 * 60 * intval(get_option('session_expiry_time'))));
     // Return block snippet
     global $CSSS, $JAVASCRIPTS;
     $CSSS = array();
     $JAVASCRIPTS = array();
     $out = new ocp_tempcode();
     $out->attach(symbol_tempcode('CSS_TEMPCODE'));
     $out->attach(symbol_tempcode('JS_TEMPCODE'));
     $out->attach(do_block($map['block'], $map));
     return $out;
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:36,代码来源:block.php

示例9: 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));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:main_download_tease.php

示例10: ocf_check_post

/**
 * Check a post would be valid.
 *
 * @param  LONG_TEXT		The post.
 * @param  ?AUTO_LINK	The ID of the topic the post would be in (NULL: don't check with regard to any particular topic).
 * @param  ?MEMBER		The poster (NULL: current member).
 * @return ?array			Row of the existing post if a double post (single row map-element in a list of rows) (NULL: not a double post).
 */
function ocf_check_post($post, $topic_id = NULL, $poster = NULL)
{
    if (is_null($poster)) {
        $poster = get_member();
    }
    require_code('comcode_check');
    check_comcode($post, NULL, false, NULL, true);
    if (strlen($post) == 0) {
        warn_exit(do_lang_tempcode('POST_TOO_SHORT'));
    }
    require_code('ocf_groups');
    if (strlen($post) > ocf_get_member_best_group_property($poster, 'max_post_length_comcode')) {
        warn_exit(make_string_tempcode(escape_html(do_lang('_POST_TOO_LONG'))));
    }
    if (!is_null($topic_id)) {
        if (running_script('stress_test_loader')) {
            return NULL;
        }
        // Check this isn't the same as the last post here
        $last_posts = $GLOBALS['FORUM_DB']->query_select('f_posts', array('p_post', 'p_poster', 'p_ip_address'), array('p_topic_id' => $topic_id), 'ORDER BY p_time DESC,id DESC', 1);
        if (array_key_exists(0, $last_posts)) {
            if ($last_posts[0]['p_poster'] == $GLOBALS['OCF_DRIVER']->get_guest_id() && get_ip_address() != $last_posts[0]['p_ip_address']) {
                $last_posts[0]['p_poster'] = -1;
            }
            if ($last_posts[0]['p_poster'] == $poster && get_translated_text($last_posts[0]['p_post'], $GLOBALS['FORUM_DB']) == $post && get_param_integer('keep_debug_notifications', 0) != 1) {
                warn_exit(do_lang_tempcode('DOUBLE_POST_PREVENTED'));
            }
        }
        return $last_posts;
    }
    return NULL;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:40,代码来源:ocf_posts_action.php

示例11: get_page_warning_details

/**
 * A page is not validated, so show a warning.
 *
 * @param  ID_TEXT		The zone the page is being loaded from
 * @param  ID_TEXT		The codename of the page
 * @param  tempcode		The edit URL (blank if no edit access)
 * @return tempcode		The warning
 */
function get_page_warning_details($zone, $codename, $edit_url)
{
    $warning_details = new ocp_tempcode();
    if (!has_specific_permission(get_member(), 'jump_to_unvalidated')) {
        access_denied('SPECIFIC_PERMISSION', 'jump_to_unvalidated');
    }
    $uv_warning = do_lang_tempcode(get_param_integer('redirected', 0) == 1 ? 'UNVALIDATED_TEXT_NON_DIRECT' : 'UNVALIDATED_TEXT');
    // Wear sun cream
    if (!$edit_url->is_empty()) {
        $menu_links = $GLOBALS['SITE_DB']->query('SELECT DISTINCT i_menu FROM ' . get_table_prefix() . 'menu_items WHERE ' . db_string_equal_to('i_url', $zone . ':' . $codename) . ' OR ' . db_string_equal_to('i_url', '_SEARCH:' . $codename));
        if (count($menu_links) != 0) {
            $menu_items_linking = new ocp_tempcode();
            foreach ($menu_links as $menu_link) {
                if (!$menu_items_linking->is_empty()) {
                    $menu_items_linking->attach(do_lang_tempcode('LIST_SEP'));
                }
                $menu_edit_url = build_url(array('page' => 'admin_menus', 'type' => 'edit', 'id' => $menu_link['i_menu']), get_module_zone('admin_menus'));
                $menu_items_linking->attach(hyperlink($menu_edit_url, $menu_link['i_menu'], false, true));
            }
            $uv_warning = do_lang_tempcode('UNVALIDATED_TEXT_STAFF', $menu_items_linking);
        }
    }
    $warning_details->attach(do_template('WARNING_TABLE', array('WARNING' => $uv_warning)));
    return $warning_details;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:33,代码来源:site2.php

示例12: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     global $NON_CANONICAL_PARAMS;
     $NON_CANONICAL_PARAMS[] = 'max';
     $category_id = array_key_exists('param', $map) ? intval($map['param']) : db_get_first_id();
     $max = get_param_integer('max', array_key_exists('max', $map) ? intval($map['max']) : 30);
     $start = get_param_integer('start', 0);
     $root = array_key_exists('root', $map) && $map['root'] != '' ? intval($map['root']) : get_param_integer('root', NULL);
     $sort = array_key_exists('sort', $map) ? $map['sort'] : '';
     $search = array_key_exists('search', $map) ? $map['search'] : '';
     require_lang('catalogues');
     require_code('catalogues');
     require_code('feedback');
     require_css('catalogues');
     $select = NULL;
     if (!is_null($map) && array_key_exists('select', $map)) {
         require_code('ocfiltering');
         $select = ocfilter_to_sqlfragment($map['select'], 'e.id', 'catalogue_categories', 'cc_parent_id', 'cc_id', 'id');
     }
     $categories = $GLOBALS['SITE_DB']->query_select('catalogue_categories', array('*'), array('id' => $category_id), '', 1);
     if (!array_key_exists(0, $categories)) {
         return do_lang_tempcode('MISSING_RESOURCE');
     }
     $category = $categories[0];
     $catalogue_name = $category['c_name'];
     $catalogues = $GLOBALS['SITE_DB']->query_select('catalogues', array('*'), array('c_name' => $catalogue_name), '', 1);
     $catalogue = $catalogues[0];
     $tpl_set = array_key_exists('template_set', $map) ? $map['template_set'] : $catalogue_name;
     $display_type = array_key_exists('display_type', $map) ? intval($map['display_type']) : NULL;
     list($entry_buildup, , , ) = get_catalogue_category_entry_buildup(is_null($select) ? $category_id : NULL, $catalogue_name, $catalogue, 'CATEGORY', $tpl_set, $max, $start, $select, $root, $display_type, true, NULL, $search, $sort);
     return do_template('CATALOGUE_' . $tpl_set . '_CATEGORY_EMBED', array('ROOT' => strval($root), 'CATALOGUE' => $catalogue_name, 'ENTRIES' => $entry_buildup), NULL, false, 'CATALOGUE_DEFAULT_CATEGORY_EMBED');
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:38,代码来源:main_cc_embed.php

示例13: run

 /**
  * Standard modular run function.
  *
  * @param  array		A map of parameters.
  * @return tempcode	The result of execution.
  */
 function run($map)
 {
     unset($map);
     require_all_lang();
     require_css('adminzone');
     require_code('actionlog');
     $start = get_param_integer('sa_start', 0);
     $max = get_param_integer('sa_max', 10);
     $sortables = array('date_and_time' => do_lang_tempcode('DATE_TIME'), 'the_type' => do_lang_tempcode('ACTION'));
     $test = explode(' ', get_param('sa_sort', 'date_and_time DESC'), 2);
     if (count($test) == 1) {
         $test[1] = 'DESC';
     }
     list($sortable, $sort_order) = $test;
     if (strtoupper($sort_order) != 'ASC' && strtoupper($sort_order) != 'DESC' || !array_key_exists($sortable, $sortables)) {
         log_hack_attack_and_exit('ORDERBY_HACK');
     }
     global $NON_CANONICAL_PARAMS;
     $NON_CANONICAL_PARAMS[] = 'sa_sort';
     require_code('templates_results_table');
     $fields_title = results_field_title(array(do_lang_tempcode('USERNAME'), do_lang_tempcode('DATE_TIME'), do_lang_tempcode('ACTION'), do_lang_tempcode('PARAMETER_A'), do_lang_tempcode('PARAMETER_B')), $sortables, 'sa_sort', $sortable . ' ' . $sort_order);
     $max_rows = $max;
     //Don't want to encourage pagination (there's a better module they can go to) $GLOBALS['SITE_DB']->query_value('adminlogs','COUNT(*)');
     $rows = $GLOBALS['SITE_DB']->query_select('adminlogs', array('the_type', 'param_a', 'param_b', 'the_user', 'ip', 'date_and_time'), NULL, 'ORDER BY ' . $sortable . ' ' . $sort_order, $max, $start);
     $fields = new ocp_tempcode();
     foreach ($rows as $myrow) {
         $username = $GLOBALS['FORUM_DRIVER']->get_username($myrow['the_user']);
         if (is_null($username)) {
             $username = do_lang('UNKNOWN');
         }
         $date = get_timezoned_date($myrow['date_and_time']);
         if (!is_null($myrow['param_a'])) {
             $a = $myrow['param_a'];
         } else {
             $a = '';
         }
         if (!is_null($myrow['param_b'])) {
             $b = $myrow['param_b'];
         } else {
             $b = '';
         }
         require_code('templates_interfaces');
         $_a = tpl_crop_text_mouse_over($a, 8);
         $_b = tpl_crop_text_mouse_over($b, 15);
         $type_str = do_lang($myrow['the_type'], $_a, $_b, NULL, NULL, false);
         if (is_null($type_str)) {
             $type_str = $myrow['the_type'];
         }
         $test = actionlog_linkage($myrow['the_type'], $a, $b, $_a, $_b);
         if (!is_null($test)) {
             list($_a, $_b) = $test;
         }
         $ip = tpl_crop_text_mouse_over($myrow['ip'], 12);
         $fields->attach(results_entry(array(escape_html($username), escape_html($date), $type_str, $_a, $_b)));
     }
     return results_table(do_lang_tempcode('ACTIONS'), $start, 'sa_start', $max, 'sa_max', $max_rows, $fields_title, $fields, $sortables, $sortable, $sort_order, 'sa_sort', new ocp_tempcode(), NULL, NULL, 5);
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:63,代码来源:main_staff_actions.php

示例14: get_banner_form_fields

/**
 * Get the tempcode for the form to add a banner, with the information passed along to it via the parameters already added in.
 *
 * @param  boolean			Whether to simplify the banner interface (for the point-store buy process)
 * @param  ID_TEXT			The name of the banner
 * @param  URLPATH			The URL to the banner image
 * @param  URLPATH			The URL to the site the banner leads to
 * @param  SHORT_TEXT		The caption of the banner
 * @param  LONG_TEXT			Any notes associated with the banner
 * @param  integer			The banners "importance modulus"
 * @range  1 max
 * @param  ?integer			The number of hits the banner may have (NULL: not applicable for this banner type)
 * @range  0 max
 * @param  SHORT_INTEGER	The type of banner (0=permanent, 1=campaign, 2=default)
 * @set    0 1 2
 * @param  ?TIME				The banner expiry date (NULL: never expires)
 * @param  ?ID_TEXT			The username of the banners submitter (NULL: current member)
 * @param  BINARY				Whether the banner has been validated
 * @param  ID_TEXT			The banner type (can be anything, where blank means 'normal')
 * @param  SHORT_TEXT		The title text for the banner (only used for text banners, and functions as the 'trigger text' if the banner type is shown inline)
 * @return tempcode			The input field tempcode
 */
function get_banner_form_fields($simplified = false, $name = '', $image_url = '', $site_url = '', $caption = '', $notes = '', $importancemodulus = 3, $campaignremaining = 50, $the_type = 1, $expiry_date = NULL, $submitter = NULL, $validated = 1, $b_type = '', $title_text = '')
{
    require_code('images');
    $fields = new ocp_tempcode();
    require_code('form_templates');
    $fields->attach(form_input_codename(do_lang_tempcode('CODENAME'), do_lang_tempcode('DESCRIPTION_BANNER_NAME'), 'name', $name, true));
    $fields->attach(form_input_line(do_lang_tempcode('DESTINATION_URL'), do_lang_tempcode('DESCRIPTION_BANNER_URL'), 'site_url', $site_url, false));
    // Blank implies iframe
    if (!$simplified) {
        $types = nice_get_banner_types($b_type);
        if ($types->is_empty()) {
            warn_exit(do_lang_tempcode('NO_CATEGORIES'));
        }
        $fields->attach(form_input_list(do_lang_tempcode('_BANNER_TYPE'), do_lang_tempcode('_DESCRIPTION_BANNER_TYPE'), 'b_type', $types, NULL, false, false));
    } else {
        $fields->attach(form_input_hidden('b_type', $b_type));
    }
    if (has_specific_permission(get_member(), 'full_banner_setup')) {
        $fields->attach(form_input_username(do_lang_tempcode('OWNER'), do_lang_tempcode('DESCRIPTION_SUBMITTER'), 'submitter', is_null($submitter) ? $GLOBALS['FORUM_DRIVER']->get_username(get_member()) : $submitter, false));
    }
    if (get_value('disable_staff_notes') !== '1') {
        $fields->attach(form_input_text(do_lang_tempcode('NOTES'), do_lang_tempcode('DESCRIPTION_NOTES'), 'notes', $notes, false));
    }
    if (has_specific_permission(get_member(), 'bypass_validation_midrange_content', 'cms_banners')) {
        if ($validated == 0) {
            $validated = get_param_integer('validated', 0);
            if ($validated == 1) {
                attach_message(do_lang_tempcode('WILL_BE_VALIDATED_WHEN_SAVING'));
            }
        }
        if (addon_installed('unvalidated')) {
            $fields->attach(form_input_tick(do_lang_tempcode('VALIDATED'), do_lang_tempcode('DESCRIPTION_VALIDATED'), 'validated', $validated == 1));
        }
    }
    $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('SOURCE_MEDIA'))));
    $fields->attach(form_input_upload(do_lang_tempcode('UPLOAD'), do_lang_tempcode('DESCRIPTION_UPLOAD_BANNER'), 'file', false, NULL, NULL, true, str_replace(' ', '', get_option('valid_images') . ',swf')));
    $fields->attach(form_input_line(do_lang_tempcode('ALT_FIELD', do_lang_tempcode('IMAGE_URL')), do_lang_tempcode('DESCRIPTION_URL_BANNER'), 'image_url', $image_url, false));
    $fields->attach(form_input_line_comcode(do_lang_tempcode('BANNER_TITLE_TEXT'), do_lang_tempcode('DESCRIPTION_BANNER_TITLE_TEXT'), 'title_text', $title_text, false));
    $fields->attach(form_input_line_comcode(do_lang_tempcode('DESCRIPTION'), do_lang_tempcode('DESCRIPTION_BANNER_DESCRIPTION'), 'caption', $caption, false));
    $fields->attach(do_template('FORM_SCREEN_FIELD_SPACER', array('TITLE' => do_lang_tempcode('DEPLOYMENT_DETERMINATION'))));
    if (has_specific_permission(get_member(), 'full_banner_setup')) {
        $radios = new ocp_tempcode();
        $radios->attach(form_input_radio_entry('the_type', strval(BANNER_PERMANENT), $the_type == BANNER_PERMANENT, do_lang_tempcode('BANNER_PERMANENT')));
        $radios->attach(form_input_radio_entry('the_type', strval(BANNER_CAMPAIGN), $the_type == BANNER_CAMPAIGN, do_lang_tempcode('BANNER_CAMPAIGN')));
        $radios->attach(form_input_radio_entry('the_type', strval(BANNER_DEFAULT), $the_type == BANNER_DEFAULT, do_lang_tempcode('BANNER_DEFAULT')));
        $fields->attach(form_input_radio(do_lang_tempcode('DEPLOYMENT_AGREEMENT'), do_lang_tempcode('DESCRIPTION_BANNER_TYPE'), 'the_type', $radios));
        $fields->attach(form_input_integer(do_lang_tempcode('HITS_ALLOCATED'), do_lang_tempcode('DESCRIPTION_HITS_ALLOCATED'), 'campaignremaining', $campaignremaining, false));
        $total_importance = $GLOBALS['SITE_DB']->query_value_null_ok_full('SELECT SUM(importance_modulus) FROM ' . get_table_prefix() . 'banners WHERE ' . db_string_not_equal_to('name', $name));
        if (is_null($total_importance)) {
            $total_importance = 0;
        }
        $fields->attach(form_input_integer(do_lang_tempcode('IMPORTANCE_MODULUS'), do_lang_tempcode('DESCRIPTION_IMPORTANCE_MODULUS', strval($total_importance), strval($importancemodulus)), 'importancemodulus', $importancemodulus, true));
    }
    $fields->attach(form_input_date(do_lang_tempcode('EXPIRY_DATE'), do_lang_tempcode('DESCRIPTION_EXPIRY_DATE'), 'expiry_date', true, is_null($expiry_date), true, $expiry_date, 2));
    return $fields;
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:78,代码来源:banners2.php

示例15: applies

 /**
  * Find whether this preview hook applies.
  *
  * @return array			Quartet: Whether it applies, the attachment ID type, whether the forum DB is used [optional], list of fields to limit to [optional]
  */
 function applies()
 {
     require_lang('ocf');
     $member_id = get_param_integer('id', get_member());
     $applies = get_param('page', '') == 'members' && post_param('signature', NULL) !== NULL;
     if ($applies) {
         require_code('ocf_groups');
         $max_sig_length = ocf_get_member_best_group_property($member_id, 'max_sig_length_comcode');
         if (strlen(post_param('post', '')) > $max_sig_length) {
             warn_exit(do_lang_tempcode('SIGNATURE_TOO_BIG'));
         }
     }
     return array($applies, 'ocf_signature', true, array('post'));
 }
开发者ID:erico-deh,项目名称:ocPortal,代码行数:19,代码来源:ocf_signature.php


注:本文中的get_param_integer函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。