From af526e94e87297b6efffaa8d6d0d35332247ff91 Mon Sep 17 00:00:00 2001 From: sb0001 <48289594+sb0001@users.noreply.github.com> Date: Fri, 8 Dec 2023 22:50:25 +0100 Subject: [PATCH] changes from @mieszkou (Searching in the content of posts #558) --- system/includes/functions.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 4b47b95..26e7756 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -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() } } } -} \ No newline at end of file +}