aboutsummaryrefslogtreecommitdiffstats
path: root/core/include/post/main.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/include/post/main.php')
-rw-r--r--core/include/post/main.php52
1 files changed, 18 insertions, 34 deletions
diff --git a/core/include/post/main.php b/core/include/post/main.php
index d891416..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,10 +77,3 @@ catch(Post\Exception $Exception) {
Application::error404();
}
}
-
-#===============================================================================
-# CATCH: User\Exception
-#===============================================================================
-catch(User\Exception $Exception) {
- Application::exit($Exception->getMessage());
-}