From 2a33c284f1e2862fbee07e381f88e56d8c4ed3f1 Mon Sep 17 00:00:00 2001 From: Danang Probo Sayekti Date: Mon, 21 Sep 2015 11:18:06 +0700 Subject: [PATCH] Cleaning up --- system/htmly.php | 31 ++++++------ system/includes/functions.php | 112 +----------------------------------------- 2 files changed, 17 insertions(+), 126 deletions(-) diff --git a/system/htmly.php b/system/htmly.php index c020f19..ff464d1 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -41,7 +41,7 @@ get('/index', function () { 'description' => blog_description(), 'canonical' => site_url(), 'bodyclass' => 'noposts', - 'is_front' => is_front(true), + 'is_front' => true, )); die; @@ -56,7 +56,7 @@ get('/index', function () { 'bodyclass' => 'infront', 'breadcrumb' => '', 'pagination' => has_pagination($total, $perpage, $page), - 'is_front' => is_front(true), + 'is_front' => true, )); }); @@ -150,7 +150,8 @@ get('/author/:name', function ($name) { 'name' => $author->name, 'bodyclass' => 'inprofile', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Profile for: ' . $author->name, - 'pagination' => has_pagination($total, $perpage, $page) + 'pagination' => has_pagination($total, $perpage, $page), + 'is_profile' => true, )); die; } @@ -166,7 +167,7 @@ get('/author/:name', function ($name) { 'bodyclass' => 'inprofile', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Profile for: ' . $author->name, 'pagination' => has_pagination($total, $perpage, $page), - 'is_profile' => is_profile(true), + 'is_profile' => true, )); }); @@ -1331,7 +1332,7 @@ get('/category/:category', function ($category) { 'bodyclass' => 'incategory', 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $desc->title, 'pagination' => has_pagination($total, $perpage, $page), - 'is_category' => is_category(true), + 'is_category' => true, )); }); @@ -1482,7 +1483,7 @@ get('/tag/:tag', function ($tag) { 'bodyclass' => 'intag', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Posts tagged: ' . tag_i18n($tag), 'pagination' => has_pagination($total, $perpage, $page), - 'is_tag' => is_tag(true), + 'is_tag' => true, )); }); @@ -1531,7 +1532,7 @@ get('/archive/:req', function ($req) { 'bodyclass' => 'inarchive', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Archive for: ' . $timestamp, 'pagination' => has_pagination($total, $perpage, $page), - 'is_archive' => is_archive(true), + 'is_archive' => true, )); }); @@ -1556,7 +1557,7 @@ get('/search/:keyword', function ($keyword) { 'breadcrumb' => '' . config('breadcrumb.home') . ' » No search results', 'canonical' => site_url(), 'bodyclass' => 'error-404-search', - 'is_search' => is_search(true), + 'is_search' => true, )); die; } @@ -1572,7 +1573,7 @@ get('/search/:keyword', function ($keyword) { 'bodyclass' => 'insearch', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Search results for: ' . tag_i18n($keyword), 'pagination' => has_pagination($total, $perpage, $page), - 'is_search' => is_search(true), + 'is_search' => true, )); }); @@ -1689,7 +1690,7 @@ get('/post/:name', function ($name) { 'prev' => has_prev($prev), 'next' => has_next($next), 'type' => $var, - 'is_post' => is_post(true), + 'is_post' => true, )); }); @@ -2050,7 +2051,7 @@ get('/:static', function ($static) { 'description' => blog_title() . ' Blog Homepage', 'canonical' => site_url(), 'bodyclass' => 'noposts', - 'is_front' => is_front(true), + 'is_front' => true, )); die; @@ -2065,7 +2066,7 @@ get('/:static', function ($static) { 'bodyclass' => 'inblog', 'breadcrumb' => '' . config('breadcrumb.home') . ' » Blog', 'pagination' => has_pagination($total, $perpage, $page), - 'is_blog' => is_blog(true), + 'is_blog' => true, )); } else { @@ -2098,7 +2099,7 @@ get('/:static', function ($static) { 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $post->title, 'p' => $post, 'type' => 'staticPage', - 'is_page' => is_page(true), + 'is_page' => true, )); } }); @@ -2321,7 +2322,7 @@ get('/:static/:sub', function ($static, $sub) { 'breadcrumb' => '' . config('breadcrumb.home') . ' » ' . $father_post[0]->title . ' » ' . $post->title, 'p' => $post, 'type' => 'subPage', - 'is_subpage' => is_subpage(true), + 'is_subpage' => true, )); }); @@ -2546,7 +2547,7 @@ get('/:year/:month/:name', function ($year, $month, $name) { 'prev' => has_prev($prev), 'next' => has_next($next), 'type' => $var, - 'is_post' => is_post(true), + 'is_post' => true, )); }); diff --git a/system/includes/functions.php b/system/includes/functions.php index 518775e..b3231b8 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -1763,7 +1763,7 @@ function not_found() 'canonical' => site_url(), 'breadcrumb' => '' . config('breadcrumb.home') . ' » 404 Not Found', 'bodyclass' => 'error-404', - 'is_notfound' => is_notfound(true), + 'is_notfound' => true, )); die(); } @@ -2226,116 +2226,6 @@ function is_index() } } -// TRUE if the current page is the front page. -function is_front($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is the blog page. -function is_blog($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is tag index. -function is_tag($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is archive index. -function is_archive($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is search index. -function is_search($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is category index. -function is_category($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is profile page. -function is_profile($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is post page. -function is_post($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is static page page. -function is_page($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is sub static page. -function is_subpage($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - -// TRUE if the current page is 404 error page. -function is_notfound($value = null) -{ - if (!empty($value)) { - return true; - } else { - return false; - } -} - // Return blog title function blog_title() {