X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl-cms.git;a=blobdiff_plain;f=inc%2Fcms.php;h=895c810fad048b5c7e57a0c3ecb160e5aa134264;hp=02dc63ea725a5277fec1232e78d89ede07bffc82;hb=829a67d41aacdf529455c0f315665c407ad5d35b;hpb=6dd4794cb652ed15a8d3867f58f422bce1a313d3 diff --git a/inc/cms.php b/inc/cms.php index 02dc63e..895c810 100644 --- a/inc/cms.php +++ b/inc/cms.php @@ -43,13 +43,24 @@ function cms_display($basename, &$tem) { 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;