From b576c8a8c51f2429990bf643ba33810216afde06 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Thu, 7 Apr 2016 19:20:46 -0400 Subject: [PATCH] header from cms image named "Header" --- inc/cms.php | 18 +++++++++++++++++- style.styl | 3 +++ template.html | 4 ++-- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/inc/cms.php b/inc/cms.php index 789f39d..f8154a9 100644 --- a/inc/cms.php +++ b/inc/cms.php @@ -26,7 +26,23 @@ function cms_display($basename, &$tem) { $cms_page_id = cms_display_content($tem, 'where filename=%"', $basename); - $tem->set('$cms_footer', db_get_value('cms_pages', 'content', 'where filename="_footer"')); + $footer = db_get_value('cms_pages', 'content', 'where filename="_footer"'); + if ($footer) { + $tem->set('$cms_footer', $footer); + } + + $header = db_get_value('cms_images', 'image', 'where name="Header"'); + if ($header) { + $parts = explode(' ', $header . ' ', 7); + $tem->set('$cms_header', + '
' + ); + } if(session_auth_can('admin_links')) { $admin_links = array(); diff --git a/style.styl b/style.styl index c0071a2..2a4ee1f 100644 --- a/style.styl +++ b/style.styl @@ -244,6 +244,9 @@ ckeditor('admin_pages', 'content', 'content_with_sidebar_main', columns['widths' ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_plain', columns['widths']['.centerer.with_sidebar > .sidebar.plain']) ckeditor('admin_pages', 'sidebar_content', 'content_with_sidebar_sidebar_bordered', columns['widths']['.centerer.with_sidebar > .sidebar.bordered']) +header#site_header + margin-bottom: 15px + body > .centerer > .nav ul li_reset() diff --git a/template.html b/template.html index 6403d13..f8be38a 100644 --- a/template.html +++ b/template.html @@ -15,8 +15,8 @@
-
- header image here +