Project

General

Profile

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 1386 2011-01-16 09:56:53Z 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

    
19
function wysiwyg_search($func_vars) {
20
	extract($func_vars, EXTR_PREFIX_ALL, 'func');
21
	
22
	// how many lines of excerpt we want to have at most
23
	$max_excerpt_num = $func_default_max_excerpt;
24
	$divider = ".";
25
	$result = false;
26
	
27
	// we have to get 'content' instead of 'text', because strip_tags() dosen't remove scripting well.
28
	// scripting will be removed later on automatically
29
	$table = TABLE_PREFIX."mod_wysiwyg";
30
	$query = $func_database->query("
31
		SELECT content
32
		FROM $table
33
		WHERE section_id='$func_section_id'
34
	");
35

    
36
	if($query->numRows() > 0) {
37
		if($res = $query->fetchRow()) {
38
			$mod_vars = array(
39
				'page_link' => $func_page_link,
40
				'page_link_target' => "#wb_section_$func_section_id",
41
				'page_title' => $func_page_title,
42
				'page_description' => $func_page_description,
43
				'page_modified_when' => $func_page_modified_when,
44
				'page_modified_by' => $func_page_modified_by,
45
				'text' => $res['content'].$divider,
46
				'max_excerpt_num' => $max_excerpt_num
47
			);
48
			if(print_excerpt2($mod_vars, $func_vars)) {
49
				$result = true;
50
			}
51
		}
52
	}
53
	return $result;
54
}
55

    
56
?>
(8-8/9)