function cms_display_content(&$tem /*, 'where clause %", %i', string, int */) {
$args = array_slice(func_get_args(), 1);
- $args = array_merge(array('cms_pages', 'id,title,keywords,description,content'), $args);
+ $args = array_merge(array('cms_pages', 'id,title,keywords,description,layout,content,sidebar_content'), $args);
$row = call_user_func_array('db_get_assoc', $args);
if($row) {
$tem->set('$cms_title', $row['title']);
$tem->set('$meta_keywords', $row['keywords']);
$tem->set('$meta_description', $row['description']);
$tem->set('$cms_body', $row['content']);
+ if ($row['layout'] === '' || $row['layout'] === '0') {
+ $tem->set('$layout_centerer_class', 'full');
+ } else {
+ $tem->set('$layout_centerer_class', 'with_sidebar');
+ if ($row['layout'] === '1') {
+ $tem->set('$layout_sidebar_class', 'plain');
+ } else {
+ $tem->set('$layout_sidebar_class', 'bordered');
+ }
+ $tem->set('$cms_sidebar', $row['sidebar_content']);
+ }
return $row['id'];
}
return false;