本文整理汇总了PHP中getframeblock函数的典型用法代码示例。如果您正苦于以下问题:PHP getframeblock函数的具体用法?PHP getframeblock怎么用?PHP getframeblock使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getframeblock函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
if ($frame) {
$area = '';
$filename = $frame;
$framedata = array();
foreach ($diycontent['layoutdata'] as $key => $value) {
$framedata = getobjbyname($frame, $value);
if ($framedata) {
$area = $key;
getframeblock(array($framedata['type'] . '`' . $frame => $framedata['content']));
break;
}
}
} else {
foreach ($diycontent['layoutdata'] as $key => $value) {
if (!empty($value)) {
getframeblock($value);
}
}
}
$diycontent['blockdata'] = block_export($_G['curtplbid']);
if ($frame) {
$diycontent['spacecss'] = getcssdata($diycontent['spacecss']);
$diycontent['layoutdata'] = array();
$area = empty($area) ? 'diy1' : $area;
$diycontent['layoutdata'][$area][$framedata['type'] . '`' . $frame] = $framedata['content'] ? $framedata['content'] : array();
}
dheader('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
dheader('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
dheader('Cache-Control: no-cache, must-revalidate');
dheader('Pragma: no-cache');
dheader('Content-Encoding: none');
示例2: import_diy
function import_diy($importfile, $primaltplname, $targettplname)
{
global $_G;
$css = $html = '';
$arr = array();
$content = file_get_contents(realpath($importfile));
if (empty($content)) {
return $arr;
}
require_once DISCUZ_ROOT . './source/class/class_xml.php';
$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['bockdata']);
}
$oldbids = $newbids = array();
if (!empty($mapping)) {
foreach ($mapping as $obid => $nbid) {
$oldbids[] = 'portal_block_' . $obid;
$newbids[] = 'portal_block_' . $nbid;
}
}
require_once DISCUZ_ROOT . './source/class/class_xml.php';
$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);
$arr['spacecss'] = $css;
$arr['layoutdata'] = $diycontent['layoutdata'];
$arr['style'] = $diycontent['style'];
save_diy_data($primaltplname, $targettplname, $arr, true);
}
return $arr;
}
示例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;
}