mirror of
https://github.com/danpros/htmly.git
synced 2026-04-21 04:56:23 +05:30
Added time to Publish date
This commit is contained in:
parent
dfd471ffaa
commit
e6c8c3f2c7
4 changed files with 15 additions and 3 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
Tag <span class="required">*</span> <br><input type="text" name="tag" class="text <?php if (isset($postTag)) { if (empty($postTag)) { echo 'error';}} ?>" value="<?php echo $oldtag?>"/><br><br>
|
||||
Url (optional)<br><input type="text" name="url" class="text" value="<?php echo $oldmd ?>"/><br>
|
||||
<span class="help">If the url leave empty we will use the post title.</span><br><br>
|
||||
Date<br><input type="date" name="date" class="text" value="<?php echo $timestamp; ?>"><br><br>
|
||||
Date Time<br><input type="date" name="date" class="text" value="<?php echo $timestamp; ?>"><br><input type="time" name="time" class="text" value="<?php echo $time->format('H:i'); ?>"><br><br>
|
||||
Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
|
||||
<br><br>
|
||||
<div id="wmd-button-bar" class="wmd-button-bar"></div>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,10 @@ include 'system/includes/opml.php';
|
|||
|
||||
// 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 @@ post('/:year/:month/:name/edit', function() {
|
|||
$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)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue