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


PHP render_raw函数代码示例

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


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

示例1: render_raw

     // the list of newest pages
     $values['items'] = (array) Articles::list_for_author_by('publication', $item['id'], 0, 50, 'feed');
     // make a text
     include_once '../services/codec.php';
     include_once '../services/rss_codec.php';
     $result = rss_Codec::encode($values);
     $status = @$result[0];
     $text = @$result[1];
     // save in cache for the next request
     Cache::put($cache_id, $text, 'articles');
 }
 //
 // transfer to the user agent
 //
 // handle the output correctly
 render_raw('text/xml; charset=' . $context['charset']);
 // suggest a name on download
 if (!headers_sent()) {
     $file_name = utf8::to_ascii($context['site_name'] . '.section.' . $item['id'] . '.rss.xml');
     Safe::header('Content-Disposition: inline; filename="' . str_replace('"', '', $file_name) . '"');
 }
 // enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
 http::expire(1800);
 // strong validator
 $etag = '"' . md5($text) . '"';
 // manage web cache
 if (http::validate(NULL, $etag)) {
     return;
 }
 // actual transmission except on a HEAD request
 if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:feed.php

示例2: elseif

    // look for some notification
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
    // change session data to extend life of related file
    if (!isset($_SESSION['heartbit'])) {
        $_SESSION['heartbit'] = 0;
    }
    $_SESSION['heartbit']++;
    // refresh the watchdog
    $_SESSION['watchdog'] = time();
    // update surfer presence
    $query = "UPDATE " . SQL::table_name('users') . " SET click_date='" . gmstrftime('%Y-%m-%d %H:%M:%S') . "'" . " WHERE (id = " . SQL::escape(Surfer::get_id()) . ")";
    SQL::query($query, FALSE, $context['users_connection']);
    // assign article for more time
    if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'edit' && isset($_REQUEST['reference']) && !strncmp($_REQUEST['reference'], 'article:', 8)) {
        // refresh record of this article
        $query = "UPDATE " . SQL::table_name('articles') . " SET " . " assign_date = '" . SQL::escape(gmstrftime('%Y-%m-%d %H:%M:%S')) . "'" . " WHERE (id = " . SQL::escape(substr($_REQUEST['reference'], 8)) . ") AND (assign_id = " . SQL::escape(Surfer::get_id()) . ")";
        SQL::query($query);
    }
    // look for one notification -- script will be be killed if none is available
    $response = Notifications::pull();
    // encode result in JSON
    $output = json_encode($response);
    // allow for data compression
    render_raw('application/json; charset=' . $context['charset']);
    // actual transmission except on a HEAD request
    if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
        echo $output;
    }
    // the post-processing hook, then exit
    finalize_page(TRUE);
}
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:heartbit.php

示例3: str_replace

     // send the response to the caller
     if (!headers_sent()) {
         Safe::header('Content-Description: Reference file from YACS environment');
     }
     // suggest a download
     if (!headers_sent()) {
         $file_name = utf8::to_ascii(basename($script[0]));
         Safe::header('Content-Disposition: attachment; filename="' . str_replace('"', '', $file_name) . '"');
     }
     // several scripts at one
 } else {
     // multi-part separator on the first line
     $text = $separator . $text;
     // compress the page if possible, but no transcoding -- the bare handler
     $context['charset'] = 'ASCII';
     render_raw('text/html');
     // send the response to the caller
     if (!headers_sent()) {
         Safe::header('Content-Description: Reference files from YACS environment');
     }
 }
 // enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
 http::expire(1800);
 // strong validator
 $etag = '"' . md5($text) . '"';
 // manage web cache
 if (http::validate(NULL, $etag)) {
     return;
 }
 // actual transmission except on a HEAD request
 if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:fetch.php

示例4: include

 */
//Content Rendering API
//Version 0.07
//Notes: You shouldn't be touching this file directly.  You should be calling through the render/index.php handler and passing the version 007
include(COMMON_DIR.'user.php');     //Class to represent a site user
include(COMMON_DIR.'feed.php');     //Class to represent a content feed
include(COMMON_DIR.'content.php');  //Class to represent content items in the system


if($_REQUEST['select'] == 'system'){
    system_info();
} else {
    $criteria = validation($_REQUEST);
    $contents = content_selection($criteria);
    if($criteria['format'] == 'raw'){
        render_raw($contents, $criteria);
    }elseif($criteria['format'] == 'html'){
        render_html($contents, $criteria);
    }elseif($criteria['format'] == 'rss'){
        render_rss($contents, $criteria);
    }elseif($criteria['format'] == 'json'){
        render_json($contents, $criteria);
    }
}

//Grab and check user values
function validation($request){
    //Default Values
    $criteria['select'] = 'feed';
    $criteria['format'] = 'rss';
    $criteria['orderby'] = 'id';
开发者ID:TNValleyFiddlersConvention,项目名称:fiddlers,代码行数:31,代码来源:007.php

示例5: render_raw

// the section
// $context['text'] .= '<p>'.i18n::s('Section').BR
// 	.'<select name="anchor">'.Sections::get_options().'</select>'
// 	.'</p>'."\n";
// the title
$context['text'] .= '<p>' . i18n::s('Title') . BR . '<textarea name="title" id="title" rows="2" cols="20" accesskey="t"></textarea>' . '</p>' . "\n";
// the introduction
$context['text'] .= '<p>' . i18n::s('Introduction') . BR . '<textarea name="introduction" rows="3" cols="20" accesskey="i"></textarea>' . '</p>' . "\n";
// the description label
$context['text'] .= '<p>' . i18n::s('Page content') . BR . '<textarea name="text" rows="10" cols="20" accesskey="c"></textarea>' . '</p>' . "\n";
// the submit and reset buttons
$context['text'] .= '<p>' . Skin::build_submit_button(i18n::s('Submit'), i18n::s('Press [s] to submit data'), 's', NULL, 'no_spin_on_click') . '</p>' . "\n";
// end of the form
$context['text'] .= '</form>';
// handle the output correctly
render_raw();
// if it was a HEAD request, stop here
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'HEAD') {
    return;
}
// add language information, if known
if (isset($context['page_language'])) {
    $language = ' xml:lang="' . $context['page_language'] . '" ';
} else {
    $language = '';
}
// do our own rendering
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">' . "\n" . '<html ' . $language . ' xmlns="http://www.w3.org/1999/xhtml">' . "\n" . '<head>' . "\n";
// the title
if (isset($context['page_title'])) {
    echo '<title>' . ucfirst(strip_tags($context['page_title'])) . '</title>';
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:panel.php

示例6: preg_replace

     $text .= Skin::build_block($context['page_title'], 'page_title');
 }
 // display error messages, if any
 $text .= Skin::build_error_block();
 // render and display the content, if any
 $text .= $context['text'] . "\n";
 $text .= '</body></html>' . "\n";
 // MS-WORD won't import pictures
 $text = preg_replace('/<img (.*?)\\/>/i', '', $text);
 // strip relative links
 $text = preg_replace('/<a (.*?)>(.*?)<\\/a>/is', '\\2', $text);
 //
 // transfer to the user agent
 //
 // handle the output correctly
 render_raw('application/msword; charset=' . $context['charset']);
 // suggest a download
 if (!headers_sent()) {
     $file_name = utf8::to_ascii(Skin::strip($context['page_title']) . '.doc');
     Safe::header('Content-Disposition: attachment; filename="' . str_replace('"', '', $file_name) . '"');
 }
 // enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
 http::expire(1800);
 // strong validator
 $etag = '"' . md5($text) . '"';
 // manage web cache
 if (http::validate(NULL, $etag)) {
     return;
 }
 // actual transmission except on a HEAD request
 if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:fetch_as_msword.php

示例7: urlencode

}
$text .= '	<homePageLink>' . $context['url_to_home'] . $context['url_to_root'] . $link . '</homePageLink>' . "\n";
// restrict the scope of the API
$scope = '';
if ($id) {
    $scope = '?id=' . urlencode($id);
}
// available blogging api
$text .= '	<apis>' . "\n" . '		<api name="MovableType" preferred="true" apiLink="' . $context['url_to_home'] . $context['url_to_root'] . 'services/blog.php' . $scope . '" blogID="' . encode_field($id) . '" />' . "\n" . '		<api name="MetaWeblog" preferred="false" apiLink="' . $context['url_to_home'] . $context['url_to_root'] . 'services/blog.php' . $scope . '" blogID="' . encode_field($id) . '" />' . "\n" . '		<api name="Blogger" preferred="false" apiLink="' . $context['url_to_home'] . $context['url_to_root'] . 'services/blog.php' . $scope . '" blogID="' . encode_field($id) . '" />' . "\n" . '	</apis>' . "\n";
// the postamble
$text .= '</service>' . "\n" . '</rsd>' . "\n";
//
// transfer to the user agent
//
// handle the output correctly
render_raw('application/rsd+xml; charset=' . $context['charset']);
// suggest a name on download
if (!headers_sent()) {
    $file_name = utf8::to_ascii($context['site_name'] . '.rsd.xml');
    Safe::header('Content-Disposition: inline; filename="' . str_replace('"', '', $file_name) . '"');
}
// enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
http::expire(1800);
// strong validator
$etag = '"' . md5($text) . '"';
// manage web cache
if (http::validate(NULL, $etag)) {
    return;
}
// actual transmission except on a HEAD request
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:describe.php

示例8: urlencode

        Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode(Tables::get_url($item['id'], 'fetch_as_raw')));
    }
    // permission denied to authenticated user
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // display the table in CSV
} else {
    // force the character set
    $context['charset'] = 'iso-8859-15';
    // render actual table content
    $text = strip_tags(Tables::build($item['id'], 'raw'));
    //
    // transfer to the user agent
    //
    // handle the output correctly
    render_raw('text/csv; charset=' . $context['charset']);
    // suggest a download
    if (!headers_sent()) {
        $file_name = utf8::to_ascii(Skin::strip($item['title']) . '.csv');
        Safe::header('Content-Disposition: attachment; filename="' . str_replace('"', '', $file_name) . '"');
    }
    // enable 30-minute caching (30*60 = 1800), even through https, to help IE6 on download
    http::expire(1800);
    // strong validator
    $etag = '"' . md5($text) . '"';
    // manage web cache
    if (http::validate(NULL, $etag)) {
        return;
    }
    // actual transmission except on a HEAD request
    if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:fetch_as_raw.php

示例9: render_json

 /**
  * render comment as json format
  * 
  * @param int $id of the comment
  * @param object $anchor of the comment
  */
 public static function render_json($id, $anchor)
 {
     // we'll return json
     $output = '';
     // get layout and render last comment
     $layout = Comments::get_layout($anchor);
     $layout->set_variant('no_wrap');
     $rendering = Comments::list_by_date_for_anchor($anchor, 0, 1, $layout, true);
     $output = json_encode(array('entity' => 'comment', 'id' => $id, 'anchor' => $anchor->get_reference(), 'html' => $rendering));
     // allow for data compression
     render_raw('application/json');
     echo $output;
     // the post-processing hook, then exit
     finalize_page(TRUE);
 }
开发者ID:rair,项目名称:yacs,代码行数:21,代码来源:comments.php

示例10: die_on_invalid

        $layout = 'tree_manager';
        if (isset($_REQUEST['variant'])) {
            $layout .= ' ' . $_REQUEST['variant'];
        }
        $childs = $anchor->get_childs($anchor->get_type(), 0, 200, $layout);
        // prepare json reply
        if (isset($childs[$anchor->get_type()])) {
            $output['success'] = true;
            $output['content'] = $childs[$anchor->get_type()];
            $output['title'] = $anchor->get_title();
            $output['crumbs_separator'] = CRUMBS_SEPARATOR;
            $output['crumbs_suffix'] = CRUMBS_SUFFIX;
            $output['userlevel'] = $powered ? 'powered' : '';
            $output['root_ref'] = $anchor->get_reference();
        } else {
            $output['success'] = false;
        }
        break;
    default:
        // unknown action
        die_on_invalid();
}
// output is JSON formated
render_raw('application/json');
$output = json_encode($output);
// actual transmission
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
    echo $output;
}
// the post-processing hook, then exit
finalize_page(TRUE);
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:tree_manager_ajax.php

示例11: urlencode

        Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'users/login.php?url=' . urlencode(Tables::get_url($item['id'], 'fetch_as_json')));
    }
    // permission denied to authenticated user
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // display the table in CSV
} else {
    // force the character set
    $context['charset'] = 'iso-8859-15';
    // render actual table content
    $text = Tables::build($id, 'json');
    //
    // transfer to the user agent
    //
    // handle the output correctly
    render_raw('text/json; charset=' . $context['charset']);
    // suggest a download
    if (!headers_sent()) {
        $file_name = utf8::to_ascii(Skin::strip($item['title']) . '.json');
        Safe::header('Content-Disposition: attachment; filename="' . str_replace('"', '', $file_name) . '"');
    }
    // enable 3-minute caching (3*60 = 180), even through https, to help IE6 on download
    http::expire(180);
    // strong validator
    $etag = '"' . md5($text) . '"';
    // manage web cache
    if (http::validate(NULL, $etag)) {
        return;
    }
    // actual transmission except on a HEAD request
    if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:fetch_as_json.php


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