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


PHP block_fetch_content函数代码示例

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


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

示例1: header

<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: javascript.php 7086 2010-03-29 02:06:27Z monkey $
 */
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60) . ' GMT');
if (!defined('IN_API')) {
    exit('document.write(\'Access Denied\')');
}
loadcore();
include_once libfile('function/block');
loadcache('blockclass');
$bid = intval($_G['gp_bid']);
block_get_batch($bid);
$data = block_fetch_content($bid, true);
$search = array("/\\<(a href)\\=(\"|')(\\w+)/i", "/\\<(img src)\\=(\"|')(\\w+)/i");
$replace = "<\\1=\\2{$_G['siteurl']}\\3";
$data = preg_replace($search, $replace, $data);
echo 'document.write(\'' . preg_replace("/\r\n|\n|\r/", '\\n', addcslashes($data, "'\\")) . '\');';
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:22,代码来源:javascript.php

示例2: block_display_batch

function block_display_batch($bid)
{
    echo block_fetch_content($bid);
}
开发者ID:vanloswang,项目名称:discuzx-1,代码行数:4,代码来源:function_block.php

示例3: import_diy

function import_diy($file)
{
    global $_G;
    $css = '';
    $html = array();
    $arr = array();
    $content = file_get_contents($file);
    require_once libfile('class/xml');
    if (empty($content)) {
        return $arr;
    }
    $content = preg_replace("/\\<\\!\\-\\-\\[name\\](.+?)\\[\\/name\\]\\-\\-\\>\\s+/i", '', $content);
    $diycontent = xml2array($content);
    if ($diycontent) {
        foreach ($diycontent['layoutdata'] as $key => $value) {
            if (!empty($value)) {
                getframeblock($value);
            }
        }
        $newframe = array();
        foreach ($_G['curtplframe'] as $value) {
            $newframe[] = $value['type'] . random(6);
        }
        $mapping = array();
        if (!empty($diycontent['blockdata'])) {
            $mapping = block_import($diycontent['blockdata']);
            unset($diycontent['blockdata']);
        }
        $oldbids = $newbids = array();
        if (!empty($mapping)) {
            foreach ($mapping as $obid => $nbid) {
                $oldbids[] = '#portal_block_' . $obid . ' ';
                $newbids[] = '#portal_block_' . $nbid . ' ';
                $oldbids[] = '[portal_block_' . $obid . ']';
                $newbids[] = '[portal_block_' . $nbid . ']';
                $oldbids[] = '~portal_block_' . $obid . '"';
                $newbids[] = '~portal_block_' . $nbid . '"';
            }
        }
        require_once libfile('class/xml');
        $xml = array2xml($diycontent['layoutdata'], true);
        $xml = str_replace($oldbids, $newbids, $xml);
        $xml = str_replace((array) array_keys($_G['curtplframe']), $newframe, $xml);
        $diycontent['layoutdata'] = xml2array($xml);
        $css = str_replace($oldbids, $newbids, $diycontent['spacecss']);
        $css = str_replace((array) array_keys($_G['curtplframe']), $newframe, $css);
        foreach ($diycontent['layoutdata'] as $key => $value) {
            $html[$key] = getframehtml($value);
        }
    }
    if (!empty($html)) {
        $xml = array2xml($html, true);
        require_once libfile('function/block');
        block_get_batch(implode(',', $mapping));
        foreach ($mapping as $bid) {
            $blocktag[] = '<!--{block/' . $bid . '}-->';
            $blockcontent[] = block_fetch_content($bid);
        }
        $xml = str_replace($blocktag, $blockcontent, $xml);
        $html = xml2array($xml);
        $arr = array('html' => $html, 'css' => $css, 'mapping' => $mapping);
    }
    return $arr;
}
开发者ID:softhui,项目名称:discuz,代码行数:64,代码来源:function_portalcp.php

示例4: elseif

    }
} elseif ($op == 'getblock') {
    if (!$bid || !$allowmanage && !$allowdata) {
        showmessage('block_edit_nopermission');
    }
    block_get_batch($bid);
    if (!empty($_GET['forceupdate'])) {
        block_updatecache($bid, !empty($_GET['forceupdate']));
    }
    if (strexists($block['summary'], '<script')) {
        $block['summary'] = lang('portalcp', 'block_diy_nopreview');
        $_G['block'][$bid] = $block;
        $_G['block'][$bid]['cachetime'] = 0;
        $_G['block'][$bid]['nocache'] = true;
    }
    $html = block_fetch_content($bid, $block['blocktype']);
} elseif ($op == 'saveblockclassname') {
    if (!$bid || !$allowmanage) {
        showmessage('block_edit_nopermission');
    }
    if (submitcheck('saveclassnamesubmit')) {
        $setarr = array('classname' => getstr($_POST['classname'], 100, 0, 0, 0, -1));
        C::t('common_block')->update($bid, $setarr);
    }
    C::t('common_block')->clear_cache($bid);
    showmessage('do_success');
} elseif ($op == 'saveblocktitle') {
    if (!$bid || !$allowmanage) {
        showmessage('block_edit_nopermission');
    }
    if (submitcheck('savetitlesubmit')) {
开发者ID:MCHacker,项目名称:discuz-docker,代码行数:31,代码来源:portalcp_block.php


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