• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP finalize_page函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: render_raw

        $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') {
        echo $text;
    }
    // the post-processing hook, then exit
    finalize_page(TRUE);
}
// render the skin
render_skin();
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:feed.php


示例2: elseif

    // permission denied
} elseif (!Comments::allow_modification($anchor, $item)) {
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // deletion is confirmed
} elseif (isset($_REQUEST['confirm']) && $_REQUEST['confirm'] == 'yes') {
    // touch the related anchor before actual deletion, since the item has to be accessible at that time
    if (is_object($anchor)) {
        $anchor->touch('comment:delete', $item['id']);
    }
    // if no error, back to the anchor or to the index page
    if (Comments::delete($item['id'])) {
        Comments::clear($item);
        if ($render_overlaid && isset($_REQUEST['follow_up']) && $_REQUEST['follow_up'] == 'close') {
            echo "deleting done";
            finalize_page(true);
        } elseif (is_object($anchor)) {
            Safe::redirect($anchor->get_url('comments'));
        } else {
            Safe::redirect($context['url_to_home'] . $context['url_to_root'] . 'comments/');
        }
    }
    // deletion has to be confirmed
} elseif (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
    Logger::error(i18n::s('The action has not been confirmed.'));
} else {
    // commands
    $menu = array();
    $delete_label = '';
    if (is_object($overlay)) {
        $delete_label = $overlay->get_label('delete_confirmation', 'comments');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:delete.php


示例3: render_raw

    default:
    case 'articles':
    case 'images':
        $values['items'] = Articles::search($search, 0, 30, 'feed');
        break;
        // search in files
    // search in files
    case 'files':
        $values['items'] = Files::search($search, 0, 30, 'feed');
        break;
        // search in users
    // search in users
    case 'users':
        $values['items'] = Users::search($search, 1.0, 30, 'feed');
        break;
}
// make a text
include_once 'codec.php';
include_once 'rss_codec.php';
$result = rss_Codec::encode($values);
$status = @$result[0];
$text = @$result[1];
// handle the output correctly
render_raw('text/xml; charset=' . $context['charset']);
// actual transmission except on a HEAD request
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] != 'HEAD') {
    echo $text;
}
// the post-processing hook
finalize_page();
开发者ID:rair,项目名称:yacs,代码行数:30,代码来源:search.php


示例4: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP find函数代码示例发布时间:2022-05-15
下一篇:
PHP finalize函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap