From a504035b8861c0870607c73746d811728e53a42c Mon Sep 17 00:00:00 2001 From: Danang Probo Sayekti Date: Tue, 11 Feb 2014 13:26:31 +0700 Subject: [PATCH] Limiting search Sarching the contents also is bad idea since its databaseless. Search only tags and the url. --- system/includes/functions.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/system/includes/functions.php b/system/includes/functions.php index 7f1f535..69c43b1 100644 --- a/system/includes/functions.php +++ b/system/includes/functions.php @@ -429,11 +429,8 @@ function get_keyword($keyword){ if(!empty($posts)) { foreach($posts as $index => $v){ - - $content = MarkdownExtra::defaultTransform(file_get_contents($v)); - foreach ($words as $word) { - if(strpos(strtolower(strip_tags($content)), strtolower($word)) !== false){ + if(strpos($v, strtolower($word)) !== false){ $post = new stdClass; @@ -479,6 +476,8 @@ function get_keyword($keyword){ $post->tag = implode(', ', $url); $post->tagb = implode(' ยป ', $bc); + + $content = MarkdownExtra::defaultTransform(file_get_contents($v)); // Extract the title and body $arr = explode('t-->', $content);