', '' , $xml);
}
xpress_cache_write($mydirname,$xml_name,$xml);
}
function xpress_block_header_cache_read($mydirname)
{
$xml_name = 'block_header.xml';
$xml_data = xpress_cache_read($mydirname,$xml_name);
$GLOBALS['DO_LIBXML_PATCH'] = get_xpress_mod_config($mydirname,'libxml_patch');
// The character-code not treatable exists when 'XML_unserialize' of PHP5 processes EUC-JP.
// And, the result is returned by character-code UTF-8.
// Measures
// After the character-code is converted into UTF-8, XML_unserialize will be processed.
if ( strstr($xml_data, '') !== false
&& version_compare(PHP_VERSION, '5.0.0', '>') )
{
$xml_data = str_replace('', '', $xml_data);
$ans = mb_convert_variables('UTF-8' , 'EUC-JP', &$xml_data); //EUC-JP to UTF-8
$ret = @xpress_XML_unserialize($xml_data);
$ans = mb_convert_variables('EUC-JP' , 'UTF-8', &$ret); //UTF-8 to EUC-JP
} else {
$ret = xpress_XML_unserialize($xml_data);
}
return $ret;
}
function get_block_stylesheet_url($mydirname)
{
global $xoops_config;
$mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname;
$select_theme = get_xpress_theme_name($mydirname);
$style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css';
if (file_exists($style_file))
return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/block_style.css';
else
return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/block_style.css';
}
function set_xpress_block_header($mydirname)
{
ob_start();
bloginfo('stylesheet_url');
$stylesheet_link = "\t".'';
ob_end_clean();
$block_stylesheet_link = "\t".'';
ob_start();
wp_head();
$header_str = ob_get_contents();
ob_end_clean();
$pattern = '<\s*link\s+rel\s*=[^>]*?>';
$header_str = preg_replace("/".$pattern."/s" , '' , $header_str);
$pattern = '<\s*meta\s+name\s*=[^>]*?>';
$header_str = preg_replace("/".$pattern."/i" , '' , $header_str);
// $pattern = "