diff options
author | Thomas Lange <code@nerdmind.de> | 2017-03-10 21:46:12 +0100 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2017-03-10 21:46:12 +0100 |
commit | e33c245d910e55b8cab407a03e669470509a705d (patch) | |
tree | e958504564ab47e72e0d3dcfe0b967440007b1d9 /template/standard/html/main.php | |
parent | aae885b9784466ab412e4010893808867e93c213 (diff) | |
download | blog-e33c245d910e55b8cab407a03e669470509a705d.tar.gz blog-e33c245d910e55b8cab407a03e669470509a705d.tar.xz blog-e33c245d910e55b8cab407a03e669470509a705d.zip |
Several changes have been made in this commit, which together with the previous commits result in version 1.1:v1.1
+ The rules for the Apache and nginx configuration have been changed and redirects now all requests to the index.php.
+ A router class has been added which now handles all requests that arrives at the application on the index.php.
+ Short-hand functions "PAGE", "POST" and "USER" for use in templates added to get specific item data by ID.
+ More language variables have been added to the core language.
Diffstat (limited to 'template/standard/html/main.php')
-rw-r--r-- | template/standard/html/main.php | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/template/standard/html/main.php b/template/standard/html/main.php index 19d3b29..e6c0e10 100644 --- a/template/standard/html/main.php +++ b/template/standard/html/main.php @@ -6,6 +6,14 @@ # [see documentation] # # # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# + +#=============================================================================== +# Escape parameters which are used several times here to reduce escapeHTML calls +#=============================================================================== +$HEAD_NAME = isset($HEAD['NAME']) ? escapeHTML($HEAD['NAME']) : NULL; +$HEAD_DESC = isset($HEAD['DESC']) ? escapeHTML($HEAD['DESC']) : NULL; +$BLOGMETA_NAME = escapeHTML($BLOGMETA['NAME']); +$BLOGMETA_DESC = escapeHTML($BLOGMETA['DESC']); ?> <!DOCTYPE html> <html lang="<?=$BLOGMETA['LANG']?>"> @@ -14,16 +22,16 @@ <meta name="referrer" content="origin-when-crossorigin" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> -<?php if(isset($HEAD['DESC'])): ?> - <meta name="description" content="<?=escapeHTML($HEAD['DESC'])?>" /> +<?php if(isset($HEAD_DESC)): ?> + <meta name="description" content="<?=$HEAD_DESC?>" /> <?php endif; ?> <?php if(isset($HEAD['PERM'])): ?> <link rel="canonical" href="<?=$HEAD['PERM']?>" /> <?php endif; ?> - <meta property="og:site_name" content="<?=escapeHTML($BLOGMETA['NAME'])?>" /> - <meta property="og:title" content="<?=escapeHTML($HEAD['NAME'])?>" /> + <meta property="og:site_name" content="<?=$BLOGMETA_NAME?>" /> + <meta property="og:title" content="<?=$HEAD_NAME?>" /> <meta property="og:image" content="<?=Application::getTemplateURL('rsrc/logo.png')?>" /> <?php if(isset($HEAD['OG_IMAGES'])): ?> @@ -35,18 +43,18 @@ <link rel="icon" href="<?=Application::getURL('favicon.ico')?>" /> <link rel="stylesheet" href="<?=Application::getTemplateURL('rsrc/main.css')?>" /> - <link rel="alternate" type="application/rss+xml" href="<?=Application::getURL('feed/')?>" title="<?=escapeHTML($BLOGMETA['NAME'])?>" /> - <link rel="alternate" type="application/rss+xml" href="<?=Application::getURL('feed/post/')?>" title="<?=escapeHTML($BLOGMETA['NAME'])?> [<?=$Language->template('feed_only_posts')?>]" /> - <link rel="alternate" type="application/rss+xml" href="<?=Application::getURL('feed/page/')?>" title="<?=escapeHTML($BLOGMETA['NAME'])?> [<?=$Language->template('feed_only_pages')?>]" /> + <link rel="alternate" type="application/rss+xml" title="<?=$Language->text('feed_name_items', $BLOGMETA_NAME)?>" href="<?=Application::getURL('feed/')?>" /> + <link rel="alternate" type="application/rss+xml" title="<?=$Language->text('feed_name_posts', $BLOGMETA_NAME)?>" href="<?=Application::getURL('feed/post/')?>" /> + <link rel="alternate" type="application/rss+xml" title="<?=$Language->text('feed_name_pages', $BLOGMETA_NAME)?>" href="<?=Application::getURL('feed/page/')?>" /> - <title><?=escapeHTML("{$HEAD['NAME']} | {$BLOGMETA['NAME']} {$BLOGMETA['DESC']}")?></title> + <title><?="{$HEAD_NAME} | {$BLOGMETA_NAME} {$BLOGMETA_DESC}"?></title> </head> <body> <section id="container"> <header id="main-header"> <section> - <a href="<?=Application::getURL()?>" title="<?=escapeHTML("{$BLOGMETA['NAME']} {$BLOGMETA['DESC']}")?>"> - <img id="main-logo" src="<?=Application::getTemplateURL('rsrc/logo.png')?>" alt="<?=escapeHTML($BLOGMETA['NAME'])?>" /> + <a href="<?=Application::getURL()?>" title="<?="{$BLOGMETA_NAME} {$BLOGMETA_DESC}"?>"> + <img id="main-logo" src="<?=Application::getTemplateURL('rsrc/logo.png')?>" alt="<?=$BLOGMETA_NAME?>" /> </a> </section> <nav id="main-navi"> @@ -54,7 +62,7 @@ <input type="checkbox" id="toogle-nav" /> <ul> <li> - <a href="<?=Application::getURL()?>" title="<?=$Language->template('navigation_home_desc', escapeHTML($BLOGMETA['NAME']))?>"> + <a href="<?=Application::getURL()?>" title="<?=$Language->template('navigation_home_desc', $BLOGMETA_NAME)?>"> <i class="fa fa-home"></i><?=$Language->template('navigation_home_text')?> </a> </li> @@ -85,7 +93,7 @@ <?=$HTML?> </main> <footer id="main-footer"> - © <?=escapeHTML($BLOGMETA['NAME'])?> + © <?=$BLOGMETA_NAME?> </footer> </section> </body> |