Browse Source

Revert ""404" and "404-search" rendered within layout!"

This reverts commit 9fa8fab864.
pull/195/head
Andreas 10 years ago
parent
commit
d566436d1d
17 changed files with 168 additions and 133 deletions
  1. +1
    -3
      system/admin/views/layout.html.php
  2. +5
    -11
      system/htmly.php
  3. +8
    -8
      system/includes/functions.php
  4. +20
    -15
      themes/blog/404-search.html.php
  5. +18
    -14
      themes/blog/404.html.php
  6. +1
    -3
      themes/blog/layout.html.php
  7. +19
    -10
      themes/clean/404-search.html.php
  8. +18
    -10
      themes/clean/404.html.php
  9. +1
    -3
      themes/clean/layout.html.php
  10. +19
    -10
      themes/default/404-search.html.php
  11. +18
    -10
      themes/default/404.html.php
  12. +1
    -6
      themes/default/css/style.css
  13. +1
    -3
      themes/default/layout.html.php
  14. +19
    -10
      themes/logs/404-search.html.php
  15. +18
    -10
      themes/logs/404.html.php
  16. +0
    -4
      themes/logs/css/style.css
  17. +1
    -3
      themes/logs/layout.html.php

+ 1
- 3
system/admin/views/layout.html.php View File

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


+ 5
- 11
system/htmly.php View File

@ -1301,20 +1301,14 @@ get('/search/:keyword', function ($keyword) {
$posts = get_keyword($keyword, $page, $perpage); $posts = get_keyword($keyword, $page, $perpage);
if (!$posts || $page < 1) {
// a non-existing page or no search result
render('404-search', array(
'title' => 'Search results not found! - ' . blog_title(),
'description' => '',
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; No search results',
'canonical' => site_url() . 'search/' . strtolower($keyword),
'bodyclass' => 'error-404-search',
));
$total = keyword_count($keyword);
if (empty($posts) || $page < 1) {
// a non-existing page
render('404-search', null, false);
die; die;
} }
$total = keyword_count($keyword);
render('main', array( render('main', array(
'title' => 'Search results for: ' . tag_i18n($keyword) . ' - ' . blog_title(), 'title' => 'Search results for: ' . tag_i18n($keyword) . ' - ' . blog_title(),
'description' => 'Search results for: ' . tag_i18n($keyword) . ' on ' . blog_title() . '.', 'description' => 'Search results for: ' . tag_i18n($keyword) . ' on ' . blog_title() . '.',


+ 8
- 8
system/includes/functions.php View File

@ -654,7 +654,13 @@ function get_keyword($keyword, $page, $perpage)
} }
} }
return ($tmp) ? get_posts($tmp, $page, $perpage) : [];
if (empty($tmp)) {
// a non-existing page
render('404-search', null, false);
die;
}
return $tmp = get_posts($tmp, $page, $perpage);
} }
// Get related posts base on post tag. // Get related posts base on post tag.
@ -1537,13 +1543,7 @@ EOF;
function not_found() function not_found()
{ {
header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
render('404', array(
'title' => 'This page doesn\'t exist! - ' . blog_title(),
'description' => '',
'canonical' => false,
'breadcrumb' => '<a href="' . site_url() . '">' . config('breadcrumb.home') . '</a> &#187; 404 Not Found',
'bodyclass' => 'error-404',
));
render('404', null, false);
die(); die();
} }


+ 20
- 15
themes/blog/404-search.html.php View File

@ -1,16 +1,21 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<section class="inpage post section">
<div class="section-inner">
<div class="content">
<div class="item">
<h1 class="title">Search results not found!</h1>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
<div class="search-404">
<?php echo search() ?>
</div>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>Search results not found! - <?php echo blog_title() ?></title>
<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">
</head>
<body>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search-404">
<?php echo search() ?>
</div> </div>
</section>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 18
- 14
themes/blog/404.html.php View File

@ -1,14 +1,18 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<section class="inpage post section">
<div class="section-inner">
<div class="content">
<div class="item">
<h1 class="title">This page doesn't exist!</h1>
<p>Please search to find what you're looking for or visit our <a href="<?php echo site_url() ?>">homepage</a> instead.</p>
<?php echo search() ?>
</div>
</div>
</div>
</section>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<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">
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

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

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


+ 19
- 10
themes/clean/404-search.html.php View File

@ -1,12 +1,21 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<div class="post">
<div class="main">
<h1 class="title-post">Search results not found!</h1>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
<div class="search-404">
<?php echo search() ?>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>Search results not found! - <?php echo blog_title() ?></title>
<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"/>
</head>
<body>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search">
<?php echo search() ?>
</div> </div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div> </div>
</body>
</html>

+ 18
- 10
themes/clean/404.html.php View File

@ -1,10 +1,18 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<div class="post">
<div class="main">
<h1 class="title-post">This page doesn't exist!</h1>
<p>Please search to find what you're looking for or visit our <a href="<?php echo site_url() ?>">homepage</a> instead.</p>
<?php echo search() ?>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<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"/>
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

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

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


+ 19
- 10
themes/default/404-search.html.php View File

@ -1,12 +1,21 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<div class="post">
<div class="main">
<h1 class="title-post">Search results not found!</h1>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
<div class="search-404">
<?php echo search() ?>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>Search results not found! - <?php echo blog_title() ?></title>
<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">
</head>
<body>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search-404">
<?php echo search() ?>
</div> </div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div> </div>
</body>
</html>

+ 18
- 10
themes/default/404.html.php View File

@ -1,10 +1,18 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<div class="post">
<div class="main">
<h1 class="title-post">This page doesn't exist!</h1>
<p>Please search to find what you're looking for or visit our <a href="<?php echo site_url() ?>">homepage</a> instead.</p>
<?php echo search() ?>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<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">
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 1
- 6
themes/default/css/style.css View File

@ -414,11 +414,6 @@ table.post-list td a {
float: right; float: right;
} }
.error-404 .post #search-form,
.error-404-search .post #search-form {
float: none;
}
.search-input { .search-input {
margin: 0; margin: 0;
padding: 4px 15px; padding: 4px 15px;
@ -524,7 +519,7 @@ h1.title-post a:hover, h2.title-index a:hover {
padding-top: 0; padding-top: 0;
} }
.infront .first, .inpost .post, .intag .first, .inarchive .first, .insearch .first, .error-404 .post, .error-404-search .post {
.infront .first, .inpost .post, .intag .first, .inarchive .first, .insearch .first {
padding-top: 0; padding-top: 0;
} }


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

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


+ 19
- 10
themes/logs/404-search.html.php View File

@ -1,12 +1,21 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<div class="post">
<div class="main">
<h1 class="title-post">Search results not found!</h1>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
<div class="search-404">
<?php echo search() ?>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>Search results not found! - <?php echo blog_title() ?></title>
<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">
</head>
<body>
<div class="center message">
<h1>Search results not found!</h1>
<div class="search-404">
<?php echo search() ?>
</div> </div>
<p>Please search again, or would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div> </div>
</body>
</html>

+ 18
- 10
themes/logs/404.html.php View File

@ -1,10 +1,18 @@
<?php if (!empty($breadcrumb)): ?>
<div class="breadcrumb"><?php echo $breadcrumb ?></div>
<?php endif; ?>
<div class="post">
<div class="main">
<h1 class="title-post">This page doesn't exist!</h1>
<p>Please search to find what you're looking for or visit our <a href="<?php echo site_url() ?>">homepage</a> instead.</p>
<?php echo search() ?>
</div>
</div>
<!DOCTYPE html>
<html>
<head>
<link href='<?php echo site_url() ?>favicon.ico' rel='icon' type='image/x-icon'/>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" user-scalable="no"/>
<title>404 Not Found - <?php echo blog_title() ?></title>
<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">
</head>
<body>
<div class="center message">
<h1>This page doesn't exist!</h1>
<p>Would you like to try our <a href="<?php echo site_url() ?>">homepage</a> instead?</p>
</div>
</body>
</html>

+ 0
- 4
themes/logs/css/style.css View File

@ -332,10 +332,6 @@ ul li, ol li {
#search-form { #search-form {
float: right; float: right;
} }
.error-404 .post #search-form,
.error-404-search .post #search-form {
float: none;
}
.search-input { .search-input {
border: 1px solid #E5E5E5; border: 1px solid #E5E5E5;


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

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


Loading…
Cancel
Save