Browse Source

Missing views var for page/subpage

pull/674/head
danpros 1 year ago
parent
commit
6b2922e9a1
2 changed files with 21 additions and 3 deletions
  1. +7
    -1
      system/admin/admin.php
  2. +14
    -2
      system/includes/functions.php

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

@ -1327,6 +1327,8 @@ function find_draft_page($static = null)
if (config('views.counter') == 'true') { if (config('views.counter') == 'true') {
$post->views = get_views($post->file); $post->views = get_views($post->file);
} else {
$post->views = null;
} }
$post->description = get_content_tag("d", $content, get_description($post->body)); $post->description = get_content_tag("d", $content, get_description($post->body));
@ -1382,7 +1384,11 @@ function find_draft_subpage($static = null, $sub_static = null)
// Get the contents and convert it to HTML // Get the contents and convert it to HTML
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
$post->views = get_views($post->file);
if (config('views.counter') == 'true') {
$post->views = get_views($post->file);
} else {
$post->views = null;
}
$post->description = get_content_tag("d", $content, get_description($post->body)); $post->description = get_content_tag("d", $content, get_description($post->body));


+ 14
- 2
system/includes/functions.php View File

@ -562,6 +562,8 @@ function get_pages($pages, $page = 1, $perpage = 0)
if (config('views.counter') == 'true') { if (config('views.counter') == 'true') {
$post->views = get_views($post->file); $post->views = get_views($post->file);
} else {
$post->views = null;
} }
$post->description = get_content_tag("d", $content, get_description($post->body)); $post->description = get_content_tag("d", $content, get_description($post->body));
@ -613,7 +615,11 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0)
// Get the contents and convert it to HTML // Get the contents and convert it to HTML
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
$post->views = get_views($post->file);
if (config('views.counter') == 'true') {
$post->views = get_views($post->file);
} else {
$post->views = null;
}
$post->description = get_content_tag("d", $content, get_description($post->body)); $post->description = get_content_tag("d", $content, get_description($post->body));
@ -705,6 +711,8 @@ function find_page($static = null)
if (config('views.counter') == 'true') { if (config('views.counter') == 'true') {
$post->views = get_views($post->file); $post->views = get_views($post->file);
} else {
$post->views = null;
} }
$post->description = get_content_tag("d", $content, get_description($post->body)); $post->description = get_content_tag("d", $content, get_description($post->body));
@ -789,7 +797,11 @@ function find_subpage($static, $sub_static = null)
// Get the contents and convert it to HTML // Get the contents and convert it to HTML
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content)); $post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
$post->views = get_views($post->file);
if (config('views.counter') == 'true') {
$post->views = get_views($post->file);
} else {
$post->views = null;
}
$post->description = get_content_tag("d", $content, get_description($post->body)); $post->description = get_content_tag("d", $content, get_description($post->body));


Loading…
Cancel
Save