X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=inc%2Fcms.php;h=06324f0e946dab296de97fe41602b1a4053a0617;hb=d8a3c68fe7131555725440aabc9f82e53520b5dc;hp=895c810fad048b5c7e57a0c3ecb160e5aa134264;hpb=829a67d41aacdf529455c0f315665c407ad5d35b;p=wfpl-cms.git diff --git a/inc/cms.php b/inc/cms.php index 895c810..06324f0 100644 --- a/inc/cms.php +++ b/inc/cms.php @@ -2,6 +2,12 @@ # This function (which loads the navbar and page content from the database) is # called automatically by wfpl_main() + +function enc_css_str($str) { + $str = str_replace("\\", "\\00005c", $str); + return str_replace("\"", "\\000022", $str); +} + function cms_display($basename, &$tem) { if(preg_match('/([.]l(ocal)?$)|^192[.]168[.]|^127.0.0.1$|^10[.]/', $_SERVER['HTTP_HOST'])) { $GLOBALS['wfpl_main_template']->set('$running_locally'); @@ -24,8 +30,36 @@ function cms_display($basename, &$tem) { $tem->set('$navbar_items', $nav_items); } + $header_image = persistent_get('wfplcms_header_image'); + if ($header_image) { + $hi_css = "\n\n"; + + $tem->set('$cms_css', $hi_css); + } + $cms_page_id = cms_display_content($tem, 'where filename=%"', $basename); + $footer = db_get_value('cms_pages', 'content', 'where filename="_footer"'); + if ($footer) { + $tem->set('$cms_footer', $footer); + } + if(session_auth_can('admin_links')) { $admin_links = array(); if($cms_page_id) { @@ -62,6 +96,8 @@ function cms_display_content(&$tem /*, 'where clause %", %i', string, int */) { $tem->set('$cms_sidebar', $row['sidebar_content']); } return $row['id']; + } else { + $tem->set('$layout_centerer_class', 'full'); } return false; }