Browse Source

Fixes and Improvements

pull/189/head v2.6.0
Danang Probo Sayekti 10 years ago
parent
commit
0ea29cc905
6 changed files with 43 additions and 33 deletions
  1. +0
    -2
      COPYRIGHT.txt
  2. +1
    -1
      cache/installedVersion.json
  3. +9
    -3
      config/config.ini.example
  4. +2
    -2
      system/admin/views/config.html.php
  5. +11
    -7
      system/admin/views/update.html.php
  6. +20
    -18
      system/includes/dispatch.php

+ 0
- 2
COPYRIGHT.txt View File

@ -33,8 +33,6 @@ license, including:
Pagedown modifications and bugfixes - (c) 2009 Dana Robinson Pagedown modifications and bugfixes - (c) 2009 Dana Robinson
Pagedown modifications and bugfixes - (c) 2009-2013 Stack Exchange Inc. Pagedown modifications and bugfixes - (c) 2009-2013 Stack Exchange Inc.
Lightbox2 - (c) Lokesh Dhakar <lokeshdhakar.com>
jQuery - (c) The jQuery Foundation jQuery - (c) The jQuery Foundation


+ 1
- 1
cache/installedVersion.json View File

@ -1,4 +1,4 @@
{ {
"id": 782014, "id": 782014,
"tag_name": "v2.5.9"
"tag_name": "v2.6.0"
} }

+ 9
- 3
config/config.ini.example View File

@ -13,7 +13,7 @@ blog.copyright = "(c) Your name."
; Set permalink type. "default" using /year/month/title. "post" using /post/title ; Set permalink type. "default" using /year/month/title. "post" using /post/title
permalink.type = "default" permalink.type = "default"
; Show the /blog url as the blog homepage
; Show the /blog url as the blog homepage. Options "false" and "true"
blog.enable = "false" blog.enable = "false"
; Social account ; Social account
@ -51,7 +51,7 @@ google.publisher = ""
google.analytics.id = "" google.analytics.id = ""
; Google reCaptcha ; Google reCaptcha
; https://www.google.com/recaptcha/admin
; https://www.google.com/recaptcha/admin. Options "false" and "true"
google.reCaptcha = false google.reCaptcha = false
google.reCaptcha.public = "" google.reCaptcha.public = ""
@ -102,9 +102,15 @@ views.counter = "true"
; Also install pre-release ; Also install pre-release
prerelease = false prerelease = false
; Switch on and off the file cache for development purposes.
; Switch on and off the file cache for development purposes. Options "false" and "true"
cache.off = false cache.off = false
; Switch on and off the page generation time. Options "false" and "true"
generation.time = false
; Switch on and off the cache timestamp. Options "false" and "true"
cache.timestamp = false
; Set the theme here ; Set the theme here
views.root = "themes/blog" views.root = "themes/blog"


+ 2
- 2
system/admin/views/config.html.php View File

@ -12,9 +12,9 @@
</tr> </tr>
<?php <?php
global $config_file; global $config_file;
$array = [
$array = array(
"google.wmt" => "hallo", "google.wmt" => "hallo",
];
);
if (file_exists($config_file)) { if (file_exists($config_file)) {
$array = parse_ini_file($config_file, true); $array = parse_ini_file($config_file, true);
} }


+ 11
- 7
system/admin/views/update.html.php View File

@ -12,18 +12,22 @@ $updater = new HubUpdater(array(
if ($updater->able()) { if ($updater->able()) {
$info = $updater->getNewestInfo(); $info = $updater->getNewestInfo();
echo '<h2>Update Available</h2>'; echo '<h2>Update Available</h2>';
echo '<h3>'. $info['name'] .'</h3>';
echo '<p>Version: '. $info['tag_name'] .'</p>';
echo '<p>Release Title: <strong>'. $info['name'] .'</strong></p>';
echo '<p>Version: <strong>'. $info['tag_name'] .'</strong></p>';
echo '<h4>Release Notes</h4>'; echo '<h4>Release Notes</h4>';
echo '<pre><code>'. $info['body'] .'</code></pre>';
echo '<div style="background-color:#f9f9f9;border:1px solid #ccc;border-radius:4px;color:#333;display:block;font-size:13px;line-height:1.42857;margin:20px 0;padding:0 1em;word-break:break-all;word-wrap:break-word;">';
echo \Michelf\MarkdownExtra::defaultTransform($info['body']);
echo '</div>';
echo '<p><strong>Important:</strong> Please always backup your files before upgrading to newer version.</p>'; echo '<p><strong>Important:</strong> Please always backup your files before upgrading to newer version.</p>';
echo '<p><a href="' . site_url() . 'admin/update/now/' . $CSRF . '" alt="' . $info['name'] . '">Update to ' . $info['tag_name'] . ' now</a></p>'; echo '<p><a href="' . site_url() . 'admin/update/now/' . $CSRF . '" alt="' . $info['name'] . '">Update to ' . $info['tag_name'] . ' now</a></p>';
} else { } else {
echo '<h2>Congrats! You have the latest version of HTMLy</h2>'; echo '<h2>Congrats! You have the latest version of HTMLy</h2>';
$info = $updater->getCurrentInfo(); $info = $updater->getCurrentInfo();
echo '<p>Release Title: '. $info['name'] .'</p>';
echo '<p>Installed Version: '. $info['tag_name'] .'</p>';
echo '<p>Release Notes: </p>';
echo '<pre><code>'. $info['body'] .'</code></pre>';
echo '<p>Release Title: <strong>'. $info['name'] .'</strong></p>';
echo '<p>Installed Version: <strong>'. $info['tag_name'] .'</strong></p>';
echo '<h4>Release Notes: </h4>';
echo '<div style="background-color:#f9f9f9;border:1px solid #ccc;border-radius:4px;color:#333;display:block;font-size:13px;line-height:1.42857;margin:20px 0;padding:0 1em;word-break:break-all;word-wrap:break-word;">';
echo \Michelf\MarkdownExtra::defaultTransform($info['body']);
echo '</div>';
echo '<p>Read on <a target="_blank" href="' . $info['html_url'] . '">Github</a>.</p>'; echo '<p>Read on <a target="_blank" href="' . $info['html_url'] . '">Github</a>.</p>';
} }

+ 20
- 18
system/includes/dispatch.php View File

@ -327,35 +327,37 @@ function render($view, $locals = null, $layout = null)
content(trim(ob_get_clean())); content(trim(ob_get_clean()));
if ($layout !== false) { if ($layout !== false) {
if ($layout == null) { if ($layout == null) {
$layout = config('views.layout'); $layout = config('views.layout');
$layout = ($layout == null) ? 'layout' : $layout; $layout = ($layout == null) ? 'layout' : $layout;
} }
$layout = "{$view_root}/{$layout}.html.php"; $layout = "{$view_root}/{$layout}.html.php";
header('Content-type: text/html; charset=utf-8'); header('Content-type: text/html; charset=utf-8');
ob_start();
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
require $layout;
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo "\n" . '<!-- Dynamic page generated in '.$total_time.' seconds. -->';
if (config('generation.time') == 'true') {
ob_start();
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
require $layout;
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round(($finish - $start), 4);
echo "\n" . '<!-- Dynamic page generated in '.$total_time.' seconds. -->';
} else {
ob_start();
require $layout;
}
if (!$login) { if (!$login) {
if (!file_exists($cachefile)) { if (!file_exists($cachefile)) {
echo "\n" . '<!-- Cached page generated on '.date('Y-m-d H:i:s').' -->';
if (config('cache.timestamp') == 'true') {
echo "\n" . '<!-- Cached page generated on '.date('Y-m-d H:i:s').' -->';
}
file_put_contents($cachefile, ob_get_contents()); file_put_contents($cachefile, ob_get_contents());
} }
} }
echo trim(ob_get_clean()); echo trim(ob_get_clean());
} else { } else {
echo content(); echo content();


Loading…
Cancel
Save