1
|
<?php
|
2
|
/**
|
3
|
*
|
4
|
* @category frontend
|
5
|
* @package search
|
6
|
* @author WebsiteBaker Project
|
7
|
* @copyright 2004-2009, Ryan Djurovich
|
8
|
* @copyright 2009-2011, Website Baker Org. e.V.
|
9
|
* @link http://www.websitebaker2.org/
|
10
|
* @license http://www.gnu.org/licenses/gpl.html
|
11
|
* @platform WebsiteBaker 2.8.x
|
12
|
* @requirements PHP 5.2.2 and higher
|
13
|
* @version $Id: search.php 1420 2011-01-26 17:43:56Z Luisehahne $
|
14
|
* @filesource $HeadURL: http://svn.websitebaker2.org/branches/2.8.x/wb/admin/users/save.php $
|
15
|
* @lastmodified $Date: 2011-01-10 13:21:47 +0100 (Mo, 10. Jan 2011) $
|
16
|
*
|
17
|
*/
|
18
|
// Must include code to stop this file being access directly
|
19
|
if(defined('WB_PATH') == false) { die("Cannot access this file directly"); }
|
20
|
|
21
|
function wysiwyg_search($func_vars) {
|
22
|
extract($func_vars, EXTR_PREFIX_ALL, 'func');
|
23
|
|
24
|
// how many lines of excerpt we want to have at most
|
25
|
$max_excerpt_num = $func_default_max_excerpt;
|
26
|
$divider = ".";
|
27
|
$result = false;
|
28
|
|
29
|
// we have to get 'content' instead of 'text', because strip_tags() dosen't remove scripting well.
|
30
|
// scripting will be removed later on automatically
|
31
|
$table = TABLE_PREFIX."mod_wysiwyg";
|
32
|
$query = $func_database->query("
|
33
|
SELECT content
|
34
|
FROM $table
|
35
|
WHERE section_id='$func_section_id'
|
36
|
");
|
37
|
|
38
|
if($query->numRows() > 0) {
|
39
|
if($res = $query->fetchRow()) {
|
40
|
$mod_vars = array(
|
41
|
'page_link' => $func_page_link,
|
42
|
'page_link_target' => "#wb_section_$func_section_id",
|
43
|
'page_title' => $func_page_title,
|
44
|
'page_description' => $func_page_description,
|
45
|
'page_modified_when' => $func_page_modified_when,
|
46
|
'page_modified_by' => $func_page_modified_by,
|
47
|
'text' => $res['content'].$divider,
|
48
|
'max_excerpt_num' => $max_excerpt_num
|
49
|
);
|
50
|
if(print_excerpt2($mod_vars, $func_vars)) {
|
51
|
$result = true;
|
52
|
}
|
53
|
}
|
54
|
}
|
55
|
return $result;
|
56
|
}
|
57
|
|
58
|
?>
|