mirror of
https://github.com/danpros/htmly.git
synced 2026-04-19 03:56:21 +05:30
Fixes and Improvements
This commit is contained in:
parent
ffb46f9981
commit
0ea29cc905
6 changed files with 43 additions and 33 deletions
|
|
@ -34,8 +34,6 @@ license, including:
|
|||
|
||||
Pagedown modifications and bugfixes - (c) 2009-2013 Stack Exchange Inc.
|
||||
|
||||
Lightbox2 - (c) Lokesh Dhakar <lokeshdhakar.com>
|
||||
|
||||
jQuery - (c) The jQuery Foundation
|
||||
|
||||
jQuery UI - (c) The jQuery Foundation
|
||||
|
|
|
|||
2
cache/installedVersion.json
vendored
2
cache/installedVersion.json
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"id": 782014,
|
||||
"tag_name": "v2.5.9"
|
||||
"tag_name": "v2.6.0"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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 = ""
|
||||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,18 +12,22 @@ $updater = new HubUpdater(array(
|
|||
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>';
|
||||
}
|
||||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue