Browse Source

Cleaning up

pull/255/head
Danang Probo Sayekti 10 years ago
parent
commit
2a33c284f1
2 changed files with 17 additions and 126 deletions
  1. +16
    -15
      system/htmly.php
  2. +1
    -111
      system/includes/functions.php

+ 16
- 15
system/htmly.php View File

@ -41,7 +41,7 @@ get('/index', function () {
'description' => blog_description(), 'description' => blog_description(),
'canonical' => site_url(), 'canonical' => site_url(),
'bodyclass' => 'noposts', 'bodyclass' => 'noposts',
'is_front' => is_front(true),
'is_front' => true,
)); ));
die; die;
@ -56,7 +56,7 @@ get('/index', function () {
'bodyclass' => 'infront', 'bodyclass' => 'infront',
'breadcrumb' => '', 'breadcrumb' => '',
'pagination' => has_pagination($total, $perpage, $page), '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, 'name' => $author->name,
'bodyclass' => 'inprofile', 'bodyclass' => 'inprofile',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Profile for: ' . $author->name, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Profile for: ' . $author->name,
'pagination' => has_pagination($total, $perpage, $page)
'pagination' => has_pagination($total, $perpage, $page),
'is_profile' => true,
)); ));
die; die;
} }
@ -166,7 +167,7 @@ get('/author/:name', function ($name) {
'bodyclass' => 'inprofile', 'bodyclass' => 'inprofile',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Profile for: ' . $author->name, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Profile for: ' . $author->name,
'pagination' => has_pagination($total, $perpage, $page), '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', 'bodyclass' => 'incategory',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; ' . $desc->title, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; ' . $desc->title,
'pagination' => has_pagination($total, $perpage, $page), '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', 'bodyclass' => 'intag',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Posts tagged: ' . tag_i18n($tag), 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Posts tagged: ' . tag_i18n($tag),
'pagination' => has_pagination($total, $perpage, $page), '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', 'bodyclass' => 'inarchive',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Archive for: ' . $timestamp, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Archive for: ' . $timestamp,
'pagination' => has_pagination($total, $perpage, $page), 'pagination' => has_pagination($total, $perpage, $page),
'is_archive' => is_archive(true),
'is_archive' => true,
)); ));
}); });
@ -1556,7 +1557,7 @@ get('/search/:keyword', function ($keyword) {
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; No search results', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; No search results',
'canonical' => site_url(), 'canonical' => site_url(),
'bodyclass' => 'error-404-search', 'bodyclass' => 'error-404-search',
'is_search' => is_search(true),
'is_search' => true,
)); ));
die; die;
} }
@ -1572,7 +1573,7 @@ get('/search/:keyword', function ($keyword) {
'bodyclass' => 'insearch', 'bodyclass' => 'insearch',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Search results for: ' . tag_i18n($keyword), 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Search results for: ' . tag_i18n($keyword),
'pagination' => has_pagination($total, $perpage, $page), '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), 'prev' => has_prev($prev),
'next' => has_next($next), 'next' => has_next($next),
'type' => $var, 'type' => $var,
'is_post' => is_post(true),
'is_post' => true,
)); ));
}); });
@ -2050,7 +2051,7 @@ get('/:static', function ($static) {
'description' => blog_title() . ' Blog Homepage', 'description' => blog_title() . ' Blog Homepage',
'canonical' => site_url(), 'canonical' => site_url(),
'bodyclass' => 'noposts', 'bodyclass' => 'noposts',
'is_front' => is_front(true),
'is_front' => true,
)); ));
die; die;
@ -2065,7 +2066,7 @@ get('/:static', function ($static) {
'bodyclass' => 'inblog', 'bodyclass' => 'inblog',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Blog', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; Blog',
'pagination' => has_pagination($total, $perpage, $page), 'pagination' => has_pagination($total, $perpage, $page),
'is_blog' => is_blog(true),
'is_blog' => true,
)); ));
} else { } else {
@ -2098,7 +2099,7 @@ get('/:static', function ($static) {
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; ' . $post->title, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; ' . $post->title,
'p' => $post, 'p' => $post,
'type' => 'staticPage', 'type' => 'staticPage',
'is_page' => is_page(true),
'is_page' => true,
)); ));
} }
}); });
@ -2321,7 +2322,7 @@ get('/:static/:sub', function ($static, $sub) {
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $father_post[0]->url . '">' . $father_post[0]->title . '</a> &#187; ' . $post->title, 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; <a href="' . $father_post[0]->url . '">' . $father_post[0]->title . '</a> &#187; ' . $post->title,
'p' => $post, 'p' => $post,
'type' => 'subPage', '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), 'prev' => has_prev($prev),
'next' => has_next($next), 'next' => has_next($next),
'type' => $var, 'type' => $var,
'is_post' => is_post(true),
'is_post' => true,
)); ));
}); });


+ 1
- 111
system/includes/functions.php View File

@ -1763,7 +1763,7 @@ function not_found()
'canonical' => site_url(), 'canonical' => site_url(),
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; 404 Not Found', 'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; 404 Not Found',
'bodyclass' => 'error-404', 'bodyclass' => 'error-404',
'is_notfound' => is_notfound(true),
'is_notfound' => true,
)); ));
die(); 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 // Return blog title
function blog_title() function blog_title()
{ {


Loading…
Cancel
Save