Browse Source

modified: system/includes/functions.php - add search in post content

pull/558/head
mieszkou 3 years ago
parent
commit
75ef95d88c
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      system/includes/functions.php

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

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


Loading…
Cancel
Save