diff --git a/config/config.ini.example b/config/config.ini.example index 824739a5..a296c1c8 100644 --- a/config/config.ini.example +++ b/config/config.ini.example @@ -1,6 +1,8 @@ ; The URL of your blog. Include the http or https. site.url = "" +timezone = "Asia/Jakarta" + ; Blog info blog.title = "HTMLy" blog.tagline = "Just another HTMLy blog" diff --git a/system/admin/admin.php b/system/admin/admin.php index fe5a8cf7..e3e52acb 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -47,7 +47,7 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $oldurl = explode('_', $oldfile); if($date !== null) { - $oldurl[0] = substr($oldurl[0],0,-19) . date('Y-m-d-h-m-s',strtotime($date)); + $oldurl[0] = substr($oldurl[0],0,-19) . date('Y-m-d-h-i-s',strtotime($date)); } $post_title = $title; diff --git a/system/admin/views/edit-post.html.php b/system/admin/views/edit-post.html.php index 9a126044..da9b0868 100644 --- a/system/admin/views/edit-post.html.php +++ b/system/admin/views/edit-post.html.php @@ -49,7 +49,7 @@ Tag *


Url (optional)

If the url leave empty we will use the post title.

- Date


+ Date Time



Meta Description (optional)


diff --git a/system/htmly.php b/system/htmly.php index 3cc6991b..5ba5c15a 100644 --- a/system/htmly.php +++ b/system/htmly.php @@ -14,6 +14,10 @@ // Load the configuration file config('source', 'config/config.ini'); +if(config('timezone')) +{ + date_default_timezone_set(config('timezone')); +} // The front page of the blog. // This will match the root url @@ -342,12 +346,18 @@ $destination = from($_GET, 'destination'); $description = from($_REQUEST, 'description'); $date = from($_REQUEST, 'date'); + $time = from($_REQUEST, 'time'); + $dateTime = null; + if($date !== null && $time !== null) + { + $dateTime = $date . ' ' . $time; + } if ($proper && !empty($title) && !empty($tag) && !empty($content)) { if(empty($url)) { $url = $title; } - edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $date); + edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime); } else { $message['error'] = ''; if (empty($title)) {