Changeset 26 for trunk/include
- Timestamp:
- Dec 15, 2008, 2:09:03 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/xpress_render.php
r1 r26 35 35 } 36 36 37 // get sidebar rendaring 38 function get_sidebar_rander($name = null) 39 { 40 $templates = array(); 41 if ( isset($name) ) 42 $templates[] = "sidebar-{$name}.php"; 43 44 $templates[] = "sidebar.php"; 45 46 $link= locate_template($templates, false); 47 if ('' == $link) 48 $link = get_theme_root() . '/default/sidebar.php'; 49 50 ob_start(); 51 require($link); 52 $sidebar = ob_get_contents(); 53 ob_end_clean(); 54 return $sidebar; 55 } 56 37 57 // < body > tag is pulled out from the header of html contents. 38 58 function get_body($contents) 39 59 { 60 $xpess_config = new XPressME_Class(); 40 61 $pattern = "<body[^>]*?>(.*)<\/body>"; 41 62 preg_match("/".$pattern."/s", $contents, $body_matches); 42 63 $body = $body_matches[1]; 64 65 if (!$xpess_config->is_theme_sidebar_disp){ 66 $side_panel = get_sidebar_rander(); 67 $body = str_replace($side_panel,'',$body); 68 } 43 69 return $body; 44 70 }
Note: See TracChangeset
for help on using the changeset viewer.