Project

General

Profile

1 1262 Luisehahne
<?php
2
/*
3
*
4
*                       About WebsiteBaker
5
*
6
* Website Baker is a PHP-based Content Management System (CMS)
7
* designed with one goal in mind: to enable its users to produce websites
8
* with ease.
9
*
10
*                       LICENSE INFORMATION
11
*
12
* WebsiteBaker is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU General Public License
14
* as published by the Free Software Foundation; either version 2
15
* of the License, or (at your option) any later version.
16
*
17
* WebsiteBaker is distributed in the hope that it will be useful,
18
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
* See the GNU General Public License for more details.
21
*
22
* You should have received a copy of the GNU General Public License
23
* along with this program; if not, write to the Free Software
24
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25
*
26
*                   WebsiteBaker Extra Information
27
*
28
* Character Conversion file
29
* for search-/highlighting-related character-translations
30
*
31
*/
32
/**
33
 *
34
 * @category        frontend
35
 * @package         search
36 1268 Luisehahne
 * @author          WebsiteBaker Project
37 1262 Luisehahne
 * @copyright       2004-2009, Ryan Djurovich
38
 * @copyright       2009-2010, Website Baker Org. e.V.
39
 * @link			http://www.websitebaker2.org/
40
 * @license         http://www.gnu.org/licenses/gpl.html
41
 * @platform        WebsiteBaker 2.8.x
42
 * @requirements    PHP 4.3.4 and higher
43 1268 Luisehahne
 * @version         $Id$
44
 * @filesource		$HeadURL$
45 1262 Luisehahne
 * @lastmodified    $Date$
46
 *
47
 */
48
49
if(!defined('WB_URL')) {
50
	header('Location: ../index.php');
51
	exit(0);
52
}
53
if(!isset($search_lang)) $search_lang = LANGUAGE;
54
55
// umlaut to '(upper|lower)' for preg_match()
56
// this is UTF-8-encoded
57
// there is no need for a translation-table anymore since we use u-switch (utf-8) for preg-functions
58
// remember that we use the i-switch, too. [No need for (ae|Ae)]
59
60
$string_ul_umlaut = array();
61
$string_ul_regex = array();
62
63
// but add some national stuff
64
if($search_lang=='DE') { // add special handling for german umlauts (รค==ae, ...)
65
	$string_ul_umlaut_add = array(
66
		"\xc3\x9f", // german SZ-Ligatur
67
		"\xc3\xa4", // german ae
68
		"\xc3\xb6", // german oe
69
		"\xc3\xbc", // german ue
70
		"\xc3\x84", // german Ae
71
		"\xc3\x96", // german Oe
72
		"\xc3\x9c", // german Ue
73
		// these are not that usual
74
		"\xEF\xAC\x84", // german ffl-ligatur
75
		"ffl",          // german ffl-ligatur
76
		"\xEF\xAC\x83", // german ffi-ligatur
77
		"ffi",          // german ffi-ligatur
78
		"0xEF\xAC\x80", // german ff-Ligatur
79
		"ff",           // german ff-Ligatur
80
		"\xEF\xAC\x81", // german fi-ligatur
81
		"fi",           // german fi-ligatur
82
		"\xEF\xAC\x82", // german fl-ligatur
83
		"fl",           // german fl-ligatur
84
		"\xEF\xAC\x85", // german st-Ligatur (long s)
85
		"st",           // german st-Ligatur
86
		"\xEF\xAC\x86"  // german st-ligatur (round-s)
87
	);
88
	$string_ul_regex_add = array(
89
		"(\xc3\x9f|ss)", // german SZ.Ligatur
90
		"(\xc3\xa4|ae)", // german ae
91
		"(\xc3\xb6|oe)", // german oe
92
		"(\xc3\xbc|ue)", // german ue
93
		"(\xc3\x84|Ae)", // german Ae
94
		"(\xc3\x96|Oe)", // german Oe
95
		"(\xc3\x9c|Ue)", // german Ue
96
		// these are not that usual
97
		"(\xEF\xAC\x84|ffl)", // german ffl-ligatur
98
		"(\xEF\xAC\x84|ffl)", // german ffl-ligatur
99
		"(\xEF\xAC\x83|ffi)", // german ffi-ligatur
100
		"(\xEF\xAC\x83|ffi)", // german ffi-ligatur
101
		"(\xEF\xAC\x80|ff)",  // german ff-Ligatur
102
		"(\xEF\xAC\x80|ff)",  // german ff-Ligatur
103
		"(\xEF\xAC\x81|fi)",  // german fi-Ligatur
104
		"(\xEF\xAC\x81|fi)",  // german fi-Ligatur
105
		"(\xEF\xAC\x82|fl)",  // german fl-ligatur
106
		"(\xEF\xAC\x82|fl)",  // german fl-ligatur
107
		"(\xEF\xAC\x85|st)",  // german st-Ligatur (long s)
108
		"(\xEF\xAC\x85|st|\xEF\xAC\x86)",  // german st-Ligaturs
109
		"(\xEF\xAC\x86|st)"  // german st-ligatur (round-s)
110
	);
111
	$string_ul_umlaut = array_merge($string_ul_umlaut_add, $string_ul_umlaut);
112
	$string_ul_regex = array_merge($string_ul_regex_add, $string_ul_regex);
113
}
114
115
116 437 Ruebenwurz
?>