Browse Source

Add welcome message

Add welcome message if no published post instead 404 error.
pull/31/merge
Danang Probo Sayekti 12 years ago
parent
commit
13a0696eda
2 changed files with 14 additions and 1 deletions
  1. +2
    -1
      system/htmly.php
  2. +12
    -0
      system/includes/functions.php

+ 2
- 1
system/htmly.php View File

@ -26,7 +26,8 @@ get('/index', function () {
if(empty($posts) || $page < 1){ if(empty($posts) || $page < 1){
// a non-existing page // a non-existing page
not_found();
welcome_page();
die;
} }
$tl = config('blog.tagline'); $tl = config('blog.tagline');


+ 12
- 0
system/includes/functions.php View File

@ -1076,4 +1076,16 @@ function generate_opml(){
// Turn an array of posts into a JSON // Turn an array of posts into a JSON
function generate_json($posts){ function generate_json($posts){
return json_encode($posts); return json_encode($posts);
}
function welcome_page() {
echo <<<EOF
<div style="font-size:20px;text-align:center;padding:50px 20px;">
<h1>Welcome to your new HTMLy-powered blog.</h1>
<p>The next thing you will need to do is creating the first account. Please create <strong><em>YourUsername.ini</em></strong> inside <strong><em>admin/users</em></strong> folder and write down your password there:</p>
<pre><code>password = YourPassword</code></pre>
<p>Login to your blog admin panel at <strong><em>www.example.com/admin</em></strong> to creating your first post.</p>
<p>This welcome message will disappear after your first post published.</p>
</div>
EOF;
} }

Loading…
Cancel
Save