Missing views var for page/subpage

This commit is contained in:
danpros 2024-01-06 11:32:22 +07:00
commit 6b2922e9a1
2 changed files with 21 additions and 3 deletions

View file

@ -1327,6 +1327,8 @@ function find_draft_page($static = null)
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));
@ -1382,7 +1384,11 @@ 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));
$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));

View file

@ -562,6 +562,8 @@ function get_pages($pages, $page = 1, $perpage = 0)
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));
@ -613,7 +615,11 @@ function get_subpages($sub_pages, $page = 1, $perpage = 0)
// Get the contents and convert it to HTML
$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));
@ -705,6 +711,8 @@ function find_page($static = null)
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));
@ -789,7 +797,11 @@ function find_subpage($static, $sub_static = null)
// Get the contents and convert it to HTML
$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));