| 1 |
<?php // $Id: Exp $ |
<?php // $Id: wghtml_module_module.php,v 1.1 2005/10/09 15:59:51 djnz Exp $ |
| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Implementation of hook_help(). |
* Implementation of hook_help(). |
| 25 |
case 'search': |
case 'search': |
| 26 |
$find = do_search($keys, 'wghtml', 'INNER JOIN {wghtml_pages} p ON p.pageId = i.sid'); |
$find = do_search($keys, 'wghtml', 'INNER JOIN {wghtml_pages} p ON p.pageId = i.sid'); |
| 27 |
$results = array(); |
$results = array(); |
| 28 |
|
require_once dirname(__FILE__).'/wghtml/class_wghtml.php'; |
| 29 |
|
require_once dirname(__FILE__).'/wghtml/implement_'.$GLOBALS['wghtml_config']['implementation'].'.php'; |
| 30 |
foreach ($find as $item) { |
foreach ($find as $item) { |
| 31 |
$page = wghtml_page::retrieve_page_from_id($item); |
$page = new wghtml_implementation; |
| 32 |
$results[] = array('link' => $page['linkto'], |
$page->pageId = $item->sid; |
| 33 |
|
$page->retrieve_page(); |
| 34 |
|
$results[] = array('link' => $page->linkto, |
| 35 |
'type' => variable_get('wghtml_search_result', ''), |
'type' => variable_get('wghtml_search_result', ''), |
| 36 |
'type' => $page['linkto'], |
'type' => $page->linkto, |
| 37 |
'title' => $page['title'] ? $page['title'] : '(No title)', |
'title' => $page->title ? $page->title : '(No title)', |
| 38 |
'date' => $page['signature'], |
'date' => $page->signature, |
| 39 |
// what is this ? 'extra' => '', |
// what is this ? 'extra' => '', |
| 40 |
'snippet' => search_excerpt($keys, strip_tags($page['title']."\n".$page['body']))); |
'snippet' => search_excerpt($keys, strip_tags($page->title."\n".$page->body))); |
| 41 |
} |
} |
| 42 |
return $results; |
return $results; |
| 43 |
} |
} |