Browse Source

Merge pull request #101 from Kanti/master

Added time to Publish date by @Kanti.
pull/107/head
Danang Probo Sayekti 11 years ago
parent
commit
15494c06c0
4 changed files with 15 additions and 3 deletions
  1. +2
    -0
      config/config.ini.example
  2. +1
    -1
      system/admin/admin.php
  3. +1
    -1
      system/admin/views/edit-post.html.php
  4. +11
    -1
      system/htmly.php

+ 2
- 0
config/config.ini.example View File

@ -1,6 +1,8 @@
; The URL of your blog. Include the http or https. ; The URL of your blog. Include the http or https.
site.url = "" site.url = ""
timezone = "Asia/Jakarta"
; Blog info ; Blog info
blog.title = "HTMLy" blog.title = "HTMLy"
blog.tagline = "Just another HTMLy blog" blog.tagline = "Just another HTMLy blog"


+ 1
- 1
system/admin/admin.php View File

@ -47,7 +47,7 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null,
$oldurl = explode('_', $oldfile); $oldurl = explode('_', $oldfile);
if($date !== null) 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; $post_title = $title;


+ 1
- 1
system/admin/views/edit-post.html.php View File

@ -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> 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> 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> <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> Meta Description (optional)<br><textarea name="description" maxlength="200"><?php if (isset($p->description)) { echo $p->description;} ?></textarea>
<br><br> <br><br>
<div id="wmd-button-bar" class="wmd-button-bar"></div> <div id="wmd-button-bar" class="wmd-button-bar"></div>


+ 11
- 1
system/htmly.php View File

@ -14,6 +14,10 @@ include 'system/includes/opml.php';
// Load the configuration file // Load the configuration file
config('source', 'config/config.ini'); config('source', 'config/config.ini');
if(config('timezone'))
{
date_default_timezone_set(config('timezone'));
}
// The front page of the blog. // The front page of the blog.
// This will match the root url // This will match the root url
@ -342,12 +346,18 @@ post('/:year/:month/:name/edit', function() {
$destination = from($_GET, 'destination'); $destination = from($_GET, 'destination');
$description = from($_REQUEST, 'description'); $description = from($_REQUEST, 'description');
$date = from($_REQUEST, 'date'); $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 ($proper && !empty($title) && !empty($tag) && !empty($content)) {
if(empty($url)) { if(empty($url)) {
$url = $title; $url = $title;
} }
edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $date);
edit_post($title, $tag, $url, $content, $oldfile, $destination, $description, $dateTime);
} else { } else {
$message['error'] = ''; $message['error'] = '';
if (empty($title)) { if (empty($title)) {


Loading…
Cancel
Save