XPressME Integration Kit

Trac

source: trunk/xpressme_integration_kit/wp-content/themes/xpress_default/blocks/sidebar_block_theme.php @ 254

Last change on this file since 254 was 254, checked in by toemon, 15 years ago

fixed #141 KtaiStyleからのコメント送信時のバグ修正

File size: 596 bytes
Line 
1<?php
2function sidebar_block($options)
3{
4        $templates = array();
5        $templates[] = "sidebar.php";
6        $sidebar_path = locate_template($templates, false);
7        if (empty($sidebar_path)){ // ktai_style plugin is empty
8                $sidebar_path = dirname(dirname(__FILE__)) . "/sidebar.php";
9        }
10        ob_start();
11                require($sidebar_path);
12                $output = ob_get_contents();
13        ob_end_clean();
14        $pattern = '<div\s+id\s*=\s*["\']xpress_sidebar["\']\s*>';
15        $output = preg_replace("/".$pattern."/s" , '<div class="xpress_sidebar_block">' , $output);
16
17        $block['sidebar'] = $output;                                                           
18        return $block ;
19
20}
21
22?>
Note: See TracBrowser for help on using the repository browser.