diff --git a/system/admin/admin.php b/system/admin/admin.php index 4ab4347..2543fed 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -1010,7 +1010,9 @@ function find_draft_page($static = null) $tmp = array(); - if (config('views.counter') == 'true') { + $counter = config('views.counter'); + + if ($counter == 'true') { $viewsFile = "content/data/views.json"; if (file_exists($viewsFile)) { $views = json_decode(file_get_contents($viewsFile), true); @@ -1052,7 +1054,7 @@ function find_draft_page($static = null) // Get the contents and convert it to HTML $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); - if (config('views.counter') == 'true') { + if ($counter == 'true') { $post->views = get_views('page_' . $post->slug, $post->file, $views); } else { $post->views = null; @@ -1078,7 +1080,9 @@ function find_draft_subpage($static = null, $sub_static = null) $tmp = array(); - if (config('views.counter') == 'true') { + $counter = config('views.counter'); + + if ($counter == 'true') { $viewsFile = "content/data/views.json"; if (file_exists($viewsFile)) { $views = json_decode(file_get_contents($viewsFile), true); @@ -1129,7 +1133,7 @@ function find_draft_subpage($static = null, $sub_static = null) // Get the contents and convert it to HTML $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); - if (config('views.counter') == 'true') { + if ($counter == 'true') { $post->views = get_views('subpage_' . $post->parentSlug .'.'. $post->slug, $post->file, $views); } else { $post->views = null; diff --git a/system/includes/functions.php b/system/includes/functions.php index 25dc827..edaefbd 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -394,8 +394,13 @@ function get_posts($posts, $page = 1, $perpage = 0) $posts = array_slice($posts, ($page - 1) * $perpage, $perpage); $cList = category_list(true); - - if (config('views.counter') == 'true') { + + $auto = config('toc.automatic'); + $counter = config('views.counter'); + $caption = config('fig.captions'); + $permalink = config('permalink.type'); + + if ($counter == 'true') { $viewsFile = "content/data/views.json"; if (file_exists($viewsFile)) { $views = json_decode(file_get_contents($viewsFile), true); @@ -459,7 +464,7 @@ function get_posts($posts, $page = 1, $perpage = 0) // The archive per day $post->archive = site_url() . 'archive/' . date('Y-m', $post->date); - if (config('permalink.type') == 'post') { + if ($permalink == 'post') { $post->url = site_url() . 'post/' . str_replace('.md', '', $arr[2]); } else { $post->url = site_url() . date('Y/m', $post->date) . '/' . str_replace('.md', '', $arr[2]); @@ -535,18 +540,17 @@ function get_posts($posts, $page = 1, $perpage = 0) if (isset($toc['1'])) { $post->body = insert_toc('post-' . $post->date, $toc['0'], $toc['1']); } else { - $auto = config('toc.automatic'); if ($auto === 'true') { $post->body = automatic_toc($post->body, 'post-' . $post->date); } } // Convert image tags to figures - if (config('fig.captions') == 'true') { + if ($caption == 'true') { $post->body = preg_replace( '/

()<\/p>/', '

$1
$2
', $post->body ); } - if (config('views.counter') == 'true') { + if ($counter == 'true') { $post->views = get_views('post_' . $post->slug, $post->file, $views); } else { $post->views = null; @@ -565,8 +569,11 @@ function get_pages($pages, $page = 1, $perpage = 0) } $tmp = array(); + + $auto = config('toc.automatic'); + $counter = config('views.counter'); - if (config('views.counter') == 'true') { + if ($counter == 'true') { $viewsFile = "content/data/views.json"; if (file_exists($viewsFile)) { $views = json_decode(file_get_contents($viewsFile), true); @@ -616,13 +623,12 @@ function get_pages($pages, $page = 1, $perpage = 0) if (isset($toc['1'])) { $post->body = insert_toc('page-' . $post->slug, $toc['0'], $toc['1']); } else { - $auto = config('toc.automatic'); if ($auto === 'true') { $post->body = automatic_toc($post->body, 'page-' . $post->slug); } } - if (config('views.counter') == 'true') { + if ($counter == 'true') { $post->views = get_views('page_' . $post->slug, $post->file, $views); } else { $post->views = null; @@ -642,8 +648,11 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0) } $tmp = array(); + + $auto = config('toc.automatic'); + $counter = config('views.counter'); - if (config('views.counter') == 'true') { + if ($counter == 'true') { $viewsFile = "content/data/views.json"; if (file_exists($viewsFile)) { $views = json_decode(file_get_contents($viewsFile), true); @@ -703,13 +712,12 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0) if (isset($toc['1'])) { $post->body = insert_toc('subpage-' . $post->slug, $toc['0'], $toc['1']); } else { - $auto = config('toc.automatic'); if ($auto === 'true') { $post->body = automatic_toc($post->body, 'subpage-' . $post->slug); } } - if (config('views.counter') == 'true') { + if ($counter == 'true') { $post->views = get_views('subpage_' . $post->parentSlug .'.'. $post->slug, $post->file, $views); } else { $post->views = null; @@ -2210,6 +2218,7 @@ function get_teaser($string, $url = null, $char = null) { $teaserType = config('teaser.type'); $more = config('read.more'); + $behave = config('teaser.behave'); if(empty($more)) { $more = 'Read more'; @@ -2231,7 +2240,7 @@ function get_teaser($string, $url = null, $char = null) return $string; } } else { - if (config('teaser.behave') === 'check') { + if ($behave === 'check') { $readMore = explode('', $string); if (isset($readMore['1'])) { $string = shorten($readMore[0]); @@ -2387,35 +2396,35 @@ function social($class = null) $social .= ' +
@@ -61,11 +62,12 @@

- body, $p->url) ?> + body, $p->url);?> + [...]
- - + +
+
@@ -52,7 +53,7 @@
body) ?> body, $p->url) ?> - + [...]
diff --git a/themes/clean/post.html.php b/themes/clean/post.html.php index 8e30afa..ce52637 100644 --- a/themes/clean/post.html.php +++ b/themes/clean/post.html.php @@ -70,10 +70,10 @@
- + - +
diff --git a/themes/clean/profile.html.php b/themes/clean/profile.html.php index 489ff3f..6e2c1e6 100644 --- a/themes/clean/profile.html.php +++ b/themes/clean/profile.html.php @@ -21,11 +21,11 @@
- + - +
diff --git a/themes/clean/static.html.php b/themes/clean/static.html.php index 3f7b680..b126b6f 100644 --- a/themes/clean/static.html.php +++ b/themes/clean/static.html.php @@ -13,10 +13,10 @@
- + - +
\ No newline at end of file diff --git a/themes/doks/css/style.css b/themes/doks/css/style.css index b2b7d8e..883cc9d 100644 --- a/themes/doks/css/style.css +++ b/themes/doks/css/style.css @@ -2797,7 +2797,7 @@ pre code::-webkit-scrollbar-thumb:hover { padding:0.4375rem 0 } #mode { - margin-right:1.25rem + margin-right:0.5rem } .btn-link:focus { outline:0; diff --git a/themes/doks/main.html.php b/themes/doks/main.html.php index a6442d0..329c038 100644 --- a/themes/doks/main.html.php +++ b/themes/doks/main.html.php @@ -61,7 +61,7 @@ - + body);?>
@@ -101,7 +101,7 @@
body, $post->url); ?> - + [...]

diff --git a/themes/doks/profile.html.php b/themes/doks/profile.html.php index d6ddf28..54bddf3 100644 --- a/themes/doks/profile.html.php +++ b/themes/doks/profile.html.php @@ -7,7 +7,7 @@

about;?>
- + body);?> @@ -17,7 +17,7 @@ image)) {?> <?php echo $post->title;?> - + <?php echo $post->title;?> @@ -48,7 +48,7 @@
body, $post->url); ?> - + [...]

diff --git a/themes/logs/main.html.php b/themes/logs/main.html.php index 26ee850..c610320 100644 --- a/themes/logs/main.html.php +++ b/themes/logs/main.html.php @@ -10,6 +10,7 @@ +

@@ -50,9 +51,8 @@
- body) ?> body, $p->url) ?> - + [...]
diff --git a/themes/readable/main.html.php b/themes/readable/main.html.php index d11539f..e2fc855 100644 --- a/themes/readable/main.html.php +++ b/themes/readable/main.html.php @@ -10,6 +10,7 @@ +
@@ -50,9 +51,8 @@
- body) ?> body, $p->url) ?> - + [...]
diff --git a/themes/twentyfifteen/main.html.php b/themes/twentyfifteen/main.html.php index 3249b6e..29652b3 100644 --- a/themes/twentyfifteen/main.html.php +++ b/themes/twentyfifteen/main.html.php @@ -30,6 +30,7 @@

Type: title);?>

+
image)):?> @@ -63,7 +64,7 @@
body, $p->url); ?> - + [...]