Browse Source

Improve search page + 404

pull/255/head
Danang Probo Sayekti 10 years ago
parent
commit
9dd9f87cf5
6 changed files with 23 additions and 19 deletions
  1. +3
    -2
      system/htmly.php
  2. +16
    -5
      system/includes/functions.php
  3. +1
    -3
      themes/blog/layout.html.php
  4. +1
    -3
      themes/clean/layout.html.php
  5. +1
    -3
      themes/default/layout.html.php
  6. +1
    -3
      themes/logs/layout.html.php

+ 3
- 2
system/htmly.php View File

@ -1547,10 +1547,11 @@ get('/search/:keyword', function ($keyword) {
// a non-existing page or no search result
render('404-search', array(
'title' => 'Search results not found! - ' . blog_title(),
'description' => '',
'description' => 'Search results not found!',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; No search results',
'canonical' => site_url() . 'search/' . strtolower($keyword),
'canonical' => site_url(),
'bodyclass' => 'error-404-search',
'is_search' => is_search(true),
));
die;
}


+ 16
- 5
system/includes/functions.php View File

@ -812,7 +812,8 @@ function get_keyword($keyword, $page, $perpage)
}
}
return ($tmp) ? get_posts($tmp, $page, $perpage) : [];
return ($tmp) ? get_posts($tmp, $page, $perpage) : [];
}
// Get related posts base on post tag.
@ -899,8 +900,7 @@ function get_categorycount($var)
// Author string
$str = explode('/', $replaced);
$cat = $str[count($str) - 3];
$cat = '/blog/' . $str[count($str) - 3];
if (stripos($cat, "$var") !== false) {
$tmp[] = $v;
}
@ -1755,10 +1755,11 @@ function not_found()
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
render('404', array(
'title' => 'This page doesn\'t exist! - ' . blog_title(),
'description' => '',
'canonical' => false,
'description' => '404 Not Found',
'canonical' => site_url(),
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; 404 Not Found',
'bodyclass' => 'error-404',
'is_notfound' => is_notfound(true),
));
die();
}
@ -2275,6 +2276,16 @@ function is_subpage($value = null)
}
}
// 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()
{


+ 1
- 3
themes/blog/layout.html.php View File

@ -6,9 +6,7 @@
<?php echo head_contents();?>
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<?php if($canonical): ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php endif; ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php if (publisher()): ?>
<link href="<?php echo publisher() ?>" rel="publisher" /><?php endif; ?>
<link href="//fonts.googleapis.com/css?family=Lato:300,400,300italic,400italic" rel="stylesheet" type="text/css">


+ 1
- 3
themes/clean/layout.html.php View File

@ -4,9 +4,7 @@
<?php echo head_contents() ?>
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<?php if($canonical): ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php endif; ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link href="<?php echo site_url() ?>themes/clean/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans+Condensed:700&subset=latin,cyrillic-ext" rel="stylesheet"/>
<?php if (publisher()): ?>


+ 1
- 3
themes/default/layout.html.php View File

@ -4,9 +4,7 @@
<?php echo head_contents() ?>
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<?php if($canonical): ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php endif; ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link href="<?php echo site_url() ?>themes/default/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<?php if (publisher()): ?>


+ 1
- 3
themes/logs/layout.html.php View File

@ -4,9 +4,7 @@
<?php echo head_contents() ?>
<title><?php echo $title;?></title>
<meta name="description" content="<?php echo $description; ?>"/>
<?php if($canonical): ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<?php endif; ?>
<link rel="canonical" href="<?php echo $canonical; ?>" />
<link href="<?php echo site_url() ?>themes/logs/css/style.css" rel="stylesheet"/>
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,700" rel="stylesheet" type="text/css">
<?php if (publisher()): ?>


Loading…
Cancel
Save