Browse Source

changes from @mieszkou (Searching in the content of posts #558)

pull/652/head
sb0001 2 years ago
committed by GitHub
parent
commit
af526e94e8
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      system/includes/functions.php

+ 4
- 4
system/includes/functions.php View File

@ -203,7 +203,7 @@ function rebuilt_cache($type)
foreach ($tmp as $file) {
if(strpos($file, '/draft/') === false && strpos($file, '/scheduled/') === false) {
$posts_cache_unsorted[] = $file;
$posts_cache_sorted[] = pathinfo($file);
$posts_cache_sorted[] = array_merge(pathinfo($file), ['content' => preg_replace('/\s+/', '', (file_get_contents($file)))]);
}
}
}
@ -1051,7 +1051,7 @@ function get_keyword($keyword, $page, $perpage)
foreach ($posts as $index => $v) {
$arr = explode('_', $v['basename']);
$filter = $arr[1] . ' ' . $arr[2];
$filter = $arr[1] . ' ' . $arr[2] . ' ' . $v['content'];
foreach ($words as $word) {
if (stripos($filter, $word) !== false) {
if (!in_array($v, $tmp)) {
@ -1232,7 +1232,7 @@ function keyword_count($keyword)
foreach ($posts as $index => $v) {
$arr = explode('_', $v['basename']);
$filter = $arr[1] . ' ' . $arr[2];
$filter = $arr[1] . ' ' . $arr[2] . ' ' . $v['content'];
foreach ($words as $word) {
if (stripos($filter, $word) !== false) {
$tmp[] = $v;
@ -3353,4 +3353,4 @@ function publish_scheduled()
}
}
}
}
}

Loading…
Cancel
Save