forked from Typesetter/Simple-Blog
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathSearch.php
More file actions
executable file
·32 lines (21 loc) · 730 Bytes
/
Search.php
File metadata and controls
executable file
·32 lines (21 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
defined('is_running') or die('Not an entry point...');
gpPlugin_incl('SimpleBlogCommon.php');
class BlogSearch extends SimpleBlogCommon{
function __construct($args){
SimpleBlogCommon::Init();
$search_obj = $args[0];
$blog_label = common::GetLabelIndex('special_blog');
$post_ids = SimpleBlogCommon::AStrToArray('str_index');
foreach($post_ids as $id){
$post = SimpleBlogCommon::GetPostContent($id);
if( !$post ){
continue;
}
$title = $blog_label.': '.str_replace('_',' ',$post['title']);
$content = str_replace('_',' ',$post['title']).' '.$post['content'];
SimpleBlogCommon::UrlQuery( $id, $url, $query );
$search_obj->FindString($content, $title, $url, $query);
}
}
}