diff options
author | Thomas Lange <code@nerdmind.de> | 2021-06-17 22:00:39 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2021-06-17 22:00:39 +0200 |
commit | 5555624546ea48d6327700f32b80848e0662dc90 (patch) | |
tree | 47d61fb756a6cb008aaf33586d292fcfe43da2a1 /core/include/post/main.php | |
parent | 91d8a28c664afa5378735bcd0efe068dd74d589f (diff) | |
parent | 0a2614cb69fc732c2115ef2f0c356f39f602d311 (diff) | |
download | blog-5555624546ea48d6327700f32b80848e0662dc90.tar.gz blog-5555624546ea48d6327700f32b80848e0662dc90.tar.xz blog-5555624546ea48d6327700f32b80848e0662dc90.zip |
Merge branch 'master' into 'optimization'optimization
Diffstat (limited to 'core/include/post/main.php')
-rw-r--r-- | core/include/post/main.php | 53 |
1 files changed, 18 insertions, 35 deletions
diff --git a/core/include/post/main.php b/core/include/post/main.php index aa5dc50..8c65740 100644 --- a/core/include/post/main.php +++ b/core/include/post/main.php @@ -6,7 +6,7 @@ $Database = Application::getDatabase(); $Language = Application::getLanguage(); #=============================================================================== -# TRY: Post\Exception, User\Exception +# TRY: Post\Exception #=============================================================================== try { if(Application::get('POST.SLUG_URLS')) { @@ -36,36 +36,27 @@ try { } catch(Post\Exception $Exception){} #=============================================================================== - # TRY: Template\Exception + # Build document #=============================================================================== - try { - $PostTemplate = Template\Factory::build('post/main'); - $PostTemplate->set('POST', $post_data); - $PostTemplate->set('USER', $user_data); - - $MainTemplate = Template\Factory::build('main'); - $MainTemplate->set('HTML', $PostTemplate); - $MainTemplate->set('HEAD', [ - 'NAME' => $post_data['ATTR']['NAME'], - 'DESC' => description($post_data['BODY']['HTML'](), Application::get('POST.DESCRIPTION_SIZE')), - 'PERM' => $post_data['URL'], - 'OG_IMAGES' => $post_data['FILE']['LIST'] - ]); + $PostTemplate = Template\Factory::build('post/main'); + $PostTemplate->set('POST', $post_data); + $PostTemplate->set('USER', $user_data); - # Get access to the current item data from main template - $MainTemplate->set('TYPE', 'POST'); - $MainTemplate->set('POST', $post_data); - $MainTemplate->set('USER', $user_data); + $MainTemplate = Template\Factory::build('main'); + $MainTemplate->set('HTML', $PostTemplate); + $MainTemplate->set('HEAD', [ + 'NAME' => $post_data['ATTR']['NAME'], + 'DESC' => description($post_data['BODY']['HTML'](), Application::get('POST.DESCRIPTION_SIZE')), + 'PERM' => $post_data['URL'], + 'OG_IMAGES' => $post_data['FILE']['LIST'] + ]); - echo $MainTemplate; - } + # Get access to the current item data from main template + $MainTemplate->set('TYPE', 'POST'); + $MainTemplate->set('POST', $post_data); + $MainTemplate->set('USER', $user_data); - #=============================================================================== - # CATCH: Template\Exception - #=============================================================================== - catch(Template\Exception $Exception) { - Application::exit($Exception->getMessage()); - } + echo $MainTemplate; } #=============================================================================== @@ -86,11 +77,3 @@ catch(Post\Exception $Exception) { Application::error404(); } } - -#=============================================================================== -# CATCH: User\Exception -#=============================================================================== -catch(User\Exception $Exception) { - Application::exit($Exception->getMessage()); -} -?>
\ No newline at end of file |