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