Skip to content

Commit

Permalink
changes from @mieszkou (Searching in the content of posts danpros#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
sb0001 authored Dec 8, 2023
1 parent cb9f7ad commit af526e9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system/includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)))]);
}
}
}
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -3353,4 +3353,4 @@ function publish_scheduled()
}
}
}
}
}

0 comments on commit af526e9

Please sign in to comment.