From e33c245d910e55b8cab407a03e669470509a705d Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 10 Mar 2017 21:46:12 +0100 Subject: Several changes have been made in this commit, which together with the previous commits result in version 1.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. --- .ht-nginx | 25 +++------ .htaccess | 15 ++--- core/application.php | 2 +- core/configuration-example.php | 52 ++++++++--------- core/functions.php | 42 +++++++++++++- core/language/de.php | 7 +++ core/language/en.php | 7 +++ core/namespace/Router.php | 64 +++++++++++++++++++++ index.php | 105 +++++++++++++++++++++++------------ system/feed/main.php | 11 ++-- system/home.php | 55 ++++++++++++++++++ system/page/list.php | 5 +- system/page/main.php | 13 +++-- system/post/list.php | 5 +- system/post/main.php | 13 +++-- system/search/main.php | 6 +- system/user/list.php | 5 +- system/user/main.php | 13 +++-- template/standard/html/feed/main.php | 10 ++-- template/standard/html/main.php | 32 +++++++---- template/standard/lang/de.php | 6 -- template/standard/lang/en.php | 6 -- 22 files changed, 348 insertions(+), 151 deletions(-) create mode 100644 core/namespace/Router.php create mode 100644 system/home.php diff --git a/.ht-nginx b/.ht-nginx index 814bea9..9d3053f 100644 --- a/.ht-nginx +++ b/.ht-nginx @@ -4,7 +4,8 @@ # # # This file contains the configuration from the Apaches .htaccess file written # # for the nginx high performance web server. Put the content of this file into # -# the "server {}" block of your nginx virtual host configuration file. # +# the "server {}" block of your nginx virtual host configuration file. If your # +# blog installation is within a sub directory, you need to adjust this values! # # # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# @@ -17,21 +18,13 @@ error_page 404 /system/404.php; #=============================================================================== # Forbidden directories #=============================================================================== -location ~ ^/core|template/(.*)/(html|lang)/ { - return 403; +location ~ ^/(core|template/([^/]+)/(html|lang)/) { + return 403; } -#=========================================================================== +#=============================================================================== # Main rules -#=========================================================================== -rewrite ^/(page|post|user)/([^/]+)/$ /system/$1/main.php?param=$2 break; -rewrite ^/(page|post|user)/$ /system/$1/list.php break; -rewrite ^/feed/(page|post)/$ /system/feed/main.php?item=$1 break; -rewrite ^/(feed|search)/$ /system/$1/main.php break; - -#=========================================================================== -# Trailing slashes -#=========================================================================== -rewrite ^/(page|post|user)/([^/]+)$ /$1/$2/ redirect; -rewrite ^/(page|post|user|feed|search)$ /$1/ redirect; -rewrite ^/feed/(post|page)$ /feed/$1/ redirect; \ No newline at end of file +#=============================================================================== +if (!-e $request_filename) { + rewrite ^(.*)$ /index.php break; +} \ No newline at end of file diff --git a/.htaccess b/.htaccess index af8639d..2a87ccc 100644 --- a/.htaccess +++ b/.htaccess @@ -23,19 +23,12 @@ ErrorDocument 404 /system/404.php #=============================================================================== # Forbidden directories #=============================================================================== -RewriteRule ^core|template/(.*)/(html|lang)/ - [F] +RewriteRule ^(core|template/([^/]+)/(html|lang)/) - [F] #=============================================================================== # Main rules #=============================================================================== -RewriteRule ^(page|post|user)/([^/]+)/$ system/$1/main.php?param=$2 [L] -RewriteRule ^(page|post|user)/$ system/$1/list.php [L] -RewriteRule ^feed/(page|post)/$ system/feed/main.php?item=$1 [L] -RewriteRule ^(feed|search)/$ system/$1/main.php [L] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteCond %{REQUEST_FILENAME} !-d -#=============================================================================== -# Trailing slashes -#=============================================================================== -RewriteRule ^(page|post|user)/([^/]+)$ %{REQUEST_URI}/ [R,L] -RewriteRule ^(page|post|user|feed|search)$ %{REQUEST_URI}/ [R,L] -RewriteRule ^feed/(post|page)$ %{REQUEST_URI}/ [R,L] \ No newline at end of file +RewriteRule ^(.*)$ index.php [L] \ No newline at end of file diff --git a/core/application.php b/core/application.php index 58dd728..11f5b83 100644 --- a/core/application.php +++ b/core/application.php @@ -3,7 +3,7 @@ # Application initialization [Thomas Lange ] # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# # # -# This file is included by each file from the system or admin directory. # +# This file brings the application up! # # # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# diff --git a/core/configuration-example.php b/core/configuration-example.php index 1416621..d56ce84 100644 --- a/core/configuration-example.php +++ b/core/configuration-example.php @@ -23,7 +23,7 @@ Application::set('BLOGMETA.MAIL', 'mail@example.org'); Application::set('BLOGMETA.LANG', 'en'); #=============================================================================== -# Settings for database connection +# Database configuration #=============================================================================== Application::set('DATABASE.HOSTNAME', 'localhost'); Application::set('DATABASE.BASENAME', 'blog'); @@ -31,33 +31,47 @@ Application::set('DATABASE.USERNAME', ''); Application::set('DATABASE.PASSWORD', ''); #=============================================================================== -# Backend configuration +# Template configuration #=============================================================================== -Application::set('ADMIN.TEMPLATE', 'admin'); -Application::set('ADMIN.LANGUAGE', Application::get('CORE.LANGUAGE')); +Application::set('TEMPLATE.NAME', 'standard'); +Application::set('TEMPLATE.LANG', Application::get('CORE.LANGUAGE')); #=============================================================================== -# Settings for template configuration +# Backend configuration #=============================================================================== -Application::set('TEMPLATE.NAME', 'standard'); -Application::set('TEMPLATE.LANG', Application::get('CORE.LANGUAGE')); +Application::set('ADMIN.TEMPLATE', 'admin'); +Application::set('ADMIN.LANGUAGE', Application::get('CORE.LANGUAGE')); #=============================================================================== -# Protocol, hostname and path for this installation +# Protocol, hostname and base directory for this installation #=============================================================================== Application::set('PATHINFO.PROT', $_SERVER['REQUEST_SCHEME']); Application::set('PATHINFO.HOST', $_SERVER['HTTP_HOST']); Application::set('PATHINFO.BASE', ''); #=============================================================================== -# Enable or disable the use of slug URLs for item permalinks +# Item base directories +#=============================================================================== +Application::set('PAGE.DIRECTORY', 'page'); +Application::set('POST.DIRECTORY', 'post'); +Application::set('USER.DIRECTORY', 'user'); + +#=============================================================================== +# Use slug URLs for item permalinks #=============================================================================== Application::set('PAGE.SLUG_URLS', TRUE); Application::set('POST.SLUG_URLS', TRUE); Application::set('USER.SLUG_URLS', TRUE); #=============================================================================== -# Number of items to display on feed and overview sites +# Parse emoticons in items content +#=============================================================================== +Application::set('PAGE.EMOTICONS', TRUE); +Application::set('POST.EMOTICONS', TRUE); +Application::set('USER.EMOTICONS', TRUE); + +#=============================================================================== +# Number of items to show on feed and item overview #=============================================================================== Application::set('PAGE.LIST_SIZE', 10); Application::set('POST.LIST_SIZE', 10); @@ -66,28 +80,14 @@ Application::set('PAGE.FEED_SIZE', 25); Application::set('POST.FEED_SIZE', 25); #=============================================================================== -# Settings for item URL generation (you have to change the .htaccess as well!) -#=============================================================================== -Application::set('PAGE.DIRECTORY', 'page'); -Application::set('POST.DIRECTORY', 'post'); -Application::set('USER.DIRECTORY', 'user'); - -#=============================================================================== -# Enable or disable the use of emoticons for item content -#=============================================================================== -Application::set('PAGE.EMOTICONS', TRUE); -Application::set('POST.EMOTICONS', TRUE); -Application::set('USER.EMOTICONS', TRUE); - -#=============================================================================== -# Number of characters to display in the items description +# Number of characters to show in the items description #=============================================================================== Application::set('PAGE.DESCRIPTION_SIZE', 200); Application::set('POST.DESCRIPTION_SIZE', 200); Application::set('USER.DESCRIPTION_SIZE', 200); #=============================================================================== -# "ORDER BY" clause for item sorting on feed and overview sites +# "ORDER BY" clause for item sorting on feed and item overview #=============================================================================== Application::set('PAGE.LIST_SORT', 'time_insert DESC'); Application::set('POST.LIST_SORT', 'time_insert DESC'); diff --git a/core/functions.php b/core/functions.php index 726e96f..471c14f 100644 --- a/core/functions.php +++ b/core/functions.php @@ -308,9 +308,9 @@ function excerpt($string, $length = 500, $replace = ' […]') { return $string; } -#==================================================================================================== +#=============================================================================== # Generate a valid slug URL part from a string -#==================================================================================================== +#=============================================================================== function makeSlugURL($string) { $string = strtolower($string); $string = str_replace(['ä', 'ö', 'ü', 'ß'], ['ae', 'oe', 'ue', 'ss'], $string); @@ -319,4 +319,40 @@ function makeSlugURL($string) { return trim($string, '-'); } -?> + +#=============================================================================== +# Function to get data from specific page in templates +#=============================================================================== +function PAGE($id) { + try { + $Page = Page\Factory::build($id); + return generatePageItemData($Page); + } catch(Page\Exception $Exception) { + return NULL; + } +} + +#=============================================================================== +# Function to get data from specific post in templates +#=============================================================================== +function POST($id) { + try { + $Post = Post\Factory::build($id); + return generatePostItemData($Post); + } catch(Post\Exception $Exception) { + return NULL; + } +} + +#=============================================================================== +# Function to get data from specific user in templates +#=============================================================================== +function USER($id) { + try { + $User = User\Factory::build($id); + return generateUserItemData($User); + } catch(User\Exception $Exception) { + return NULL; + } +} +?> \ No newline at end of file diff --git a/core/language/de.php b/core/language/de.php index dc6e924..c310719 100644 --- a/core/language/de.php +++ b/core/language/de.php @@ -191,4 +191,11 @@ $LANGUAGE['title_user_overview'] = "{$LANGUAGE['user_overview']} [%d]"; #=============================================================================== $LANGUAGE['title_search_request'] = 'Volltextsuche'; $LANGUAGE['title_search_results'] = 'Ergebnisse für "%s"'; + +#=============================================================================== +# Feed names +#=============================================================================== +$LANGUAGE['feed_name_items'] = '%s [alle Inhalte]'; +$LANGUAGE['feed_name_pages'] = '%s [nur Seiten]'; +$LANGUAGE['feed_name_posts'] = '%s [nur Beiträge]'; ?> \ No newline at end of file diff --git a/core/language/en.php b/core/language/en.php index 3e48191..55c0ce3 100644 --- a/core/language/en.php +++ b/core/language/en.php @@ -191,4 +191,11 @@ $LANGUAGE['title_user_overview'] = "{$LANGUAGE['user_overview']} [%d]"; #=============================================================================== $LANGUAGE['title_search_request'] = 'Fulltext search'; $LANGUAGE['title_search_results'] = 'Results for "%s"'; + +#=============================================================================== +# Feed names +#=============================================================================== +$LANGUAGE['feed_name_items'] = '%s [all content]'; +$LANGUAGE['feed_name_pages'] = '%s [only pages]'; +$LANGUAGE['feed_name_posts'] = '%s [only posts]'; ?> \ No newline at end of file diff --git a/core/namespace/Router.php b/core/namespace/Router.php new file mode 100644 index 0000000..22784c2 --- /dev/null +++ b/core/namespace/Router.php @@ -0,0 +1,64 @@ + 'route', + 'pattern' => $pattern, + 'callback' => $callback + ]; + } + + #=============================================================================== + # Add redirect + #=============================================================================== + public static function addRedirect($pattern, $location, $code = 302) { + $pattern = Application::get('PATHINFO.BASE').$pattern; + + return self::$routes[] = [ + 'type' => 'redirect', + 'code' => $code, + 'pattern' => $pattern, + 'location' => $location + ]; + } + + #=============================================================================== + # Execute routing + #=============================================================================== + public static function execute($path) { + $path = ltrim($path, '/'); + $route_found = FALSE; + + foreach(self::$routes as $route) { + if($route['type'] === 'redirect') { + $location = preg_replace("#^{$route['pattern']}$#", $route['location'], $path, -1, $count); + + if($count) { + HTTP::redirect($location, $route['code']); + } + } + + else { + if(preg_match("#^{$route['pattern']}$#", $path, $matches)) { + # Remove the first element from matches which contains the whole string. + array_shift($matches); + + $route_found = TRUE; + call_user_func_array($route['callback'], $matches); + } + } + } + + if($route_found === FALSE) { + require_once 'system/404.php'; + } + } +} +?> \ No newline at end of file diff --git a/index.php b/index.php index b07fee6..936abe2 100644 --- a/index.php +++ b/index.php @@ -5,50 +5,85 @@ require_once 'core/application.php'; #=============================================================================== -# TRY: Template\Exception +# Item base directory paths #=============================================================================== -try { - $execSQL = 'SELECT id FROM %s ORDER BY '.Application::get('POST.LIST_SORT').' LIMIT '.Application::get('POST.LIST_SIZE'); - $Statement = $Database->query(sprintf($execSQL, Post\Attribute::TABLE)); +$PAGEPATH = Application::get('PAGE.DIRECTORY'); +$POSTPATH = Application::get('POST.DIRECTORY'); +$USERPATH = Application::get('USER.DIRECTORY'); - $postIDs = $Statement->fetchAll($Database::FETCH_COLUMN); +#=============================================================================== +# ROUTE: Item +#=============================================================================== +Router::add("{$PAGEPATH}/([^/]+)/", function($param) { require 'system/page/main.php'; }); +Router::add("{$POSTPATH}/([^/]+)/", function($param) { require 'system/post/main.php'; }); +Router::add("{$USERPATH}/([^/]+)/", function($param) { require 'system/user/main.php'; }); + +#=============================================================================== +# ROUTE: Item overview +#=============================================================================== +Router::add("{$PAGEPATH}/", function() { require 'system/page/list.php'; }); +Router::add("{$POSTPATH}/", function() { require 'system/post/list.php'; }); +Router::add("{$USERPATH}/", function() { require 'system/user/list.php'; }); + +#=============================================================================== +# REDIRECT: Item (trailing slash) +#=============================================================================== +Router::addRedirect("{$PAGEPATH}/([^/]+)", Application::getPageURL('$1/')); +Router::addRedirect("{$POSTPATH}/([^/]+)", Application::getPostURL('$1/')); +Router::addRedirect("{$USERPATH}/([^/]+)", Application::getUserURL('$1/')); + +#=============================================================================== +# REDIRECT: Item overview (trailing slash) +#=============================================================================== +Router::addRedirect("{$PAGEPATH}", Application::getPageURL()); +Router::addRedirect("{$POSTPATH}", Application::getPostURL()); +Router::addRedirect("{$USERPATH}", Application::getUserURL()); + +#=============================================================================== +# ROUTE: Home +#=============================================================================== +Router::add('', function() { + require 'system/home.php'; +}); - foreach($postIDs as $postID) { - try { - $Post = Post\Factory::build($postID); - $User = User\Factory::build($Post->attr('user')); +#=============================================================================== +# ROUTE: Feed +#=============================================================================== +Router::add('feed/', function() { + require 'system/feed/main.php'; +}); - $ItemTemplate = generatePostItemTemplate($Post, $User); +#=============================================================================== +# ROUTE: Feed [item type only] +#=============================================================================== +Router::add('feed/(page|post)/', function($param) { + require 'system/feed/main.php'; +}); - $posts[] = $ItemTemplate; - } - catch(Post\Exception $Exception){} - catch(User\Exception $Exception){} - } +#=============================================================================== +# ROUTE: Search +#=============================================================================== +Router::add('search/', function() { + require 'system/search/main.php'; +}); - $HomeTemplate = Template\Factory::build('home'); - $HomeTemplate->set('PAGINATION', [ - 'HTML' => generatePostNaviTemplate(1) - ]); - $HomeTemplate->set('LIST', [ - 'POSTS' => $posts ?? [] - ]); +#=============================================================================== +# REDIRECT: Feed (trailing slash) +#=============================================================================== +Router::addRedirect('feed', Application::getURL('feed/')); - $MainTemplate = Template\Factory::build('main'); - $MainTemplate->set('HTML', $HomeTemplate); - $MainTemplate->set('HEAD', [ - 'NAME' => Application::get('BLOGMETA.HOME'), - 'DESC' => Application::get('BLOGMETA.NAME').' – '.Application::get('BLOGMETA.DESC'), - 'PERM' => Application::getURL() - ]); +#=============================================================================== +# REDIRECT: Feed [posts or pages] (trailing slash) +#=============================================================================== +Router::addRedirect('feed/(page|post)', Application::getURL('feed/$1/')); - echo $MainTemplate; -} +#=============================================================================== +# REDIRECT: Search (trailing slash) +#=============================================================================== +Router::addRedirect('search', Application::getURL('search/')); #=============================================================================== -# CATCH: Template\Exception +# Execute router and route requests #=============================================================================== -catch(Template\Exception $Exception) { - $Exception->defaultHandler(); -} +Router::execute(parse_url(HTTP::requestURI(), PHP_URL_PATH)); ?> \ No newline at end of file diff --git a/system/feed/main.php b/system/feed/main.php index 00ac4b8..ffb9b3a 100644 --- a/system/feed/main.php +++ b/system/feed/main.php @@ -1,8 +1,9 @@ query(sprintf($execSQL, Post\Attribute::TABLE))->fetchAll($Database::FETCH_COLUMN); @@ -34,7 +35,7 @@ try { } } - if(HTTP::GET('item') !== 'post') { + if(!isset($param) OR $param !== 'post') { $execSQL = 'SELECT id FROM %s ORDER BY '.Application::get('PAGE.FEED_SORT').' LIMIT '.Application::get('PAGE.FEED_SIZE'); $pageIDs = $Database->query(sprintf($execSQL, Page\Attribute::TABLE))->fetchAll($Database::FETCH_COLUMN); @@ -57,7 +58,7 @@ try { $FeedTemplate = Template\Factory::build('feed/main'); $FeedTemplate->set('FEED', [ - 'TYPE' => HTTP::GET('item'), + 'TYPE' => $param ?? NULL, 'LIST' => [ 'POSTS' => $posts ?? [], 'PAGES' => $pages ?? [], diff --git a/system/home.php b/system/home.php new file mode 100644 index 0000000..3d20097 --- /dev/null +++ b/system/home.php @@ -0,0 +1,55 @@ +query(sprintf($execSQL, Post\Attribute::TABLE)); + + $postIDs = $Statement->fetchAll($Database::FETCH_COLUMN); + + foreach($postIDs as $postID) { + try { + $Post = Post\Factory::build($postID); + $User = User\Factory::build($Post->attr('user')); + + $ItemTemplate = generatePostItemTemplate($Post, $User); + + $posts[] = $ItemTemplate; + } + catch(Post\Exception $Exception){} + catch(User\Exception $Exception){} + } + + $HomeTemplate = Template\Factory::build('home'); + $HomeTemplate->set('PAGINATION', [ + 'HTML' => generatePostNaviTemplate(1) + ]); + $HomeTemplate->set('LIST', [ + 'POSTS' => $posts ?? [] + ]); + + $MainTemplate = Template\Factory::build('main'); + $MainTemplate->set('HTML', $HomeTemplate); + $MainTemplate->set('HEAD', [ + 'NAME' => Application::get('BLOGMETA.HOME'), + 'DESC' => Application::get('BLOGMETA.NAME').' – '.Application::get('BLOGMETA.DESC'), + 'PERM' => Application::getURL() + ]); + + echo $MainTemplate; +} + +#=============================================================================== +# CATCH: Template\Exception +#=============================================================================== +catch(Template\Exception $Exception) { + $Exception->defaultHandler(); +} +?> \ No newline at end of file diff --git a/system/page/list.php b/system/page/list.php index 5d07d30..7c3956e 100644 --- a/system/page/list.php +++ b/system/page/list.php @@ -1,8 +1,9 @@ attr('user')); @@ -68,9 +69,9 @@ try { catch(Page\Exception $Exception) { try { if(Application::get('PAGE.SLUG_URLS') === FALSE) { - $Page = Page\Factory::buildBySlug(HTTP::GET('param')); + $Page = Page\Factory::buildBySlug($param); } else { - $Page = Page\Factory::build(HTTP::GET('param')); + $Page = Page\Factory::build($param); } HTTP::redirect($Page->getURL()); diff --git a/system/post/list.php b/system/post/list.php index a7d6ce7..7b0630c 100644 --- a/system/post/list.php +++ b/system/post/list.php @@ -1,8 +1,9 @@ attr('user')); @@ -68,9 +69,9 @@ try { catch(Post\Exception $Exception) { try { if(Application::get('POST.SLUG_URLS') === FALSE) { - $Post = Post\Factory::buildBySlug(HTTP::GET('param')); + $Post = Post\Factory::buildBySlug($param); } else { - $Post = Post\Factory::build(HTTP::GET('param')); + $Post = Post\Factory::build($param); } HTTP::redirect($Post->getURL()); diff --git a/system/search/main.php b/system/search/main.php index fe18e7e..97fe8bb 100644 --- a/system/search/main.php +++ b/system/search/main.php @@ -1,8 +1,10 @@ query(sprintf('SELECT DISTINCT DAY(time_insert) AS temp FROM %s ORDER BY temp', Post\Attribute::TABLE)); $M_LIST = $Database->query(sprintf('SELECT DISTINCT MONTH(time_insert) AS temp FROM %s ORDER BY temp', Post\Attribute::TABLE)); diff --git a/system/user/list.php b/system/user/list.php index 1f29473..b724fe8 100644 --- a/system/user/list.php +++ b/system/user/list.php @@ -1,8 +1,9 @@ getURL()); diff --git a/template/standard/html/feed/main.php b/template/standard/html/feed/main.php index 174a841..c8dcc3c 100644 --- a/template/standard/html/feed/main.php +++ b/template/standard/html/feed/main.php @@ -7,17 +7,19 @@ # # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# +$BLOGMETA_NAME = escapeHTML($BLOGMETA['NAME']); + switch($FEED['TYPE']) { case 'post': - $title = escapeHTML($BLOGMETA['NAME']).' ['.$Language->template('feed_only_posts').']'; + $title = $Language->text('feed_name_posts', $BLOGMETA_NAME); $self = Application::getURL('feed/post/'); break; case 'page': - $title = escapeHTML($BLOGMETA['NAME']).' ['.$Language->template('feed_only_pages').']'; + $title = $Language->text('feed_name_pages', $BLOGMETA_NAME); $self = Application::getURL('feed/page/'); break; default: - $title = escapeHTML($BLOGMETA['NAME']); + $title = $Language->text('feed_name_items', $BLOGMETA_NAME); $self = Application::getURL('feed/'); } ?> @@ -32,7 +34,7 @@ switch($FEED['TYPE']) { - <?=escapeHTML($BLOGMETA['NAME'])?> + <?=$BLOGMETA_NAME?> 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']); ?> @@ -14,16 +22,16 @@ - - + + - - + + @@ -35,18 +43,18 @@ - - - + + + - <?=escapeHTML("{$HEAD['NAME']} | {$BLOGMETA['NAME']} {$BLOGMETA['DESC']}")?> + <?="{$HEAD_NAME} | {$BLOGMETA_NAME} {$BLOGMETA_DESC}"?>
- "> - + "> +
diff --git a/template/standard/lang/de.php b/template/standard/lang/de.php index 9a59847..d2b094c 100644 --- a/template/standard/lang/de.php +++ b/template/standard/lang/de.php @@ -13,12 +13,6 @@ #=============================================================================== $LANGUAGE['date_format'] = '[D].[M].[Y] [H]:[I]'; -#=============================================================================== -# Specific item only feed -#=============================================================================== -$LANGUAGE['feed_only_posts'] = 'nur Beiträge'; -$LANGUAGE['feed_only_pages'] = 'nur Seiten'; - #=============================================================================== # Main navigation strings #=============================================================================== diff --git a/template/standard/lang/en.php b/template/standard/lang/en.php index 416574f..c00ec36 100644 --- a/template/standard/lang/en.php +++ b/template/standard/lang/en.php @@ -13,12 +13,6 @@ #=============================================================================== $LANGUAGE['date_format'] = '[Y]-[M]-[D] [H]:[I]'; -#=============================================================================== -# Specific item only feed -#=============================================================================== -$LANGUAGE['feed_only_posts'] = 'only posts'; -$LANGUAGE['feed_only_pages'] = 'only pages'; - #=============================================================================== # Main navigation strings #=============================================================================== -- cgit v1.2.3