From 13a0696edaf69dd5a1eb7b941ee6f3428b142647 Mon Sep 17 00:00:00 2001 From: Danang Probo Sayekti Date: Tue, 21 Jan 2014 22:34:36 +0700 Subject: [PATCH] Add welcome message Add welcome message if no published post instead 404 error. --- system/htmly.php | 3 ++- system/includes/functions.php | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/system/htmly.php b/system/htmly.php index d986492..d819346 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -26,7 +26,8 @@ get('/index', function () { if(empty($posts) || $page < 1){ // a non-existing page - not_found(); + welcome_page(); + die; } $tl = config('blog.tagline'); diff --git a/system/includes/functions.php b/system/includes/functions.php index cfc2cf8..5582736 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -1076,4 +1076,16 @@ function generate_opml(){ // Turn an array of posts into a JSON function generate_json($posts){ return json_encode($posts); +} + +function welcome_page() { + echo << +

Welcome to your new HTMLy-powered blog.

+

The next thing you will need to do is creating the first account. Please create YourUsername.ini inside admin/users folder and write down your password there:

+
password = YourPassword
+

Login to your blog admin panel at www.example.com/admin to creating your first post.

+

This welcome message will disappear after your first post published.

+ +EOF; } \ No newline at end of file