本文整理匯總了PHP中Stack::stack_inject_bkgnd方法的典型用法代碼示例。如果您正苦於以下問題:PHP Stack::stack_inject_bkgnd方法的具體用法?PHP Stack::stack_inject_bkgnd怎麽用?PHP Stack::stack_inject_bkgnd使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Stack
的用法示例。
在下文中一共展示了Stack::stack_inject_bkgnd方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: import_bkgnd
public static function import_bkgnd($id)
{
//return 'BKGD: '.$id;
HCImport::load_stack();
HCImport::index_blocks();
HCImport::decode_stak();
HCImport::decode_font_table();
HCImport::decode_style_table();
$old_bkgnd = HCImport::decode_bkgnd(intval($id));
$new_file = new Stack(HCImport::stack_temp());
$new_bkgnd = array();
$new_bkgnd['bkgnd_id'] = intval($id);
$new_bkgnd['bkgnd_name'] = $old_bkgnd['name'];
$new_bkgnd['bkgnd_cant_delete'] = $old_bkgnd['cant_delete'];
$new_bkgnd['bkgnd_dont_search'] = $old_bkgnd['dont_search'];
$new_bkgnd['bkgnd_script'] = array('content' => $old_bkgnd['script'], 'selection' => 0);
$new_bkgnd['bkgnd_has_art'] = false;
$new_parts = array();
$part_index = array();
$n = 1;
foreach ($old_bkgnd['parts'] as $part) {
$new_part = HCImport::convert_part($part);
$part_index[$part['pid']] = count($new_parts);
$new_parts[] = $new_part;
$n++;
}
foreach ($old_bkgnd['content'] as $fdata) {
if (isset($part_index[$fdata['part_id']])) {
$idx = $part_index[$fdata['part_id']];
$new_parts[$idx][-99] = nl2br($fdata['text'], false);
//print 'IDX: '.$idx.' = '.$fdata['text'].'<br>';
}
}
$new_bkgnd['bkgnd_object_data'] = json_encode($new_parts);
$new_file->stack_inject_bkgnd($new_bkgnd);
return $old_bkgnd;
//$new_file = new Stack($filename);
}