Project

General

Profile

« Previous | Next » 

Revision 452

Added by Matthias about 17 years ago

again copied all changes for WB 2.6.6 from trunk to branches

View differences:

branches/2.6.x/wb/search/search.php
28 28
	exit(0);
29 29
}
30 30

  
31
// Include the WB functions file
32
require_once(WB_PATH.'/framework/functions.php');
33

  
31 34
// Check if search is enabled
32 35
if(SHOW_SEARCH != true) {
33 36
	echo $TEXT['SEARCH'].' '.$TEXT['DISABLED'];
......
39 42

  
40 43
	// Get the search type
41 44
	$match = 'all';
42
    if(isset($_REQUEST['match'])) {
43
        $match = $_REQUEST['match'];
44
    }
45
	if(isset($_REQUEST['match'])) {
46
		$match = $_REQUEST['match'];
47
	}
45 48

  
46 49
	// Get search string
47 50
	if(isset($_REQUEST['string'])) {
......
54 57
		$original_string=$wb->strip_slashes($string);
55 58
		// Double backslashes (mySQL needs doubly escaped backslashes in LIKE comparisons)
56 59
		$string = addslashes($wb->escape_backslashes($original_string));
57
		// then escape for mySQL query
58
		$search_string = htmlspecialchars($original_string,ENT_QUOTES);
60
		// convert a copy of $string to HTML-ENTITIES
61
		$string_entities = umlauts_to_entities($string);
62
		// and do some convertion to both
63
		require(WB_PATH.'/search/search_convert.php');
64
		$string = strtr($string,$string_conv_all);
65
		$string_entities = strtr($string_entities,$string_entities_conv_all);
66
		$search_string = $string_entities;
59 67
	} else {
60 68
		$string = '';
61 69
		$search_string = '';
......
75 83
				$string[] = $each_exploded_string;
76 84
			}
77 85
		}
86
		// Split $string_entities, too
87
		$exploded_string = explode(' ', $string_entities);
88
		// Make sure there is no blank values in the array
89
		$string_entities = array();
90
		foreach($exploded_string AS $each_exploded_string) {
91
			if($each_exploded_string != '') {
92
				$string_entities[] = $each_exploded_string;
93
			}
94
		}
78 95
		if ($match == 'any') {
79 96
			$any_checked = ' checked="checked"';
80 97
			$logical_operator = ' OR';
......
87 104
		$exact_string=$string;
88 105
		$string=array();
89 106
		$string[]=$exact_string;
107
		$exact_string=$string_entities;
108
		$string_entities=array();
109
		$string_entities[]=$exact_string;
90 110
	}	
91 111
	// Get list of usernames and display names
92 112
	$query_users = $database->query("SELECT user_id,username,display_name FROM ".TABLE_PREFIX."users");
......
121 141
	$vars = array('[SEARCH_STRING]', '[WB_URL]', '[PAGE_EXTENSION]', '[TEXT_SEARCH]', '[TEXT_ALL_WORDS]', '[TEXT_ANY_WORDS]', '[TEXT_EXACT_MATCH]', '[TEXT_MATCH]', '[TEXT_MATCHING]', '[ALL_CHECKED]', '[ANY_CHECKED]', '[EXACT_CHECKED]', '[REFERRER_ID]');
122 142
	$values = array($search_string, WB_URL, PAGE_EXTENSION, $TEXT['SEARCH'], $TEXT['ALL_WORDS'], $TEXT['ANY_WORDS'], $TEXT['EXACT_MATCH'], $TEXT['MATCH'], $TEXT['MATCHING'], $all_checked, $any_checked, $exact_checked, REFERRER_ID);
123 143
	$search_header = str_replace($vars, $values, ($fetch_header['value']));
144
	$vars = array('[TEXT_NO_RESULTS]');
145
	$values = array($TEXT['NO_RESULTS']);
146
	$search_no_results = str_replace($vars, $values, ($fetch_no_results['value']));
124 147
	
125 148
	// Show search header
126 149
	echo $search_header;
......
131 154
		// Show search results_header
132 155
		echo $search_results_header;
133 156
		// Search page details only, such as description, keywords, etc.
134
			$query_pages = "SELECT page_id, page_title, menu_title, link, description, modified_when, modified_by FROM ".TABLE_PREFIX."pages WHERE ";
135
			$count = 0;
136
			foreach($string AS $each_string) {
137
				if($count != 0) { $query_pages .= $logical_operator; }
138
				$query_pages .= " visibility != 'none' AND page_title LIKE '%$each_string%' AND searching = '1'".
139
				" OR visibility != 'none' AND visibility != 'deleted' AND menu_title LIKE '%$each_string%' AND searching = '1'".
140
				" OR visibility != 'none' AND visibility != 'deleted' AND description LIKE '%$each_string%' AND searching = '1'".
141
				" OR visibility != 'none' AND visibility != 'deleted' AND keywords LIKE '%$each_string%' AND searching = '1'";
142
				$count = $count+1;
157
		$query_pages = "SELECT page_id, page_title, menu_title, link, description, modified_when, modified_by FROM ".TABLE_PREFIX."pages WHERE ";
158
		$count = 0;
159
		foreach($string AS $each_string) {
160
			if($count != 0) { 
161
				$query_pages .= $logical_operator;
143 162
			}
144
			$query_pages = $database->query($query_pages);
163
			$query_pages .= " visibility != 'none' AND visibility != 'deleted' AND searching = '1'".
164
			" AND (page_title LIKE '%$each_string%' OR menu_title LIKE '%$each_string%' OR description LIKE '%$each_string%' OR keywords LIKE '%$each_string%')";
165
			$count = $count+1;
166
		}
167
		$count = 0;
168
		$query_pages .= ' OR';
169
		foreach($string_entities AS $each_string) {
170
			if($count != 0) { 
171
				$query_pages .= $logical_operator;
172
			}
173
			$query_pages .= " visibility != 'none' AND visibility != 'deleted' AND searching = '1'".
174
			" AND (page_title LIKE '%$each_string%' OR menu_title LIKE '%$each_string%' OR description LIKE '%$each_string%' OR keywords LIKE '%$each_string%')";
175
			$count = $count+1;
176
		}
177
		$query_pages = $database->query($query_pages);
145 178
		// Loop through pages
146 179
		if($query_pages->numRows() > 0) {
147 180
			while($page = $query_pages->fetchRow()) {
148 181
				// Get page link
149 182
				$link = page_link($page['link']);
183
				
184
				//Add search string for highlighting
185
				if ($match!='exact') {
186
					$sstring = implode(" ", $string);
187
					$link = $link."?searchresult=1&sstring=".urlencode($sstring);
188
				}
189
				else {
190
					$sstring = strtr($string[0], " ", "_");
191
					$link = $link."?searchresult=2&sstring=".urlencode($sstring);
192
				}
193
				
150 194
				// Set vars to be replaced by values
151 195
				$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]');
152 196
				if($page['modified_when'] > 0) {
......
201 245
							$prepared_query = $query_start;
202 246
							$count = 0;
203 247
							foreach($string AS $each_string) {
204
								if($count != 0) { $prepared_query .= $logical_operator; }
248
								if($count != 0) {
249
									$prepared_query .= $logical_operator;
250
								}
205 251
								$prepared_query .= str_replace('[STRING]', $each_string, $query_body);
206 252
								$count = $count+1;
207 253
							}
254
							$count=0;
255
							$prepared_query .= ' OR ';
256
							foreach($string_entities AS $each_string) {
257
								if($count != 0) {
258
									$prepared_query .= $logical_operator;
259
								}
260
								$prepared_query .= str_replace('[STRING]', $each_string, $query_body);
261
								$count = $count+1;
262
							}
263
							
208 264
							$prepared_query .= $query_end;
265
							
209 266
							// Execute query
210 267
							$query = $database->query($prepared_query);
211 268
							// Loop though queried items
......
215 272
									if(!isset($fields['page_id']) OR !isset($pages_listed[$page[$fields['page_id']]])) {
216 273
										// Get page link
217 274
										$link = page_link($page[$fields['link']]);
275
										
276
										//Add search string for highlighting
277
										if ($match!='exact') {
278
											$sstring = implode(" ", $string);
279
											$link = $link."?searchresult=1&sstring=".urlencode($sstring);
280
										}
281
										else {
282
											$sstring = strtr($string[0], " ", "_");
283
											$link = $link."?searchresult=2&sstring=".urlencode($sstring);
284
										}
285
										
218 286
										// Set vars to be replaced by values
219 287
										$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]');
220 288
										if($page[$fields['modified_when']] > 0) {
......
236 304
									}
237 305
								}
238 306
							}
239
						
240 307
						}
241 308
					}
242 309
				}
......
247 314
			
248 315
		}
249 316
	
250
	// Say no items found if we should
251
	if($pages_listed == array() AND $items_listed == array()) {
252
		echo $fetch_no_results['value'];
253
	}
317
		// Say no items found if we should
318
		if($pages_listed == array() AND $items_listed == array()) {
319
			echo $search_no_results;
320
		}
254 321
		
255 322
	}
256 323
	
branches/2.6.x/wb/search/index.php
34 34
define('ROOT_PARENT', 0);
35 35
define('PARENT', 0);
36 36
define('LEVEL', 0);
37
define('PAGE_TITLE', 'Search');
38
define('MENU_TITLE', 'Search');
37
define('PAGE_TITLE', $TEXT['SEARCH']);
38
define('MENU_TITLE', $TEXT['SEARCH']);
39 39
define('MODULE', '');
40 40
define('VISIBILITY', 'public');
41 41
define('PAGE_CONTENT', 'search.php');
branches/2.6.x/wb/install/save.php
548 548
	
549 549
	// Search header
550 550
	$search_header = addslashes('
551
<h1>Search</h1>
551
<h1>[TEXT_SEARCH]</h1>
552 552

  
553 553
<form name="search" action="[WB_URL]/search/index[PAGE_EXTENSION]" method="get">
554 554
<table cellpadding="3" cellspacing="0" border="0" width="500">
......
603 603
	$insert_search_results_footer = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'results_footer', '$search_results_footer', '')";
604 604
	$database->query($insert_search_results_footer);
605 605
	// Search no results
606
	$search_no_results = addslashes('<br />No results found');
606
	$search_no_results = addslashes('<br />[TEXT_NO_RESULTS]');
607 607
	$insert_search_no_results = "INSERT INTO `".TABLE_PREFIX."search` VALUES ('', 'no_results', '$search_no_results', '')";
608 608
	$database->query($insert_search_no_results);
609 609
	// Search template
branches/2.6.x/wb/admin/pages/settings.php
76 76
$template->set_block('page', 'main_block', 'main');
77 77
$template->set_var(array(
78 78
								'PAGE_ID' => $results_array['page_id'],
79
								'PAGE_TITLE' => (htmlentities($results_array['page_title'])),
80
								'MENU_TITLE' => (htmlentities($results_array['menu_title'])),
79
								'PAGE_TITLE' => ($results_array['page_title']),
80
								'MENU_TITLE' => ($results_array['menu_title']),
81 81
								'DESCRIPTION' => ($results_array['description']),
82 82
								'KEYWORDS' => ($results_array['keywords']),
83 83
								'MODIFIED_BY' => $user['display_name'],
......
249 249
			for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; }
250 250
			$template->set_var(array(
251 251
											'ID' => $page['page_id'],
252
											'TITLE' => ($title_prefix.htmlentities($page['page_title']))
252
											'TITLE' => ($title_prefix.$page['page_title'])
253 253
											)
254 254
									);
255 255
			if($results_array['parent'] == $page['page_id']) {
branches/2.6.x/wb/admin/pages/index.php
166 166
				</td>
167 167
				<?php if($admin->get_permission('pages_modify') == true AND $can_modify == true) { ?>
168 168
				<td>
169
					<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo (htmlentities($page['page_title'])); ?></a>				
169
					<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo ($page['page_title']); ?></a>				
170 170
				</td>
171 171
				<?php } else { ?>
172 172
				<td>
173
					<?php echo (htmlentities($page['page_title'])); ?>
173
					<?php echo ($page['page_title']); ?>
174 174
				</td>
175 175
				<?php } ?>
176 176
				<td align="left" width="232">
177
					<font color="#999999"><?php echo (htmlentities($page['menu_title'])); ?></font>
177
					<font color="#999999"><?php echo ($page['menu_title']); ?></font>
178 178
				</td>
179 179
				<td align="center" valign="middle" width="90">
180 180
				<?php if($page['visibility'] == 'public') { ?>
......
462 462
			for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; }
463 463
				$template->set_var(array(
464 464
												'ID' => $page['page_id'],
465
												'TITLE' => ($title_prefix.htmlentities($page['page_title']))
465
												'TITLE' => ($title_prefix.$page['page_title'])
466 466
												)
467 467
										);
468 468
				if($can_modify == true) {
branches/2.6.x/wb/admin/pages/trash.php
141 141
				</td>
142 142
				<?php if($admin->get_permission('pages_modify') == true AND $can_modify == true AND $page['visibility'] != 'heading') { ?>
143 143
				<td>
144
					<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo (htmlentities($page['page_title'])); ?></a>
144
					<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo ($page['page_title']); ?></a>
145 145
				</td>
146 146
				<?php } else { ?>
147 147
				<td>
148 148
					<?php
149 149
					if($page['visibility'] != 'heading') {
150
						echo (htmlentities($page['page_title']));
150
						echo ($page['page_title']);
151 151
					} else {
152
						echo '<b>'.(htmlentities($page['page_title'])).'</b>';
152
						echo '<b>'.($page['page_title']).'</b>';
153 153
					}
154 154
					?>
155 155
				</td>
156 156
				<?php } ?>
157 157
				<td align="left" width="232">
158
					<font color="#999999"><?php echo htmlentities($page['menu_title']); ?></font>
158
					<font color="#999999"><?php echo $page['menu_title']; ?></font>
159 159
				</td>
160 160
				<td align="right" valign="middle" width="30" style="padding-right: 20px;">
161 161
				<?php if($page['visibility'] == 'public') { ?>
branches/2.6.x/wb/admin/pages/settings2.php
41 41

  
42 42
// Get values
43 43
$page_title = $admin->add_slashes($admin->get_post_escaped('page_title'));
44
$page_title = my_htmlspecialchars($page_title);
44 45
$menu_title = $admin->add_slashes($admin->get_post_escaped('menu_title'));
46
$menu_title = my_htmlspecialchars($menu_title);
45 47
$description = $admin->add_slashes($admin->get_post('description'));
46 48
$keywords = $admin->add_slashes($admin->get_post('keywords'));
47 49
$parent = $admin->get_post('parent');
......
55 57
$menu = $admin->get_post('menu');
56 58

  
57 59
// Validate data
58
if($page_title == '') {
60
if($page_title == '' || substr($page_title,0,1)=='.') {
59 61
	$admin->print_error($MESSAGE['PAGES']['BLANK_PAGE_TITLE']);
60 62
}
61
if($menu_title == '') {
63
if($menu_title == '' || substr($menu_title,0,1)=='.') {
62 64
	$admin->print_error($MESSAGE['PAGES']['BLANK_MENU_TITLE']);
63 65
}
64 66

  
......
114 116
// Work-out what the link should be
115 117
if($parent == '0') {
116 118
	$link = '/'.page_filename($menu_title);
117
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($menu_title).'.php';
119
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.page_filename($menu_title).PAGE_EXTENSION; 
118 120
} else {
119 121
	$parent_section = '';
120 122
	$parent_titles = array_reverse(get_parent_titles($parent));
......
123 125
	}
124 126
	if($parent_section == '/') { $parent_section = ''; }
125 127
	$link = '/'.$parent_section.page_filename($menu_title);
126
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($menu_title).'.php';
128
	$filename = WB_PATH.PAGES_DIRECTORY.'/'.$parent_section.page_filename($menu_title).PAGE_EXTENSION;  
127 129
}
128 130

  
129 131
// Check if a page with same page filename exists
......
142 144
$page_trail = get_page_trail($page_id);
143 145

  
144 146
// Make sure link is not overwritten if page uses the menu link module
145
if(strstr($old_link, '://') != '') {
147
$query_sections = $database->query("SELECT section_id FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' AND module = 'menu_link'");
148
if($query_sections->numRows() > 0) {
146 149
	$link = $old_link;
147
}
150
} 
148 151

  
149 152
// Update page settings in the pages table
150 153
$query = "UPDATE ".TABLE_PREFIX."pages SET parent = '$parent', page_title = '$page_title', menu_title = '$menu_title', menu = '$menu', level = '$level', page_trail = '$page_trail', root_parent = '$root_parent', link = '$link', template = '$template', target = '$target', description = '$description', keywords = '$keywords', position = '$position', visibility = '$visibility', searching = '$searching', language = '$language', admin_groups = '$admin_groups', viewing_groups = '$viewing_groups' WHERE page_id = '$page_id'";
......
164 167
	// First check if we need to create a new file
165 168
	if($old_link != $link) {
166 169
		// Delete old file
167
		unlink(WB_PATH.PAGES_DIRECTORY.$old_link.'.php');
170
		unlink(WB_PATH.PAGES_DIRECTORY.$old_link.PAGE_EXTENSION);
168 171
		// Create access file
169 172
		create_access_file($filename,$page_id,$level);
170 173
		// Move a directory for this page
......
187 190
					// Update level and link
188 191
					$database->query("UPDATE ".TABLE_PREFIX."pages SET link = '$new_sub_link', level = '$new_sub_level' WHERE page_id = '".$sub['page_id']."' LIMIT 1");
189 192
					// Re-write the access file for this page
190
					$old_subpage_file = WB_PATH.PAGES_DIRECTORY.$new_sub_link.'.php';
193
					$old_subpage_file = WB_PATH.PAGES_DIRECTORY.$new_sub_link.PAGE_EXTENSION;
191 194
					if(file_exists($old_subpage_file)) {
192 195
						unlink($old_subpage_file);
193 196
					}
194
					create_access_file(WB_PATH.PAGES_DIRECTORY.$new_sub_link.'.php', $sub['page_id'], $new_sub_level);
197
					create_access_file(WB_PATH.PAGES_DIRECTORY.$new_sub_link.PAGE_EXTENSION, $sub['page_id'], $new_sub_level);
195 198
				}
196 199
			}
197 200
		}
......
199 202
}
200 203

  
201 204
// Function to fix page trail of subs
202
function fix_page_trail($parent) {
205
function fix_page_trail($parent,$root_parent) {
203 206
	// Get objects and vars from outside this function
204 207
	global $admin, $template, $database, $TEXT, $MESSAGE;
205 208
	// Get page list from database
......
210 213
	if($get_pages->numRows() > 0)	{
211 214
		while($page = $get_pages->fetchRow()) {
212 215
			// Fix page trail
213
			$database->query("UPDATE ".TABLE_PREFIX."pages SET page_trail = '".get_page_trail($page['page_id'])."' WHERE page_id = '".$page['page_id']."'");
216
			$database->query("UPDATE ".TABLE_PREFIX."pages SET ".($root_parent != 0 ?"root_parent = '$root_parent', ":"")." page_trail = '".get_page_trail($page['page_id'])."' WHERE page_id = '".$page['page_id']."'");
214 217
			// Run this query on subs
215
			fix_page_trail($page['page_id']);
218
			fix_page_trail($page['page_id'],$root_parent);
216 219
		}
217 220
	}
218 221
}
219 222
// Fix sub-pages page trail
220
fix_page_trail($page_id);
223
fix_page_trail($page_id,$root_parent);
221 224

  
222 225
/* END page "access file" code */
223 226

  
branches/2.6.x/wb/admin/pages/sections.php
138 138
	</td>
139 139
	<td align="right">
140 140
		<?php echo $TEXT['CURRENT_PAGE']; ?>: 
141
		<b><?php echo (htmlentities($results_array['page_title'])); ?></b>
141
		<b><?php echo ($results_array['page_title']); ?></b>
142 142
		-
143 143
		<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>"><?php echo $HEADING['MODIFY_PAGE']; ?></a>
144 144
		-
branches/2.6.x/wb/admin/pages/modify.php
60 60
$template->set_block('page', 'main_block', 'main');
61 61
$template->set_var(array(
62 62
								'PAGE_ID' => $results_array['page_id'],
63
								'PAGE_TITLE' => (htmlentities($results_array['page_title'])),
63
								'PAGE_TITLE' => ($results_array['page_title']),
64 64
								'MODIFIED_BY' => $user['display_name'],
65 65
								'MODIFIED_BY_USERNAME' => $user['username'],
66 66
								'MODIFIED_WHEN' => $modified_ts,
......
97 97
$template->pparse('output', 'page');
98 98

  
99 99
// Get sections for this page
100
$module_permissions = $_SESSION['MODULE_PERMISSIONS'];
100 101
$query_sections = $database->query("SELECT section_id,module FROM ".TABLE_PREFIX."sections WHERE page_id = '$page_id' ORDER BY position ASC");
101 102
if($query_sections->numRows() > 0) {
102 103
	while($section = $query_sections->fetchRow()) {
103 104
		$section_id = $section['section_id'];
104 105
		$module = $section['module'];
105
		// Include the modules editing script if it exists
106
		if(file_exists(WB_PATH.'/modules/'.$module.'/modify.php')) {
107
			echo '<a name="'.$section_id.'"></a>';
108
			require(WB_PATH.'/modules/'.$module.'/modify.php');
106
		//Have permission?
107
		if(!is_numeric(array_search($module, $module_permissions))) {
108
			// Include the modules editing script if it exists
109
			if(file_exists(WB_PATH.'/modules/'.$module.'/modify.php')) {
110
				echo '<a name="'.$section_id.'"></a>';
111
				require(WB_PATH.'/modules/'.$module.'/modify.php');
112
			}
109 113
		}
110 114
	}
111 115
}
branches/2.6.x/wb/admin/pages/add.php
33 33

  
34 34
// Get values
35 35
$title = $admin->add_slashes($admin->get_post_escaped('title'));
36
$title = my_htmlspecialchars($title);
36 37
$module = $admin->get_post('type');
37 38
$parent = $admin->get_post('parent');
38 39
$visibility = $admin->get_post('visibility');
......
47 48
}	
48 49

  
49 50
// Validate data
50
if($title == '') {
51
if($title == '' || substr($title,0,1)=='.') {
51 52
	$admin->print_error($MESSAGE['PAGES']['BLANK_PAGE_TITLE']);
52 53
}
53 54

  
branches/2.6.x/wb/admin/login/index.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2007, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
require_once("../../config.php");
27
require_once(WB_PATH."/framework/class.login.php");
28

  
29
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {
30
	// Generate username field name
31
	$username_fieldname = 'username_';
32
	$password_fieldname = 'password_';
33
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";
34
	srand((double)microtime()*1000000);
35
	$i = 0;
36
	while ($i <= 7) {
37
		$num = rand() % 33;
38
		$tmp = substr($salt, $num, 1);
39
		$username_fieldname = $username_fieldname . $tmp;
40
		$password_fieldname = $password_fieldname . $tmp;
41
		$i++;
42
	}
43
} else {
44
	$username_fieldname = 'username';
45
	$password_fieldname = 'password';
46
}
47

  
48
$thisApp = new Login(
49
							array(
50
									'MAX_ATTEMPS' => "50",
51
									'WARNING_URL' => ADMIN_URL."/login/warning.html",
52
									'USERNAME_FIELDNAME' => $username_fieldname,
53
									'PASSWORD_FIELDNAME' => $password_fieldname,
54
									'REMEMBER_ME_OPTION' => SMART_LOGIN,
55
									'MIN_USERNAME_LEN' => "2",
56
									'MIN_PASSWORD_LEN' => "2",
57
									'MAX_USERNAME_LEN' => "30",
58
									'MAX_PASSWORD_LEN' => "30",
59
									'LOGIN_URL' => ADMIN_URL."/login/index.php",
60
									'DEFAULT_URL' => ADMIN_URL."/start/index.php",
61
									'TEMPLATE_DIR' => ADMIN_PATH."/login",
62
									'TEMPLATE_FILE' => "template.html",
63
									'FRONTEND' => false,
64
									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",
65
									'USERS_TABLE' => TABLE_PREFIX."users",
66
									'GROUPS_TABLE' => TABLE_PREFIX."groups",
67
							)
68
					);
69

  
1
<?php

2

  
3
// $Id$

4

  
5
/*

6

  
7
 Website Baker Project <http://www.websitebaker.org/>

8
 Copyright (C) 2004-2007, Ryan Djurovich

9

  
10
 Website Baker is free software; you can redistribute it and/or modify

11
 it under the terms of the GNU General Public License as published by

12
 the Free Software Foundation; either version 2 of the License, or

13
 (at your option) any later version.

14

  
15
 Website Baker is distributed in the hope that it will be useful,

16
 but WITHOUT ANY WARRANTY; without even the implied warranty of

17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

18
 GNU General Public License for more details.

19

  
20
 You should have received a copy of the GNU General Public License

21
 along with Website Baker; if not, write to the Free Software

22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

23

  
24
*/

25

  
26
require_once("../../config.php");

27
require_once(WB_PATH."/framework/class.login.php");

28

  
29
if(defined('SMART_LOGIN') AND SMART_LOGIN == 'enabled') {

30
	// Generate username field name

31
	$username_fieldname = 'username_';

32
	$password_fieldname = 'password_';

33
	$salt = "abchefghjkmnpqrstuvwxyz0123456789";

34
	srand((double)microtime()*1000000);

35
	$i = 0;

36
	while ($i <= 7) {

37
		$num = rand() % 33;

38
		$tmp = substr($salt, $num, 1);

39
		$username_fieldname = $username_fieldname . $tmp;

40
		$password_fieldname = $password_fieldname . $tmp;

41
		$i++;

42
	}

43
} else {

44
	$username_fieldname = 'username';

45
	$password_fieldname = 'password';

46
}

47

  
48
$thisApp = new Login(

49
							array(

50
									'MAX_ATTEMPS' => "3",

51
									'WARNING_URL' => ADMIN_URL."/login/warning.html",

52
									'USERNAME_FIELDNAME' => $username_fieldname,

53
									'PASSWORD_FIELDNAME' => $password_fieldname,

54
									'REMEMBER_ME_OPTION' => SMART_LOGIN,

55
									'MIN_USERNAME_LEN' => "2",

56
									'MIN_PASSWORD_LEN' => "2",

57
									'MAX_USERNAME_LEN' => "30",

58
									'MAX_PASSWORD_LEN' => "30",

59
									'LOGIN_URL' => ADMIN_URL."/login/index.php",

60
									'DEFAULT_URL' => ADMIN_URL."/start/index.php",

61
									'TEMPLATE_DIR' => ADMIN_PATH."/login",

62
									'TEMPLATE_FILE' => "template.html",

63
									'FRONTEND' => false,

64
									'FORGOTTEN_DETAILS_APP' => ADMIN_URL."/login/forgot/index.php",

65
									'USERS_TABLE' => TABLE_PREFIX."users",

66
									'GROUPS_TABLE' => TABLE_PREFIX."groups",

67
							)

68
					);

69

  
70 70
?>
branches/2.6.x/wb/admin/modules/details.php
55 55
	$module = $result->fetchRow();
56 56
}
57 57

  
58
// Get language description if available
59
// First get users defined language
60
$query = "SELECT language FROM ".TABLE_PREFIX."users WHERE user_id = '".$admin->get_user_id()."'";
61
$results = $database->query($query);
62
if($results->numRows() > 0) {
63
	// We found a language for the user, store it
64
	$user_info=$results->fetchRow();
65
	$user_language = $user_info['language'];
66

  
67
	// Next check for language file in module dir and insert the variables from that file
68
	if(file_exists(WB_PATH.'/modules/'.$file.'/languages/'.$user_language.'.php')) {
69
		require(WB_PATH.'/modules/'.$file.'/languages/'.$user_language.'.php');
70
		
71
		// Check to see if new variable exists... -> $module_description
72
		if (isset($module_description)) {
73
			// Override the module-description with correct desription in users language
74
			$module['description']=$module_description;
75
		}	
76
	}
77
}
78

  
58 79
$template->set_var(array(
59 80
								'NAME' => $module['name'],
60 81
								'AUTHOR' => $module['author'],
branches/2.6.x/wb/modules/wysiwyg/save.php
29 29
$update_when_modified = true; // Tells script to update when this page was last updated
30 30
require(WB_PATH.'/modules/admin.php');
31 31

  
32
// Include the WB functions file
33
require_once(WB_PATH.'/framework/functions.php');
34

  
32 35
// Update the mod_wysiwygs table with the contents
33 36
if(isset($_POST['content'.$section_id])) {
34 37
	$content = $admin->add_slashes($_POST['content'.$section_id]);
35
	$text = strip_tags($content);
38
	// searching in $text will be much easier this way
39
	$text = umlauts_to_entities(strip_tags($content), strtoupper(DEFAULT_CHARSET), 0);
36 40
	$database = new database();
37 41
	$query = "UPDATE ".TABLE_PREFIX."mod_wysiwyg SET content = '$content', text = '$text' WHERE section_id = '$section_id'";
38 42
	$database->query($query);	
branches/2.6.x/wb/modules/form/install.php
87 87
	$query_start_code = "SELECT [TP]pages.page_id, [TP]pages.page_title,	[TP]pages.link, [TP]pages.description, [TP]pages.modified_when, [TP]pages.modified_by	FROM [TP]mod_form_fields, [TP]mod_form_settings, [TP]pages WHERE ";
88 88
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_start', '$query_start_code', 'form')");
89 89
	// Query body
90
	$query_body_code = " [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.header [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'
91
	OR [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.footer [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'
92
	OR [TP]pages.page_id = [TP]mod_form_fields.page_id AND [TP]mod_form_fields.title [O] \'[W][STRING][W]\' AND [TP]pages.searching = \'1\'";
90
	$query_body_code = " [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.header LIKE \'%[STRING]%\'
91
	OR [TP]pages.page_id = [TP]mod_form_settings.page_id AND [TP]mod_form_settings.footer LIKE \'%[STRING]%\'
92
	OR [TP]pages.page_id = [TP]mod_form_fields.page_id AND [TP]mod_form_fields.title LIKE \'%[STRING]%\' ";
93 93
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_body', '$query_body_code', 'form')");
94 94
	// Query end
95
	$query_end_code = '';
95
	$query_end_code = "";
96 96
	$database->query("INSERT INTO ".TABLE_PREFIX."search (name,value,extra) VALUES ('query_end', '$query_end_code', 'form')");
97 97
	
98 98
	// Insert blank row (there needs to be at least on row for the search to work)
branches/2.6.x/wb/modules/form/view.php
380 380
	if(isset($success) AND $success == true) {
381 381
		echo $success_message;
382 382
	} else {
383
		echo $TEXT['ERROR'];
383
		if(isset($success) AND $success == false) {
384
			echo $TEXT['ERROR'];
385
		}
384 386
	}
385 387
	
386 388
}
branches/2.6.x/wb/modules/form/modify.php
31 31
// Must include code to stop this file being access directly
32 32
if(!defined('WB_PATH')) { exit("Cannot access this file directly"); }
33 33

  
34
//Delete all form fields with no title
35
$database->query("DELETE FROM ".TABLE_PREFIX."mod_form_fields  WHERE page_id = '$page_id' and section_id = '$section_id' and title=''");
36

  
34 37
?>
35 38
<table cellpadding="0" cellspacing="0" border="0" width="100%">
36 39
<tr>
branches/2.6.x/wb/modules/news/install.php
130 130
	$database->query("INSERT INTO ".TABLE_PREFIX."mod_news_settings (section_id,page_id) VALUES ('0', '0')");
131 131
	
132 132
	// Make news post access files dir
133
	make_dir(WB_PATH.PAGES_DIRECTORY.'/posts/');
133
	require_once(WB_PATH.'/framework/functions.php');
134
	make_dir(WB_PATH.PAGES_DIRECTORY.'/posts');
134 135
	
135 136
}
136 137

  
branches/2.6.x/wb/modules/news/rss.php
46 46
$wb->get_website_settings();
47 47

  
48 48
// Sending XML header
49
header("Content-type: text/xml");
49
header("Content-type: text/xml; charset=utf-8" );
50 50

  
51 51
// Header info
52 52
// Required by CSS 2.0
53
?>
54
<rss version="2.0" >
55
<channel>
56
<title><?php echo PAGE_TITLE; ?></title>
57
<link>http://<?php echo $_SERVER['SERVER_NAME']; ?></link>
58
<description> <?php echo PAGE_DESCRIPTION; ?></description>
59
<?php
60
// Optional header info 
61
?>
62
<language><?php echo DEFAULT_LANGUAGE; ?></language>
63
<copyright><?php echo WB_URL.$_SERVER['REQUEST_URI']; ?></copyright>
64
<managingEditor><?php echo SERVER_EMAIL; ?></managingEditor>
65
<webMaster><?php echo SERVER_EMAIL; ?></webMaster>
66
<category><?php echo WEBSITE_TITLE; ?></category>
67
<generator>Website Baker Content Management System</generator>
53 68

  
54
echo "<rss version='2.0'>";
55
echo "<channel>";
56
echo "<title>".PAGE_TITLE."</title>";
57
echo "<link>".WB_URL."</link>";
58
echo "<description>".PAGE_DESCRIPTION."</description>";
59

  
60
// Optional header info
61
echo "<language>".DEFAULT_LANGUAGE."</language>";
62
echo "<copyright>".WB_URL."</copyright>";
63
echo "<managingEditor>".SERVER_EMAIL."</managingEditor>";
64
echo "<webMaster>".SERVER_EMAIL."</webMaster>";
65
echo "<category>".WEBSITE_TITLE."</category>";
66
echo "<generator>Website Baker Content Management System</generator>";
67

  
69
<?php
68 70
// Get news items from database
69 71

  
70 72
//Query
......
76 78
$result = $database->query($query);
77 79

  
78 80
//Generating the news items
79
while($item = $result->fetchRow($result)){
81
while($item = $result->fetchRow($result)){ ?>
80 82

  
81
    echo "<item>";
82
    echo "<title>".$item["title"]."</title>";
83
    // Stripping HTML Tags for text-only visibility
84
    echo "<description>".strip_tags($item["content_short"])."</description>";
85
    echo "<link>".WB_URL."/pages".$item["link"].PAGE_EXTENSION."</link>";
86
    /* Add further (non required) information here like ie.
87
    echo "<author>".$item["posted_by"]."</author>");
88
    etc.
89
    */
90
    echo "</item>";
83
<item>
84
<title><![CDATA[<?php echo stripslashes($item["title"]); ?>]]></title>
85
<description><![CDATA[<?php echo stripslashes($item["content_short"]); ?>]]></description>
86
<guid><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></guid>
87
<link><?php echo WB_URL."/pages".$item["link"].PAGE_EXTENSION; ?></link>
88
</item>
91 89

  
92
}
90
<?php } ?>
93 91

  
94
// Writing footer information
95
echo "</channel>";
96
echo "</rss>";
97

  
98
?>
92
</channel>
93
</rss>
branches/2.6.x/wb/modules/news/uninstall.php
32 32
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_groups");
33 33
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_comments");
34 34
$database->query("DROP TABLE ".TABLE_PREFIX."mod_news_settings");
35
require(WB_PATH.'/framework/functions.php');
35

  
36
require_once(WB_PATH.'/framework/functions.php');
36 37
rm_full_dir(WB_PATH.PAGES_DIRECTORY.'/posts');
37 38

  
38 39
?>
branches/2.6.x/wb/account/login.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2007, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
require_once("../config.php");
27

  
28
// Make sure the login is enabled
29
if(!FRONTEND_LOGIN) {
30
	if(INTRO_PAGE) {
31
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index'.PAGE_EXTENSION);
32
		exit(0);
33
	} else {
34
		header('Location: '.WB_URL.'/index'.PAGE_EXTENSION);
35
		exit(0);
36
	}
37
}
38

  
39
// Required page details
40
$page_id = 0;
41
$page_description = '';
42
$page_keywords = '';
43
define('PAGE_ID', 0);
44
define('ROOT_PARENT', 0);
45
define('PARENT', 0);
46
define('LEVEL', 0);
47
define('PAGE_TITLE', 'Please login');
48
define('MENU_TITLE', 'Please login');
49
define('VISIBILITY', 'public');
50
// Set the page content include file
51
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');
52

  
53
require_once(WB_PATH.'/framework/class.login.php');
54

  
55
// Create new login app
56
$thisApp = new Login(
57
							array(
58
									"MAX_ATTEMPS" => "50",
59
									"WARNING_URL" => ADMIN_URL."/login/warning.html",
60
									"USERNAME_FIELDNAME" => 'username',
61
									"PASSWORD_FIELDNAME" => 'password',
62
									"REMEMBER_ME_OPTION" => SMART_LOGIN,
63
									"MIN_USERNAME_LEN" => "2",
64
									"MIN_PASSWORD_LEN" => "2",
65
									"MAX_USERNAME_LEN" => "30",
66
									"MAX_PASSWORD_LEN" => "30",
67
									"LOGIN_URL" => WB_URL."/account/login".PAGE_EXTENSION.'?redirect='.$_REQUEST['redirect'],
68
									"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index".PAGE_EXTENSION,
69
									"TEMPLATE_DIR" => ADMIN_PATH."/login",
70
									"TEMPLATE_FILE" => "template.html",
71
									"FRONTEND" => true,
72
									"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php".PAGE_EXTENSION,
73
									"USERS_TABLE" => TABLE_PREFIX."users",
74
									"GROUPS_TABLE" => TABLE_PREFIX."groups",
75
									"REDIRECT_URL" => $_REQUEST['redirect']
76
							)
77
					);
78

  
79
// Set extra outsider var
80
$globals[] = 'thisApp';
81

  
82
// Include the index (wrapper) file
83
require(WB_PATH.'/index.php');
84

  
85

  
1
<?php

2

  
3
// $Id$

4

  
5
/*

6

  
7
 Website Baker Project <http://www.websitebaker.org/>

8
 Copyright (C) 2004-2007, Ryan Djurovich

9

  
10
 Website Baker is free software; you can redistribute it and/or modify

11
 it under the terms of the GNU General Public License as published by

12
 the Free Software Foundation; either version 2 of the License, or

13
 (at your option) any later version.

14

  
15
 Website Baker is distributed in the hope that it will be useful,

16
 but WITHOUT ANY WARRANTY; without even the implied warranty of

17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

18
 GNU General Public License for more details.

19

  
20
 You should have received a copy of the GNU General Public License

21
 along with Website Baker; if not, write to the Free Software

22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

23

  
24
*/

25

  
26
require_once("../config.php");

27

  
28
// Make sure the login is enabled

29
if(!FRONTEND_LOGIN) {

30
	if(INTRO_PAGE) {

31
		header('Location: '.WB_URL.PAGES_DIRECTORY.'/index'.PAGE_EXTENSION);

32
		exit(0);

33
	} else {

34
		header('Location: '.WB_URL.'/index'.PAGE_EXTENSION);

35
		exit(0);

36
	}

37
}

38

  
39
// Required page details

40
$page_id = 0;

41
$page_description = '';

42
$page_keywords = '';

43
define('PAGE_ID', 0);

44
define('ROOT_PARENT', 0);

45
define('PARENT', 0);

46
define('LEVEL', 0);

47
define('PAGE_TITLE', 'Please login');

48
define('MENU_TITLE', 'Please login');

49
define('VISIBILITY', 'public');

50
// Set the page content include file

51
define('PAGE_CONTENT', WB_PATH.'/account/login_form.php');

52

  
53
require_once(WB_PATH.'/framework/class.login.php');

54

  
55
// Create new login app

56
$thisApp = new Login(

57
							array(

58
									"MAX_ATTEMPS" => "3",

59
									"WARNING_URL" => ADMIN_URL."/login/warning.html",

60
									"USERNAME_FIELDNAME" => 'username',

61
									"PASSWORD_FIELDNAME" => 'password',

62
									"REMEMBER_ME_OPTION" => SMART_LOGIN,

63
									"MIN_USERNAME_LEN" => "2",

64
									"MIN_PASSWORD_LEN" => "2",

65
									"MAX_USERNAME_LEN" => "30",

66
									"MAX_PASSWORD_LEN" => "30",

67
									"LOGIN_URL" => WB_URL."/account/login".PAGE_EXTENSION.'?redirect='.$_REQUEST['redirect'],

68
									"DEFAULT_URL" => WB_URL.PAGES_DIRECTORY."/index".PAGE_EXTENSION,

69
									"TEMPLATE_DIR" => ADMIN_PATH."/login",

70
									"TEMPLATE_FILE" => "template.html",

71
									"FRONTEND" => true,

72
									"FORGOTTEN_DETAILS_APP" => WB_URL."/account/forgot.php".PAGE_EXTENSION,

73
									"USERS_TABLE" => TABLE_PREFIX."users",

74
									"GROUPS_TABLE" => TABLE_PREFIX."groups",

75
									"REDIRECT_URL" => $_REQUEST['redirect']

76
							)

77
					);

78

  
79
// Set extra outsider var

80
$globals[] = 'thisApp';

81

  
82
// Include the index (wrapper) file

83
require(WB_PATH.'/index.php');

84

  
85

  
86 86
?>
branches/2.6.x/wb/framework/convert.php
25 25

  
26 26
/*
27 27
Character Conversion file
28
This file helps convert possible error-causing
29
characters to equivalent non-error-causing ones
28
to convert some entities to there 7bit equivalents
30 29
*/
31 30
if(!defined('WB_URL')) {
32 31
	header('Location: ../index.php');
......
34 33
}
35 34

  
36 35
$conversion_array = array(
37
'À'=>'A','�?'=>'A','Â'=>'A','Ã'=>'A','Ä'=>'Ae', '&Auml;'=>'A',
38
'Å'=>'A','Ā'=>'A','Ą'=>'A','Ă'=>'A', 'Æ'=>'Ae',
39
'Ç'=>'C','Ć'=>'C','Č'=>'C','Ĉ'=>'C','Ċ'=>'C',
40
'Ď'=>'D','�?'=>'D','�?'=>'D',
41
'È'=>'E','É'=>'E','Ê'=>'E','Ë'=>'E','Ē'=>'E',
42
'Ę'=>'E','Ě'=>'E','Ĕ'=>'E','Ė'=>'E',
43
'Ĝ'=>'G','Ğ'=>'G','Ġ'=>'G','Ģ'=>'G',
44
'Ĥ'=>'H','Ħ'=>'H',
45
'Ì'=>'I','�?'=>'I','Î'=>'I','�?'=>'I','Ī'=>'I', 'Ĩ'=>'I','Ĭ'=>'I','Į'=>'I','İ'=>'I',
46
'IJ'=>'IJ','Ĵ'=>'J','Ķ'=>'K',
47
'�?'=>'K','Ľ'=>'K','Ĺ'=>'K','Ļ'=>'K','Ŀ'=>'K',
48
'Ñ'=>'N','Ń'=>'N','Ň'=>'N','Ņ'=>'N','Ŋ'=>'N',
49
'Ò'=>'O','Ó'=>'O','Ô'=>'O','Õ'=>'O','Ö'=>'Oe',
50
'&Ouml;'=>'Oe', 'Ø'=>'O','Ō'=>'O','�?'=>'O','Ŏ'=>'O',
51
'Œ'=>'OE', 'Ŕ'=>'R','Ř'=>'R','Ŗ'=>'R',
52
'Ś'=>'S','Š'=>'S','Ş'=>'S','Ŝ'=>'S','Ș'=>'S',
53
'Ť'=>'T','Ţ'=>'T','Ŧ'=>'T','Ț'=>'T',
54
'Ù'=>'U','Ú'=>'U','Û'=>'U','Ü'=>'Ue','Ū'=>'U',
55
'&Uuml;'=>'Ue', 'Ů'=>'U','Ű'=>'U','Ŭ'=>'U','Ũ'=>'U','Ų'=>'U',
56
'Ŵ'=>'W', '�?'=>'Y','Ŷ'=>'Y','Ÿ'=>'Y', 'Ź'=>'Z','Ž'=>'Z','Ż'=>'Z',
57
'Þ'=>'T','Þ'=>'T', 'à'=>'a','á'=>'a','â'=>'a','ã'=>'a','ä'=>'ae',
58
'&auml;'=>'ae', 'å'=>'a','�?'=>'a','ą'=>'a','ă'=>'a',
59
'æ'=>'ae', 'ç'=>'c','ć'=>'c','�?'=>'c','ĉ'=>'c','ċ'=>'c',
60
'�?'=>'d','đ'=>'d','ð'=>'d', 'è'=>'e','é'=>'e','ê'=>'e','ë'=>'e','ē'=>'e',
61
'Ä™'=>'e','Ä›'=>'e','Ä•'=>'e','Ä—'=>'e', 'Æ’'=>'f',
62
'�?'=>'g','ğ'=>'g','ġ'=>'g','ģ'=>'g', 'ĥ'=>'h','ħ'=>'h',
63
'ì'=>'i','í'=>'i','î'=>'i','ï'=>'i','ī'=>'i', 'ĩ'=>'i','ĭ'=>'i','į'=>'i','ı'=>'i',
64
'ij'=>'ij', 'ĵ'=>'j', 'ķ'=>'k','ĸ'=>'k', 'ł'=>'l','ľ'=>'l','ĺ'=>'l','ļ'=>'l','ŀ'=>'l',
65
'ñ'=>'n','ń'=>'n','ň'=>'n','ņ'=>'n','ʼn'=>'n', 'ŋ'=>'n',
66
'ò'=>'o','ó'=>'o','ô'=>'o','õ'=>'o','ö'=>'oe', '&ouml;'=>'oe',
67
'ø'=>'o','�?'=>'o','ő'=>'o','�?'=>'o', 'œ'=>'oe', 'ŕ'=>'r','ř'=>'r','ŗ'=>'r',
68
'š'=>'s', 'ù'=>'u','ú'=>'u','û'=>'u','ü'=>'ue','ū'=>'u', '&uuml;'=>'ue',
69
'ů'=>'u','ű'=>'u','ŭ'=>'u','ũ'=>'u','ų'=>'u', 'ŵ'=>'w',
70
'ý'=>'y','ÿ'=>'y','ŷ'=>'y', 'ž'=>'z','ż'=>'z','ź'=>'z', 'þ'=>'t', 'ß'=>'ss', 'ſ'=>'ss',
71
'ä'=>'ae', 'ö'=>'oe', 'ü'=>'ue', 'Ä'=>'Ae', 'Ö'=>'Oe', 'Ü'=>'Ue'
36

  
37
//### LATIN
38
'&Aacute;'=>'A','&aacute;'=>'a','&Acirc;'=>'A','&acirc;'=>'a','&AElig;'=>'AE','&aelig;'=>'ae','&Agrave;'=>'A','&agrave;'=>'a','&Aring;'=>'A','&aring;'=>'a','&Atilde;'=>'A','&atilde;'=>'a','&Auml;'=>'AE','&auml;'=>'ae',
39
'&Ccedil;'=>'C','&ccedil;'=>'c',
40
'&Eacute;'=>'E','&eacute;'=>'e','&Ecirc;'=>'E','&ecirc;'=>'e','&Egrave;'=>'E','&egrave;'=>'e','&Euml;'=>'E','&euml;'=>'e',
41
'&Iacute;'=>'I','&iacute;'=>'i','&Icirc;'=>'I','&icirc;'=>'i','&Igrave;'=>'I','&igrave;'=>'i','&Iuml;'=>'I','&iuml;'=>'i',
42
'&Ntilde;'=>'N','&ntilde;'=>'n',
43
'&Oacute;'=>'O','&oacute;'=>'o','&Ocirc;'=>'O','&ocirc;'=>'o','&OElig;'=>'OE','&oelig;'=>'oe','&Ograve;'=>'O','&ograve;'=>'o','&Otilde;'=>'O','&otilde;'=>'o','&Ouml;'=>'OE','&ouml;'=>'oe',
44
'&Scaron;'=>'S','&scaron;'=>'s',
45
'&szlig;'=>'ss',
46
'&Uacute;'=>'U','&uacute;'=>'u','&Ucirc;'=>'U','&ucirc;'=>'u','&Ugrave;'=>'U','&ugrave;'=>'u','&Uuml;'=>'UE','&uuml;'=>'ue',
47
'&Yacute;'=>'Y','&yacute;'=>'y','&Yuml;'=>'Y','&yuml;'=>'y',
48
'&#138;'=>'S',
49
'&#140;'=>'OE','&#156;'=>'oe',
50
'&#154;'=>'s',
51
'&#159;'=>'Y',
52
'&copy;'=>'(c)','&reg;'=>'(r)','&ETH;'=>'D','&times;'=>'x','&Oslash;'=>'O','&THORN;'=>'TH','&eth;'=>'d','&oslash;'=>'o','&thorn;'=>'th',
53

  
54
// latin extended-A
55
'&#256;'=>'A','&#257;'=>'a','&#258;'=>'A','&#259;'=>'a','&#260;'=>'A','&#261;'=>'a',
56
'&#262;'=>'C','&#263;'=>'c','&#264;'=>'C','&#265;'=>'c','&#269;'=>'c','&#268;'=>'C','&#267;'=>'c','&#266;'=>'C',
57
'&#273;'=>'d','&#272;'=>'D','&#271;'=>'d','&#270;'=>'D',
58
'&#275;'=>'e','&#274;'=>'E','&#276;'=>'E','&#277;'=>'e','&#278;'=>'E','&#279;'=>'e','&#280;'=>'E','&#281;'=>'e','&#282;'=>'E','&#283;'=>'e',
59
'&#284;'=>'G','&#285;'=>'g','&#286;'=>'G','&#287;'=>'g','&#288;'=>'G','&#289;'=>'g','&#290;'=>'G','&#291;'=>'g',
60
'&#292;'=>'H','&#293;'=>'h','&#294;'=>'H','&#295;'=>'h',
61
'&#296;'=>'I','&#297;'=>'i','&#298;'=>'I','&#299;'=>'i','&#300;'=>'I','&#301;'=>'i','&#302;'=>'I','&#303;'=>'i','&#304;'=>'I','&#305;'=>'i',
62
'&#306;'=>'IJ','&#307;'=>'ij',
63
'&#308;'=>'J','&#309;'=>'j',
64
'&#310;'=>'K','&#311;'=>'k','&#312;'=>'k',
65
'&#313;'=>'L','&#314;'=>'l','&#315;'=>'L','&#316;'=>'l','&#317;'=>'L','&#318;'=>'l','&#319;'=>'L','&#320;'=>'l','&#321;'=>'L','&#322;'=>'l',
66
'&#323;'=>'N','&#324;'=>'n','&#325;'=>'N','&#326;'=>'n','&#327;'=>'N','&#328;'=>'n','&#329;'=>'n','&#330;'=>'N','&#331;'=>'n',
67
'&#332;'=>'O','&#333;'=>'o','&#334;'=>'O','&#335;'=>'o','&#336;'=>'O','&#337;'=>'o',
68
'&#340;'=>'R','&#341;'=>'r','&#342;'=>'R','&#343;'=>'r','&#344;'=>'R','&#345;'=>'r',
69
'&#346;'=>'S','&#347;'=>'s','&#348;'=>'S','&#349;'=>'s','&#350;'=>'S','&#351;'=>'s',
70
'&#354;'=>'T','&#355;'=>'t','&#356;'=>'T','&#357;'=>'t','&#358;'=>'T','&#359;'=>'t',
71
'&#360;'=>'U','&#361;'=>'u','&#362;'=>'U','&#363;'=>'u','&#364;'=>'U','&#365;'=>'u','&#366;'=>'U','&#367;'=>'u','&#368;'=>'U','&#369;'=>'u','&#370;'=>'U','&#371;'=>'u',
72
'&#372;'=>'W','&#373;'=>'w',
73
'&#374;'=>'Y','&#375;'=>'y','&#376;'=>'Y',
74
'&#377;'=>'Z','&#378;'=>'z','&#379;'=>'Z','&#380;'=>'z','&#381;'=>'Z','&#382;'=>'z',
75
'&#383;'=>'s',
76
'&#64256;'=>'ff','&#64257;'=>'fi','&#64258;'=>'fl','&#64259;'=>'ffi','&#64260;'=>'ffl',
77
'&#64261;'=>'st',
78
'&#64262;'=>'st',
79
// latin extended-b
80
'&#384;'=>'b','&#385;'=>'B','&#386;'=>'B','&#387;'=>'b','&#388;'=>'6','&#389;'=>'6',
81
'&#390;'=>'O','&#391;'=>'C','&#392;'=>'c','&#393;'=>'D','&#394;'=>'D','&#395;'=>'D',
82
'&#396;'=>'d','&#397;'=>'d','&#398;'=>'E','&#399;'=>'e','&#400;'=>'E','&#401;'=>'F',
83
'&fnof;'=>'f','&#403;'=>'G','&#404;'=>'G','&#405;'=>'hw','&#406;'=>'I','&#407;'=>'I',
84
'&#408;'=>'K','&#409;'=>'k','&#410;'=>'l','&#411;'=>'l','&#412;'=>'M','&#413;'=>'N',
85
'&#414;'=>'n','&#415;'=>'O','&#416;'=>'O','&#417;'=>'o','&#418;'=>'OI','&#419;'=>'oi',
86
'&#420;'=>'P','&#421;'=>'p','&#422;'=>'YR','&#423;'=>'2','&#424;'=>'2','&#425;'=>'ESH',
87
'&#426;'=>'esh','&#427;'=>'t','&#428;'=>'T','&#429;'=>'t','&#430;'=>'T','&#431;'=>'U',
88
'&#432;'=>'u','&#433;'=>'V','&#434;'=>'v','&#435;'=>'Y','&#436;'=>'y','&#437;'=>'Z',
89
'&#438;'=>'z','&#439;'=>'EZH','&#440;'=>'EZH','&#441;'=>'ezh','&#442;'=>'ezh','&#443;'=>'2',
90
'&#444;'=>'5','&#445;'=>'5','&#446;'=>'-','&#447;'=>'w','&#448;'=>'-','&#449;'=>'-',
91
'&#450;'=>'-','&#451;'=>'-','&#452;'=>'DZ','&#453;'=>'DZ','&#454;'=>'dz','&#455;'=>'LJ',
92
'&#456;'=>'Lj','&#457;'=>'lj','&#458;'=>'NJ','&#459;'=>'Nj','&#460;'=>'nj','&#461;'=>'A',
93
'&#462;'=>'a','&#463;'=>'I','&#464;'=>'i','&#465;'=>'O','&#466;'=>'o','&#467;'=>'U',
94
'&#468;'=>'u','&#469;'=>'U','&#470;'=>'u','&#471;'=>'U','&#472;'=>'u','&#473;'=>'U',
95
'&#474;'=>'u','&#475;'=>'U','&#476;'=>'u','&#477;'=>'e','&#478;'=>'A','&#479;'=>'a',
96
'&#480;'=>'A','&#481;'=>'a','&#482;'=>'AE','&#483;'=>'ae','&#484;'=>'G','&#485;'=>'g',
97
'&#486;'=>'G','&#487;'=>'g','&#488;'=>'K','&#489;'=>'k','&#490;'=>'O','&#491;'=>'o',
98
'&#492;'=>'O','&#493;'=>'o','&#494;'=>'EZH','&#495;'=>'ezh','&#496;'=>'j','&#497;'=>'DZ',
99
'&#498;'=>'Dz','&#499;'=>'dz','&#500;'=>'G','&#501;'=>'g','&#502;'=>'HW','&#503;'=>'W',
100
'&#504;'=>'N','&#505;'=>'n','&#506;'=>'A','&#507;'=>'a','&#508;'=>'AE','&#509;'=>'ae',
101
'&#510;'=>'O','&#511;'=>'o','&#512;'=>'A','&#513;'=>'a','&#514;'=>'A','&#515;'=>'a',
102
'&#516;'=>'E','&#517;'=>'e','&#518;'=>'E','&#519;'=>'e','&#520;'=>'I','&#521;'=>'i',
103
'&#522;'=>'I','&#523;'=>'i','&#524;'=>'O','&#525;'=>'o','&#526;'=>'O','&#527;'=>'o',
104
'&#528;'=>'R','&#529;'=>'r','&#530;'=>'R','&#531;'=>'r','&#532;'=>'U','&#533;'=>'u',
105
'&#534;'=>'U','&#535;'=>'u','&#536;'=>'S','&#537;'=>'s','&#538;'=>'T','&#539;'=>'t',
106
'&#540;'=>'Y','&#541;'=>'y','&#542;'=>'H','&#543;'=>'h','&#544;'=>'n','&#545;'=>'d',
107
'&#546;'=>'OU','&#547;'=>'ou','&#548;'=>'Z','&#549;'=>'z','&#550;'=>'A','&#551;'=>'a',
108
'&#552;'=>'E','&#553;'=>'e','&#554;'=>'O','&#555;'=>'o','&#556;'=>'O','&#557;'=>'o',
109
'&#558;'=>'O','&#559;'=>'o','&#560;'=>'O','&#561;'=>'o','&#562;'=>'Y','&#563;'=>'y',
110
'&#564;'=>'l','&#565;'=>'n','&#566;'=>'t','&#567;'=>'j','&#568;'=>'db','&#569;'=>'qp',
111
'&#570;'=>'A','&#571;'=>'C','&#572;'=>'c','&#573;'=>'L','&#574;'=>'T','&#575;'=>'s',
112
'&#576;'=>'z','&#577;'=>'-',
113
// latin extended additional
114
'&#7680;'=>'A','&#7681;'=>'a',
115
'&#7682;'=>'B','&#7683;'=>'b','&#7684;'=>'B','&#7685;'=>'b','&#7686;'=>'B','&#7687;'=>'b',
116
'&#7688;'=>'C','&#7689;'=>'c',
117
'&#7690;'=>'D','&#7691;'=>'d','&#7692;'=>'D','&#7693;'=>'d','&#7694;'=>'D','&#7695;'=>'d','&#7696;'=>'D','&#7697;'=>'d','&#7698;'=>'D','&#7699;'=>'d',
118
'&#7700;'=>'E','&#7701;'=>'e','&#7702;'=>'E','&#7703;'=>'e','&#7704;'=>'E','&#7705;'=>'e','&#7706;'=>'E','&#7707;'=>'e','&#7708;'=>'E','&#7709;'=>'e',
119
'&#7710;'=>'F','&#7711;'=>'f',
120
'&#7712;'=>'G','&#7713;'=>'g',
121
'&#7714;'=>'H','&#7715;'=>'h','&#7716;'=>'H','&#7717;'=>'h','&#7718;'=>'H','&#7719;'=>'h','&#7720;'=>'H','&#7721;'=>'h','&#7722;'=>'H','&#7723;'=>'h',
122
'&#7724;'=>'I','&#7725;'=>'i','&#7726;'=>'I','&#7727;'=>'i',
123
'&#7728;'=>'K','&#7729;'=>'k','&#7730;'=>'K','&#7731;'=>'k','&#7732;'=>'K','&#7733;'=>'k',
124
'&#7734;'=>'L','&#7735;'=>'l','&#7736;'=>'L','&#7737;'=>'l','&#7738;'=>'L','&#7739;'=>'l','&#7740;'=>'L','&#7741;'=>'l',
125
'&#7742;'=>'M','&#7743;'=>'m','&#7744;'=>'M','&#7745;'=>'m','&#7746;'=>'M','&#7747;'=>'m',
126
'&#7748;'=>'N','&#7749;'=>'n','&#7750;'=>'N','&#7751;'=>'n','&#7752;'=>'N','&#7753;'=>'n','&#7754;'=>'N','&#7755;'=>'n',
127
'&#7756;'=>'O','&#7757;'=>'o','&#7758;'=>'O','&#7759;'=>'o','&#7760;'=>'O','&#7761;'=>'o','&#7762;'=>'O','&#7763;'=>'o',
128
'&#7764;'=>'P','&#7765;'=>'p','&#7766;'=>'P','&#7767;'=>'p',
129
'&#7768;'=>'R','&#7769;'=>'r','&#7770;'=>'R','&#7771;'=>'r','&#7772;'=>'R','&#7773;'=>'r','&#7774;'=>'R','&#7775;'=>'r',
130
'&#7776;'=>'S','&#7777;'=>'s','&#7778;'=>'S','&#7779;'=>'s','&#7780;'=>'S','&#7781;'=>'s','&#7782;'=>'S','&#7783;'=>'s','&#7784;'=>'S','&#7785;'=>'s',
131
'&#7786;'=>'T','&#7787;'=>'t','&#7788;'=>'T','&#7789;'=>'t','&#7790;'=>'T','&#7791;'=>'t','&#7792;'=>'T','&#7793;'=>'t',
132
'&#7794;'=>'U','&#7795;'=>'u','&#7796;'=>'U','&#7797;'=>'u','&#7798;'=>'U','&#7799;'=>'u','&#7800;'=>'U','&#7801;'=>'u','&#7802;'=>'U','&#7803;'=>'u',
133
'&#7804;'=>'V','&#7805;'=>'v','&#7806;'=>'V','&#7807;'=>'v',
134
'&#7808;'=>'W','&#7809;'=>'w','&#7810;'=>'W','&#7811;'=>'w','&#7812;'=>'W','&#7813;'=>'w','&#7814;'=>'W','&#7815;'=>'w','&#7816;'=>'W','&#7817;'=>'w',
135
'&#7818;'=>'X','&#7819;'=>'x','&#7820;'=>'X','&#7821;'=>'x',
136
'&#7822;'=>'Y','&#7823;'=>'y',
137
'&#7824;'=>'Z','&#7825;'=>'z','&#7826;'=>'Z','&#7827;'=>'z','&#7828;'=>'Z','&#7829;'=>'z',
138
'&#7830;'=>'h',
139
'&#7831;'=>'t',
140
'&#7832;'=>'w',
141
'&#7833;'=>'y',
142
'&#7834;'=>'a',
143
'&#7835;'=>'f',
144
'&#7840;'=>'A','&#7841;'=>'a','&#7842;'=>'A','&#7843;'=>'a','&#7844;'=>'A','&#7845;'=>'a','&#7846;'=>'A','&#7847;'=>'a','&#7848;'=>'A','&#7849;'=>'a',
145
'&#7850;'=>'A','&#7851;'=>'a','&#7852;'=>'A','&#7853;'=>'a','&#7854;'=>'A','&#7855;'=>'a','&#7856;'=>'A','&#7857;'=>'a','&#7858;'=>'A','&#7859;'=>'a','&#7860;'=>'A','&#7861;'=>'a','&#7862;'=>'A','&#7863;'=>'a',
146
'&#7864;'=>'E','&#7865;'=>'e','&#7866;'=>'E','&#7867;'=>'e','&#7868;'=>'E','&#7869;'=>'e','&#7870;'=>'E','&#7871;'=>'e','&#7872;'=>'E','&#7873;'=>'e','&#7874;'=>'E','&#7875;'=>'e','&#7876;'=>'E','&#7877;'=>'e','&#7878;'=>'E','&#7879;'=>'e',
147
'&#7880;'=>'I','&#7881;'=>'i','&#7882;'=>'I','&#7883;'=>'i',
148
'&#7884;'=>'O','&#7885;'=>'o','&#7886;'=>'O','&#7887;'=>'o','&#7888;'=>'O','&#7889;'=>'o','&#7890;'=>'O','&#7891;'=>'o','&#7892;'=>'O','&#7893;'=>'o','&#7894;'=>'O','&#7895;'=>'o',
149
'&#7896;'=>'O','&#7897;'=>'o','&#7898;'=>'O','&#7899;'=>'o','&#7900;'=>'O','&#7901;'=>'o','&#7902;'=>'O','&#7903;'=>'o','&#7904;'=>'O','&#7905;'=>'o','&#7906;'=>'O','&#7907;'=>'o',
150
'&#7908;'=>'U','&#7909;'=>'u','&#7910;'=>'U','&#7911;'=>'u','&#7912;'=>'U','&#7913;'=>'u','&#7914;'=>'U','&#7915;'=>'u','&#7916;'=>'U','&#7917;'=>'u','&#7918;'=>'U','&#7919;'=>'u','&#7920;'=>'U','&#7921;'=>'u',
151
'&#7922;'=>'Y','&#7923;'=>'y','&#7924;'=>'Y','&#7925;'=>'y','&#7926;'=>'Y','&#7927;'=>'y','&#7928;'=>'Y','&#7929;'=>'y',
152

  
153
//### CYRILLIC (transliteration following iso 9:1995)
154
'&#1040;'=>'A','&#1072;'=>'a', // A
155
'&#1232;'=>'A','&#1233;'=>'a', // A WITH BREVE
156
'&#1234;'=>'A','&#1235;'=>'a', // A WITH DIAERESIS
157
'&#1236;'=>'A','&#1237;'=>'a', // LIGATURE A IE
158
'&#1240;'=>'A','&#1241;'=>'a', // SCHWA
159
'&#1242;'=>'A','&#1243;'=>'a', // SCHWA WITH DIAERESIS
160
'&#1041;'=>'B','&#1073;'=>'b', // BE
161
'&#1042;'=>'V','&#1074;'=>'v', // VE
162
'&#1043;'=>'G','&#1075;'=>'g', // GHE
163
'&#1168;'=>'G','&#1169;'=>'g', // GHE WITH UPTURN
164
'&#1172;'=>'G','&#1173;'=>'g', // GHE WITH MIDDLE HOOK
165
'&#1170;'=>'G','&#1171;'=>'g', // GHE WITH STROKE
166
'&#1270;'=>'G','&#1271;'=>'g', // GHE WITH DESCENDER
167
'&#1044;'=>'D','&#1076;'=>'d', // DE
168
'&#1026;'=>'D','&#1106;'=>'d', // DJE
169
'&#1027;'=>'G','&#1107;'=>'g', // GJE
170
'&#1024;'=>'E','&#1104;'=>'e', // IE WITH GRAVE
171
'&#1045;'=>'E','&#1077;'=>'e', // IE
172
'&#1025;'=>'E','&#1105;'=>'e', // IO
173
'&#1238;'=>'E','&#1239;'=>'e', // IE WITH BREVE
174
'&#1028;'=>'E','&#1108;'=>'e', // UKRAINIAN IE
175
'&#1212;'=>'C','&#1213;'=>'c', // ABKHASIAN CHE
176
'&#1214;'=>'C','&#1215;'=>'c', // ABKHASIAN CHE WITH DESCENDER
177
'&#1046;'=>'Z','&#1078;'=>'z', // ZHE
178
'&#1217;'=>'Z','&#1218;'=>'z', // ZHE WITH BREVE
179
'&#1244;'=>'Z','&#1245;'=>'z', // ZHE WITH DIAERESIS
180
'&#1174;'=>'Z','&#1175;'=>'z', // ZHE WITH DESCENDER
181
'&#1047;'=>'Z','&#1079;'=>'z', // ZE
182
'&#1246;'=>'Z','&#1247;'=>'z', // ZE WITH DIAERESIS
183
'&#1029;'=>'Z','&#1109;'=>'z', // DZE
184
'&#1248;'=>'Z','&#1249;'=>'z', // ABKHASIAN DZE
185
'&#1037;'=>'I','&#1117;'=>'i', // I WITH GRAVE
186
'&#1048;'=>'I','&#1080;'=>'i', // I
187
'&#1250;'=>'I','&#1251;'=>'i', // I WITH MACRON
188
'&#1252;'=>'I','&#1253;'=>'i', // I WITH DIAERESIS
189
'&#1030;'=>'I','&#1110;'=>'i', // BYELORUSSIAN-UKRAINIAN I
190
'&#1031;'=>'I','&#1111;'=>'i', // YI
191
'&#1049;'=>'J','&#1081;'=>'j', // SHORT I
192
'&#1032;'=>'J','&#1112;'=>'j', // JE
193
'&#1050;'=>'K','&#1082;'=>'k', // KA
194
'&#1178;'=>'K','&#1179;'=>'k', // KA WITH DESCENDER
195
'&#1180;'=>'K','&#1181;'=>'k', // KA WITH VERTICAL STROKE
196
'&#1182;'=>'K','&#1183;'=>'k', // KA WITH STROKE
197
'&#1184;'=>'K','&#1185;'=>'k', // BASHKIR KA
198
'&#1051;'=>'L','&#1083;'=>'l', // EL
199
'&#1033;'=>'L','&#1113;'=>'l', // LJE
200
'&#1052;'=>'M','&#1084;'=>'m', // EM
201
'&#1053;'=>'N','&#1085;'=>'n', // EN
202
'&#1034;'=>'N','&#1114;'=>'n', // NJE
203
'&#1188;'=>'N','&#1189;'=>'n', // LIGATURE EN GHE
204
'&#1186;'=>'N','&#1187;'=>'n', // EN WITH DESCENDER
205
'&#1054;'=>'O','&#1086;'=>'o', // O
206
'&#1254;'=>'O','&#1255;'=>'o', // O WITH DIAERESIS
207
'&#1256;'=>'O','&#1257;'=>'o', // BARRED O
208
'&#1258;'=>'O','&#1259;'=>'o', // BARRED O WITH DIAERESIS
209
'&#1055;'=>'P','&#1087;'=>'p', // PE
210
'&#1190;'=>'P','&#1191;'=>'p', // PE WITH MIDDLE HOOK
211
'&#1056;'=>'R','&#1088;'=>'r', // ER
212
'&#1057;'=>'S','&#1089;'=>'s', // ES
213
'&#1194;'=>'C','&#1195;'=>'c', // ES WITH DESCENDER
214
'&#1058;'=>'T','&#1090;'=>'t', // TE
215
'&#1196;'=>'T','&#1197;'=>'t', // TE WITH DESCENDER
216
'&#1035;'=>'C','&#1115;'=>'c', // TSHE
217
'&#1036;'=>'K','&#1116;'=>'k', // KJE
218
'&#1059;'=>'U','&#1091;'=>'u', // U
219
'&#1038;'=>'U','&#1118;'=>'u', // SHORT U
220
'&#1262;'=>'U','&#1263;'=>'u', // U WITH MACRON
221
'&#1264;'=>'U','&#1265;'=>'u', // U WITH DIAERESIS
222
'&#1266;'=>'U','&#1267;'=>'u', // U WITH DOUBLE ACUTE
223
'&#1198;'=>'U','&#1199;'=>'u', // STRAIGHT U
224
'&#1200;'=>'U','&#1201;'=>'u', // STRAIGHT U WITH STROKE
225
'&#1060;'=>'F','&#1092;'=>'f', // EF
226
'&#1061;'=>'H','&#1093;'=>'h', // HA
227
'&#1202;'=>'H','&#1203;'=>'h', // HA WITH DESCENDER
228
'&#1210;'=>'H','&#1211;'=>'h', // SHHA
229
'&#1062;'=>'C','&#1094;'=>'c', // TSE
230
'&#1204;'=>'C','&#1205;'=>'c', // LIGATURE TE TSE
231
'&#1063;'=>'C','&#1095;'=>'c', // CHE
232
'&#1268;'=>'C','&#1269;'=>'c', // CHE WITH DIAERESIS
233
'&#1206;'=>'C','&#1207;'=>'c', // CHE WITH DESCENDER
234
'&#1208;'=>'C','&#1209;'=>'c', // CHE WITH VERTICAL STROKE
235
'&#1039;'=>'D','&#1119;'=>'d', // DZHE
236
'&#1064;'=>'S','&#1096;'=>'s', // SHA
237
'&#1065;'=>'S','&#1097;'=>'s', // SHCHA
238
'&#1067;'=>'Y','&#1099;'=>'y', // YERU
239
'&#1272;'=>'Y','&#1273;'=>'y', // YERU WITH DIAERESIS
240
'&#1069;'=>'E','&#1101;'=>'e', // E
241
'&#1260;'=>'E','&#1261;'=>'e', // E WITH DIAERESIS
242
'&#1070;'=>'U','&#1102;'=>'u', // YU
243
'&#1071;'=>'A','&#1103;'=>'a', // YA
244
'&#1122;'=>'E','&#1123;'=>'e', // YAT
245
'&#1130;'=>'A','&#1131;'=>'a', // BIG YUS
246
'&#1138;'=>'F','&#1139;'=>'f', // FITA
247
'&#1140;'=>'Y','&#1141;'=>'y', // IZHITSA
248
'&#1142;'=>'Y','&#1143;'=>'y', // IZHITSA WITH DOUBLE GRAVE ACCENT
249
'&#1192;'=>'O','&#1193;'=>'o', // ABKHASIAN HA
250
'&#1120;'=>'O','&#1121;'=>'o', // OMEGA
251
'&#1124;'=>'E','&#1125;'=>'e', // IOTIFIED E
252
'&#1126;'=>'U','&#1127;'=>'u', // LITTLE YUS (???)
253
'&#1128;'=>'U','&#1129;'=>'u', // IOTIFIED LITTLE YUS (???)
254
'&#1132;'=>'U','&#1133;'=>'u', // IOTIFIED BIG YUS (???)
255
'&#1134;'=>'K','&#1135;'=>'k', // KSI (???)
256
'&#1136;'=>'P','&#1137;'=>'p', // PSI (???)
257
'&#1144;'=>'U','&#1145;'=>'u', // UK
258
'&#1146;'=>'O','&#1147;'=>'o', // ROUND OMEGA (???)
259
'&#1148;'=>'O','&#1149;'=>'o', // OMEGA WITH TITLO (???)
260
'&#1150;'=>'O','&#1151;'=>'o', // OT (???)
261
'&#1152;'=>'K','&#1153;'=>'k', // KOPPA (???)
262
'&#1162;'=>'J','&#1163;'=>'j', // SHORT I WITH TAIL
263
'&#1166;'=>'R','&#1166;'=>'r', // ER WITH TICK
264
'&#1176;'=>'Z','&#1177;'=>'z', // ZE WITH DESCENDER
265
'&#1219;'=>'K','&#1220;'=>'k', // KA WITH HOOK
266
'&#1221;'=>'L','&#1222;'=>'l', // EL WITH TAIL
267
'&#1223;'=>'N','&#1224;'=>'n', // EN WITH HOOK
268
'&#1225;'=>'N','&#1226;'=>'n', // EN WITH TAIL
269
'&#1227;'=>'C','&#1228;'=>'c', // KHAKASSIAN CHE
270
'&#1229;'=>'M','&#1230;'=>'m', // EM WITH TAIL
271
// specialchars
272
'&#1098;'=>'-','&#1066;'=>'-', // HARD SIGN
273
'&#1068;'=>'-','&#1100;'=>'-', // SOFT SIGN
274
'&#1164;'=>'-', // SEMISOFT SIGN
275
'&#1216;'=>'-', // PALOCHKA
276
'&#769;'=>'',
277

  
278
//### (new) GREEK (transcription following wikipedia: http://de.wikipedia.org/w/index.php?title=Wikipedia:Namenskonventionen/Neugriechisch&oldid=29601735 )
279
// groups of two chars
280
'&alpha;&iota;'=>'e','&Alpha;&iota;'=>'E',
281
'&epsilon;&iota;'=>'i','&Epsilon;&iota;'=>'I',
282
'&omicron;&iota;'=>'i','&Omicron;&iota;'=>'I',
283
'&omicron;&upsilon;'=>'ou','&Omicron;&upsilon;'=>'Ou',
284
'&alpha;&upsilon;'=>'av','&Alpha;&upsilon;'=>'Av',
285
'&epsilon;&upsilon;'=>'ev','&Epsilon;&upsilon;'=>'Ev',
286
'&eta;&upsilon;'=>'iv','&Eta;&upsilon;'=>'Iv',
287
'&mu;&pi;'=>'mp','&Mu;&pi;'=>'B',
288
'&nu;&tau;'=>'nt','&Nu;&tau;'=>'D',
289
'&tau;&zeta;'=>'tz','&Tau;&zeta;'=>'Tz',
290
'&gamma;&kappa;'=>'ng','&Gamma;&kappa;'=>'G',
291
'&gamma;&gamma;'=>'ng','&Gamma;&gamma;'=>'Ng',
292
// single chars
293
'&#902;'=>'A','&#904;'=>'E','&#905;'=>'I','&#906;'=>'I','&#908;'=>'O','&#910;'=>'Y','&#911;'=>'O','&#912;'=>'i',
294
'&Alpha;'=>'A','&Beta;'=>'V','&Gamma;'=>'G','&Delta;'=>'D','&Epsilon;'=>'E','&Zeta;'=>'Z','&Eta;'=>'I','&Theta;'=>'Th','&Iota;'=>'I','&Kappa;'=>'K','&Lambda;'=>'L','&Mu;'=>'M','&Nu;'=>'N','&Xi;'=>'X','&Omicron;'=>'O','&Pi;'=>'P','&Rho;'=>'R','&Sigma;'=>'S','&Tau;'=>'T','&Upsilon;'=>'Y','&Phi;'=>'F','&Chi;'=>'Ch','&Psi;'=>'Ps','&Omega;'=>'O',
295
'&#938;'=>'I','&#939;'=>'Y','&#940;'=>'a','&#941;'=>'e','&#942;'=>'i','&#943;'=>'i','&#944;'=>'y',
296
'&alpha;'=>'a','&beta;'=>'v','&gamma;'=>'g','&delta;'=>'d','&epsilon;'=>'e','&zeta;'=>'z','&eta;'=>'i','&theta;'=>'th','&iota;'=>'i','&kappa;'=>'k','&lambda;'=>'l','&mu;'=>'m','&nu;'=>'n','&xi;'=>'x','&omicron;'=>'o','&pi;'=>'p','&rho;'=>'r','&sigmaf;'=>'s','&sigma;'=>'s','&tau;'=>'t','&upsilon;'=>'y','&phi;'=>'f','&chi;'=>'ch','&psi;'=>'ps','&omega;'=>'o',
297
'&#970;'=>'i','&#971;'=>'y','&#972;'=>'o','&#973;'=>'y','&#974;'=>'o','&#976;'=>'b','&thetasym;'=>'th','&upsih;'=>'y','&#979;'=>'y','&#980;'=>'y'
298

  
72 299
);
73 300

  
74 301
?>
branches/2.6.x/wb/framework/class.frontend.php
1
<?php
2

  
3
// $Id$
4

  
5
/*
6

  
7
 Website Baker Project <http://www.websitebaker.org/>
8
 Copyright (C) 2004-2007, Ryan Djurovich
9

  
10
 Website Baker is free software; you can redistribute it and/or modify
11
 it under the terms of the GNU General Public License as published by
12
 the Free Software Foundation; either version 2 of the License, or
13
 (at your option) any later version.
14

  
15
 Website Baker is distributed in the hope that it will be useful,
16
 but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 GNU General Public License for more details.
19

  
20
 You should have received a copy of the GNU General Public License
21
 along with Website Baker; if not, write to the Free Software
22
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23

  
24
*/
25

  
26
/*
27

  
28
Frontend class
29

  
30
*/
31

  
32
if(!defined('WB_PATH')) {
33
	header('Location: ../index.php');
34
	exit(0);
35
}
36

  
37

  
38
require_once(WB_PATH.'/framework/class.wb.php');
39

  
40
class frontend extends wb {
41
	// defaults
42
	var $default_link,$default_page_id;
43
	// when multiple blocks are used, show home page blocks on 
44
	// pages where no content is defined (search, login, ...)
45
	var $default_block_content=true;
46

  
47
	// page details
48
	// page database row
49
	var $page;
50
	var $page_id,$page_title,$menu_title,$parent,$root_parent,$level,$visibility;
51
	var $page_description,$page_keywords,$page_link;
52
	var $page_trail=array();
53
	
54
	var $page_access_denied;
55
	
56
	// website settings
57
	var $website_title,$website_description,$website_keywords,$website_header,$website_footer;
58

  
59
	// ugly database stuff
60
	var $extra_where_sql, $sql_where_language;
61

  
62
	function page_select() {
63
		global $page_id,$no_intro;
64
		global $database;
65
		// We have no page id and are supposed to show the intro page
66
		if((INTRO_PAGE AND !isset($no_intro)) AND (!isset($page_id) OR !is_numeric($page_id))) {
67
			// Since we have no page id check if we should go to intro page or default page
68
			// Get intro page content
69
			$filename = WB_PATH.PAGES_DIRECTORY.'/intro.php';
70
			if(file_exists($filename)) {
71
				$handle = fopen($filename, "r");
72
				$content = fread($handle, filesize($filename));
73
				fclose($handle);
74
				$this->preprocess($content);
75
				echo ($content);
76
				return false;
77
			}
78
		}
79
		// Check if we should add page language sql code
80
		if(PAGE_LANGUAGES) {
81
			$this->sql_where_language = " AND language = '".LANGUAGE."'";
82
		}
83
		// Get default page
84
		// Check for a page id
85
		$query_default = "SELECT page_id,link FROM ".TABLE_PREFIX."pages WHERE parent = '0' AND visibility = 'public'$this->sql_where_language ORDER BY position ASC LIMIT 1";
86
		$get_default = $database->query($query_default);
87
		$default_num_rows = $get_default->numRows();
88
		if(!isset($page_id) OR !is_numeric($page_id)){
89
			// Go to or show default page
90
			if($default_num_rows > 0) {
91
				$fetch_default = $get_default->fetchRow();
92
				$this->default_link = $fetch_default['link'];
93
				$this->default_page_id = $fetch_default['page_id'];
94
				// Check if we should redirect or include page inline
95
				if(HOMEPAGE_REDIRECTION) {
96
					// Redirect to page
97
					header("Location: ".$this->page_link($this->default_link));
98
					exit();
99
				} else {
100
					// Include page inline
101
					$this->page_id = $this->default_page_id;
102
				}
103
			} else {
104
		   		// No pages have been added, so print under construction page
105
				$this->print_under_construction();
106
				exit();
107
			}
108
		} else {
109
			$this->page_id=$page_id;
110
		}
111
		// Get default page link
112
		if(!isset($fetch_default)) {
113
		  	$fetch_default = $get_default->fetchRow();
114
	 		$this->default_link = $fetch_default['link'];
115
			$this->default_page_id = $fetch_default['page_id'];
116
		}
117
		return true;
118
	}
119

  
120
	function get_page_details() {
121
		global $database;
122
	    if($this->page_id != 0) {
123
			// Query page details
124
			$query_page = "SELECT * FROM ".TABLE_PREFIX."pages WHERE page_id = '{$this->page_id}'";
125
			$get_page = $database->query($query_page);
126
			// Make sure page was found in database
127
			if($get_page->numRows() == 0) {
128
				// Print page not found message
129
				exit("Page not found");
130
			}
131
			// Fetch page details
132
			$this->page = $get_page->fetchRow();
133
			// Check if the page language is also the selected language. If not, send headers again.
134
			if ($this->page['language']!=LANGUAGE) {
135
				header('Location: '.$this->page_link($this->page['link']).'?lang='.$this->page['language']);
136
				exit();
137
			}
138
			// Begin code to set details as either variables of constants
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff