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


PHP ocp_tempcode::evaluate_echo方法代码示例

本文整理汇总了PHP中ocp_tempcode::evaluate_echo方法的典型用法代码示例。如果您正苦于以下问题:PHP ocp_tempcode::evaluate_echo方法的具体用法?PHP ocp_tempcode::evaluate_echo怎么用?PHP ocp_tempcode::evaluate_echo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ocp_tempcode的用法示例。


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

示例1: realtime_rain_script

/**
 * AJAX script for returning realtime-rain data.
 */
function realtime_rain_script()
{
    header("Cache-Control: no-cache, must-revalidate");
    // HTTP/1.1
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    // Date in the past
    @ini_set('ocproducts.xss_detect', '0');
    header('Content-Type: text/xml');
    echo '<?xml version="1.0" encoding="' . get_charset() . '"?' . '>';
    echo '<request><result>';
    require_code('realtime_rain');
    require_lang('realtime_rain');
    $time_now = time();
    $from = get_param_integer('from', $time_now - 10);
    $to = get_param_integer('to', $time_now);
    if (get_param_integer('keep_realtime_test', 0) == 1) {
        $types = array('post', 'news', 'recommend', 'polls', 'ecommerce', 'actionlog', 'security', 'chat', 'stats', 'join', 'calendar', 'search', 'point_charges', 'banners', 'point_gifts');
        shuffle($types);
        $events = array();
        $cnt = count($types);
        for ($i = 0; $i < max($cnt, 5); $i++) {
            $timestamp = mt_rand($from, $to);
            $type = array_pop($types);
            $event = rain_get_special_icons(get_ip_address(), $timestamp) + array('TYPE' => $type, 'FROM_MEMBER_ID' => NULL, 'TO_MEMBER_ID' => NULL, 'TITLE' => 'Test', 'IMAGE' => rain_get_country_image(get_ip_address()), 'TIMESTAMP' => strval($timestamp), 'RELATIVE_TIMESTAMP' => strval($timestamp - $from), 'TICKER_TEXT' => NULL, 'URL' => NULL, 'IS_POSITIVE' => $type == 'ecommerce' || $type == 'join', 'IS_NEGATIVE' => $type == 'security' || $type == 'point_charges', 'FROM_ID' => NULL, 'TO_ID' => NULL, 'GROUP_ID' => 'example_' . strval(mt_rand(0, 4)));
            $event['SPECIAL_ICON'] = 'email-icon';
            $event['MULTIPLICITY'] = '10';
            $events[] = $event;
        }
    } else {
        $events = get_realtime_events($from, $to);
    }
    shuffle($events);
    $out = new ocp_tempcode();
    foreach ($events as $event) {
        $out->attach(do_template('REALTIME_RAIN_BUBBLE', $event));
    }
    $out->evaluate_echo();
    echo '</result></request>';
}
开发者ID:erico-deh,项目名称:ocPortal,代码行数:42,代码来源:realtime_rain.php

示例2: display_validation_results

/**
 * Show results of running a validation function.
 *
 * @param  string			The data validated
 * @param  array			Error information
 * @param  boolean		Whether we are opening up an XHTML-fragment in a preview box
 * @param  boolean		Whether to return Tempcode
 * @return string			Returned result (won't return it $ret is false)
 */
function display_validation_results($out, $error, $preview_mode = false, $ret = false)
{
    global $KEEP_MARKERS, $SHOW_EDIT_LINKS;
    $KEEP_MARKERS = false;
    $SHOW_EDIT_LINKS = false;
    global $XHTML_SPIT_OUT;
    $XHTML_SPIT_OUT = 1;
    if (function_exists('set_time_limit')) {
        @set_time_limit(280);
    }
    require_css('adminzone');
    if (!$ret) {
        $echo = do_header($preview_mode);
        $echo->evaluate_echo();
    } else {
        ob_start();
    }
    $title = get_page_title('VALIDATION_ERROR');
    // Escape and colourfy
    $i = 0;
    // Output header
    if (count($_POST) == 0) {
        $messy_url = get_param_integer('keep_markers', 0) == 1 ? new ocp_tempcode() : build_url(array('page' => '_SELF', 'special_page_type' => 'code', 'keep_markers' => 1), '_SELF', NULL, true);
        $ignore_url = build_url(array('page' => '_SELF', 'keep_novalidate' => 1), '_SELF', NULL, true);
        $ignore_url_2 = build_url(array('page' => '_SELF', 'novalidate' => 1), '_SELF', NULL, true);
    } else {
        $messy_url = new ocp_tempcode();
        $ignore_url = new ocp_tempcode();
        $ignore_url_2 = new ocp_tempcode();
    }
    $error_lines = array();
    $return_url = new ocp_tempcode();
    if (count($error['errors']) != 0) {
        $errorst = new ocp_tempcode();
        foreach ($error['errors'] as $j => $_error) {
            $errorst->attach(do_template('VALIDATE_ERROR', array('_GUID' => '2239470f4b9bd38fcb570689cecaedd2', 'I' => strval($j), 'LINE' => integer_format($_error['line']), 'POS' => integer_format($_error['pos']), 'ERROR' => $_error['error'])));
            $error_lines[$_error['line']] = 1;
        }
        $errors = $errorst->evaluate();
        $echo = do_template('VALIDATE_ERROR_SCREEN', array('_GUID' => 'db6c362632471e7c856380d32da91054', 'MSG' => do_lang_tempcode('_NEXT_ITEM_BACK'), 'RETURN_URL' => $return_url, 'TITLE' => $title, 'IGNORE_URL_2' => $ignore_url_2, 'IGNORE_URL' => $ignore_url, 'MESSY_URL' => $messy_url, 'ERRORS' => $errorst, 'RET' => $ret));
        unset($errorst);
        $echo->evaluate_echo();
    } else {
        $echo = do_template('VALIDATE_SCREEN', array('_GUID' => 'd8de848803287e4c592418d57450b7db', 'MSG' => do_lang_tempcode('_NEXT_ITEM_BACK'), 'RETURN_URL' => $return_url, 'TITLE' => get_page_title('VIEWING_SOURCE'), 'MESSY_URL' => $messy_url, 'RET' => $ret));
        $echo->evaluate_echo();
    }
    $level_ranges = $error['level_ranges'];
    $tag_ranges = $error['tag_ranges'];
    $value_ranges = $error['value_ranges'];
    $current_range = 0;
    $current_tag = 0;
    $current_value = 0;
    $number = 1;
    $in_at = false;
    for ($i = 0; $i < strlen($out); ++$i) {
        if (isset($level_ranges[$current_range])) {
            $level = $level_ranges[$current_range][0];
            $start = $level_ranges[$current_range][1];
            if ($start == 0) {
                $start = 1;
            }
            // Hack for when error starts before a line, messing up our output
            if ($i == $start) {
                $x = 8;
                if ($level % $x == 0) {
                    $colour = 'teal';
                }
                if ($level % $x == 1) {
                    $colour = 'blue';
                }
                if ($level % $x == 2) {
                    $colour = 'purple';
                }
                if ($level % $x == 3) {
                    $colour = 'gray';
                }
                if ($level % $x == 4) {
                    $colour = 'red';
                }
                if ($level % $x == 5) {
                    $colour = 'maroon';
                }
                if ($level % $x == 6) {
                    $colour = 'navy';
                }
                if ($level % $x == 7) {
                    $colour = 'olive';
                }
                $previous = $i == 0 ? '' : $out[$i - 1];
                $string = new ocp_tempcode();
                if ($previous == ' ' || $previous == chr(10) || $previous == chr(13)) {
//.........这里部分代码省略.........
开发者ID:erico-deh,项目名称:ocPortal,代码行数:101,代码来源:view_modes.php


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