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