function set_xpress_block_header($mydirname) { ob_start(); bloginfo('stylesheet_url'); $stylesheet_link = "\t" . '<link rel="stylesheet" href="' . ob_get_contents() . '" type="text/css" media="screen" />'; ob_end_clean(); $block_stylesheet_link = "\t" . '<link rel="stylesheet" href="' . get_block_stylesheet_url($mydirname) . '" type="text/css" media="screen" />'; ob_start(); $now_ob_level = ob_get_level(); wp_head(); ob_end_flush_child($now_ob_level); $header_str = ob_get_contents(); ob_end_clean(); if (function_exists('_admin_bar_bump_cb')) { //remove admin_bar_bump_cb ob_start(); _admin_bar_bump_cb(); $admin_bar_bump_cb_str = ob_get_contents(); ob_end_clean(); $header_str = str_replace_ex($admin_bar_bump_cb_str, '', $header_str); } if (function_exists('wp_admin_bar_header')) { //remove wp_adminbar_header ob_start(); wp_admin_bar_header(); $wp_admin_bar_header_str = ob_get_contents(); ob_end_clean(); $header_str = str_replace_ex($wp_admin_bar_header_str, '', $header_str); } $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 = "<style type.*<\/style>"; // $header_str = preg_replace("/".$pattern."/s" , '' , $header_str); $pattern = "^\\s*\n"; $header_str = preg_replace("/" . $pattern . "/m", '', $header_str); $pattern = "^"; $header_str = preg_replace("/" . $pattern . "/m", "\t", $header_str); ob_start(); global $show_admin_bar; $show_admin_bar = false; //remove adminbar wp_footer(); $footer_str = ob_get_contents(); ob_end_clean(); $pattern = "^"; $footer_str = preg_replace("/" . $pattern . "/m", "\t", $footer_str); $block_header = "<!-- XPressME added block header -->\n"; $block_header .= "\t<!-- from bloginfo('stylesheet_url') -->\n"; $block_header .= $stylesheet_link . "\n"; $block_header .= $block_stylesheet_link . "\n"; $block_header .= "\t<!-- from wp_head() -->\n"; $block_header .= $header_str . "\n"; $block_header .= "\t<!-- from wp_footer() -->\n"; $block_header .= $footer_str . "\n"; $block_header .= "<!-- end of XPressME added block header -->\n"; $data = array(); $data['block_header'] = $block_header; xpress_block_header_cash_write($mydirname, $data); }
header('Location: ' . $xoops_config->module_url . '/'); $err_str = "The activation of the XPressME plugin was executed.<br />\n"; $err_str .= "Because the XPressME plugin was invalid.<br />\n"; $err_str .= "Please do the rereading seeing on the page.\n"; die($err_str); } Notification_reserve_send(); ob_start(); $now_ob_level = ob_get_level(); if (version_compare($xoops_config->wp_version,'2.2', '<')) require_once dirname( __FILE__ ).'/old_template-loader.php' ; else require_once( ABSPATH . WPINC . '/template-loader.php' ); ob_end_flush_child($now_ob_level); $wp_output = ob_get_contents(); ob_end_clean(); // insert credit $pattern = '<body'; $replace = "\n<!-- credit " . xpress_credit('echo=0&no_link=1') . " -->\n<body"; $wp_output = preg_replace("/" . $pattern . "/s", $replace, $wp_output); //Rendering Select if( is_wordpress_style() // When the display mode is WordPress style || is_feed() // It judges it here because it does in is_index_page() through feed to which the permalink is set. || is_iphone_with_wptouch() // When iPhone access & used wptouch plugin (thx uemu) ){