Rev | Line | |
---|
[125] | 1 | <?php
|
---|
| 2 | function sidebar_block($options)
|
---|
| 3 | {
|
---|
| 4 | $templates = array();
|
---|
| 5 | $templates[] = "sidebar.php";
|
---|
| 6 | $sidebar_path = locate_template($templates, false);
|
---|
[254] | 7 | if (empty($sidebar_path)){ // ktai_style plugin is empty
|
---|
| 8 | $sidebar_path = dirname(dirname(__FILE__)) . "/sidebar.php";
|
---|
| 9 | }
|
---|
[125] | 10 | ob_start();
|
---|
| 11 | require($sidebar_path);
|
---|
| 12 | $output = ob_get_contents();
|
---|
[204] | 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 |
|
---|
[125] | 17 | $block['sidebar'] = $output;
|
---|
| 18 | return $block ;
|
---|
| 19 |
|
---|
| 20 | }
|
---|
| 21 |
|
---|
| 22 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.