Skip to content

Commit

Permalink
Fixes and Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
danpros committed Aug 17, 2015
1 parent ffb46f9 commit 0ea29cc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 33 deletions.
2 changes: 0 additions & 2 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ license, including:
Pagedown modifications and bugfixes - (c) 2009 Dana Robinson

Pagedown modifications and bugfixes - (c) 2009-2013 Stack Exchange Inc.

Lightbox2 - (c) Lokesh Dhakar <lokeshdhakar.com>

jQuery - (c) The jQuery Foundation

Expand Down
2 changes: 1 addition & 1 deletion cache/installedVersion.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"id": 782014,
"tag_name": "v2.5.9"
"tag_name": "v2.6.0"
}
12 changes: 9 additions & 3 deletions config/config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ blog.copyright = "(c) Your name."
; Set permalink type. "default" using /year/month/title. "post" using /post/title
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"

; Social account
Expand Down Expand Up @@ -51,7 +51,7 @@ google.publisher = ""
google.analytics.id = ""

; Google reCaptcha
; https://www.google.com/recaptcha/admin
; https://www.google.com/recaptcha/admin. Options "false" and "true"

google.reCaptcha = false
google.reCaptcha.public = ""
Expand Down Expand Up @@ -102,9 +102,15 @@ views.counter = "true"
; Also install pre-release
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

; 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
views.root = "themes/blog"

Expand Down
4 changes: 2 additions & 2 deletions system/admin/views/config.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</tr>
<?php
global $config_file;
$array = [
$array = array(
"google.wmt" => "hallo",
];
);
if (file_exists($config_file)) {
$array = parse_ini_file($config_file, true);
}
Expand Down
18 changes: 11 additions & 7 deletions system/admin/views/update.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,22 @@
if ($updater->able()) {
$info = $updater->getNewestInfo();
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 '<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><a href="' . site_url() . 'admin/update/now/' . $CSRF . '" alt="' . $info['name'] . '">Update to ' . $info['tag_name'] . ' now</a></p>';
} else {
echo '<h2>Congrats! You have the latest version of HTMLy</h2>';
$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>';
}
38 changes: 20 additions & 18 deletions system/includes/dispatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,35 +327,37 @@ function render($view, $locals = null, $layout = null)
content(trim(ob_get_clean()));

if ($layout !== false) {

if ($layout == null) {
$layout = config('views.layout');
$layout = ($layout == null) ? 'layout' : $layout;
}

$layout = "{$view_root}/{$layout}.html.php";

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 (!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());
}
}

echo trim(ob_get_clean());
} else {
echo content();
Expand Down

0 comments on commit 0ea29cc

Please sign in to comment.