Revision 452
Added by Matthias over 17 years ago
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', 'Ä'=>'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 |
'Ö'=>'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 |
'Ü'=>'Ue', 'Å®'=>'U','Å°'=>'U','Ŭ'=>'U','Ũ'=>'U','Ų'=>'U', |
|
56 |
'Ŵ'=>'W', '�?'=>'Y','Ŷ'=>'Y','Ÿ'=>'Y', 'Ź'=>'Z','Ž'=>'Z','Ż'=>'Z', |
|
57 |
'Þ'=>'T','Þ'=>'T', 'à '=>'a','á'=>'a','â'=>'a','ã'=>'a','ä'=>'ae', |
|
58 |
'ä'=>'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', 'ö'=>'oe', |
|
67 |
'ø'=>'o','�?'=>'o','ő'=>'o','�?'=>'o', 'œ'=>'oe', 'ŕ'=>'r','ř'=>'r','ŗ'=>'r', |
|
68 |
'Å¡'=>'s', 'ù'=>'u','ú'=>'u','û'=>'u','ü'=>'ue','Å«'=>'u', 'ü'=>'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 |
'Á'=>'A','á'=>'a','Â'=>'A','â'=>'a','Æ'=>'AE','æ'=>'ae','À'=>'A','à'=>'a','Å'=>'A','å'=>'a','Ã'=>'A','ã'=>'a','Ä'=>'AE','ä'=>'ae', |
|
39 |
'Ç'=>'C','ç'=>'c', |
|
40 |
'É'=>'E','é'=>'e','Ê'=>'E','ê'=>'e','È'=>'E','è'=>'e','Ë'=>'E','ë'=>'e', |
|
41 |
'Í'=>'I','í'=>'i','Î'=>'I','î'=>'i','Ì'=>'I','ì'=>'i','Ï'=>'I','ï'=>'i', |
|
42 |
'Ñ'=>'N','ñ'=>'n', |
|
43 |
'Ó'=>'O','ó'=>'o','Ô'=>'O','ô'=>'o','Œ'=>'OE','œ'=>'oe','Ò'=>'O','ò'=>'o','Õ'=>'O','õ'=>'o','Ö'=>'OE','ö'=>'oe', |
|
44 |
'Š'=>'S','š'=>'s', |
|
45 |
'ß'=>'ss', |
|
46 |
'Ú'=>'U','ú'=>'u','Û'=>'U','û'=>'u','Ù'=>'U','ù'=>'u','Ü'=>'UE','ü'=>'ue', |
|
47 |
'Ý'=>'Y','ý'=>'y','Ÿ'=>'Y','ÿ'=>'y', |
|
48 |
'Š'=>'S', |
|
49 |
'Œ'=>'OE','œ'=>'oe', |
|
50 |
'š'=>'s', |
|
51 |
'Ÿ'=>'Y', |
|
52 |
'©'=>'(c)','®'=>'(r)','Ð'=>'D','×'=>'x','Ø'=>'O','Þ'=>'TH','ð'=>'d','ø'=>'o','þ'=>'th', |
|
53 |
|
|
54 |
// latin extended-A |
|
55 |
'Ā'=>'A','ā'=>'a','Ă'=>'A','ă'=>'a','Ą'=>'A','ą'=>'a', |
|
56 |
'Ć'=>'C','ć'=>'c','Ĉ'=>'C','ĉ'=>'c','č'=>'c','Č'=>'C','ċ'=>'c','Ċ'=>'C', |
|
57 |
'đ'=>'d','Đ'=>'D','ď'=>'d','Ď'=>'D', |
|
58 |
'ē'=>'e','Ē'=>'E','Ĕ'=>'E','ĕ'=>'e','Ė'=>'E','ė'=>'e','Ę'=>'E','ę'=>'e','Ě'=>'E','ě'=>'e', |
|
59 |
'Ĝ'=>'G','ĝ'=>'g','Ğ'=>'G','ğ'=>'g','Ġ'=>'G','ġ'=>'g','Ģ'=>'G','ģ'=>'g', |
|
60 |
'Ĥ'=>'H','ĥ'=>'h','Ħ'=>'H','ħ'=>'h', |
|
61 |
'Ĩ'=>'I','ĩ'=>'i','Ī'=>'I','ī'=>'i','Ĭ'=>'I','ĭ'=>'i','Į'=>'I','į'=>'i','İ'=>'I','ı'=>'i', |
|
62 |
'IJ'=>'IJ','ij'=>'ij', |
|
63 |
'Ĵ'=>'J','ĵ'=>'j', |
|
64 |
'Ķ'=>'K','ķ'=>'k','ĸ'=>'k', |
|
65 |
'Ĺ'=>'L','ĺ'=>'l','Ļ'=>'L','ļ'=>'l','Ľ'=>'L','ľ'=>'l','Ŀ'=>'L','ŀ'=>'l','Ł'=>'L','ł'=>'l', |
|
66 |
'Ń'=>'N','ń'=>'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ậ'=>'A','ậ'=>'a','Ắ'=>'A','ắ'=>'a','Ằ'=>'A','ằ'=>'a','Ẳ'=>'A','ẳ'=>'a','Ẵ'=>'A','ẵ'=>'a','Ặ'=>'A','ặ'=>'a', |
|
146 |
'Ẹ'=>'E','ẹ'=>'e','Ẻ'=>'E','ẻ'=>'e','Ẽ'=>'E','ẽ'=>'e','Ế'=>'E','ế'=>'e','Ề'=>'E','ề'=>'e','Ể'=>'E','ể'=>'e','Ễ'=>'E','ễ'=>'e','Ệ'=>'E','ệ'=>'e', |
|
147 |
'Ỉ'=>'I','ỉ'=>'i','Ị'=>'I','ị'=>'i', |
|
148 |
'Ọ'=>'O','ọ'=>'o','Ỏ'=>'O','ỏ'=>'o','Ố'=>'O','ố'=>'o','Ồ'=>'O','ồ'=>'o','Ổ'=>'O','ổ'=>'o','Ỗ'=>'O','ỗ'=>'o', |
|
149 |
'Ộ'=>'O','ộ'=>'o','Ớ'=>'O','ớ'=>'o','Ờ'=>'O','ờ'=>'o','Ở'=>'O','ở'=>'o','Ỡ'=>'O','ỡ'=>'o','Ợ'=>'O','ợ'=>'o', |
|
150 |
'Ụ'=>'U','ụ'=>'u','Ủ'=>'U','ủ'=>'u','Ứ'=>'U','ứ'=>'u','Ừ'=>'U','ừ'=>'u','Ử'=>'U','ử'=>'u','Ữ'=>'U','ữ'=>'u','Ự'=>'U','ự'=>'u', |
|
151 |
'Ỳ'=>'Y','ỳ'=>'y','Ỵ'=>'Y','ỵ'=>'y','Ỷ'=>'Y','ỷ'=>'y','Ỹ'=>'Y','ỹ'=>'y', |
|
152 |
|
|
153 |
//### CYRILLIC (transliteration following iso 9:1995) |
|
154 |
'А'=>'A','а'=>'a', // A |
|
155 |
'Ӑ'=>'A','ӑ'=>'a', // A WITH BREVE |
|
156 |
'Ӓ'=>'A','ӓ'=>'a', // A WITH DIAERESIS |
|
157 |
'Ӕ'=>'A','ӕ'=>'a', // LIGATURE A IE |
|
158 |
'Ә'=>'A','ә'=>'a', // SCHWA |
|
159 |
'Ӛ'=>'A','ӛ'=>'a', // SCHWA WITH DIAERESIS |
|
160 |
'Б'=>'B','б'=>'b', // BE |
|
161 |
'В'=>'V','в'=>'v', // VE |
|
162 |
'Г'=>'G','г'=>'g', // GHE |
|
163 |
'Ґ'=>'G','ґ'=>'g', // GHE WITH UPTURN |
|
164 |
'Ҕ'=>'G','ҕ'=>'g', // GHE WITH MIDDLE HOOK |
|
165 |
'Ғ'=>'G','ғ'=>'g', // GHE WITH STROKE |
|
166 |
'Ӷ'=>'G','ӷ'=>'g', // GHE WITH DESCENDER |
|
167 |
'Д'=>'D','д'=>'d', // DE |
|
168 |
'Ђ'=>'D','ђ'=>'d', // DJE |
|
169 |
'Ѓ'=>'G','ѓ'=>'g', // GJE |
|
170 |
'Ѐ'=>'E','ѐ'=>'e', // IE WITH GRAVE |
|
171 |
'Е'=>'E','е'=>'e', // IE |
|
172 |
'Ё'=>'E','ё'=>'e', // IO |
|
173 |
'Ӗ'=>'E','ӗ'=>'e', // IE WITH BREVE |
|
174 |
'Є'=>'E','є'=>'e', // UKRAINIAN IE |
|
175 |
'Ҽ'=>'C','ҽ'=>'c', // ABKHASIAN CHE |
|
176 |
'Ҿ'=>'C','ҿ'=>'c', // ABKHASIAN CHE WITH DESCENDER |
|
177 |
'Ж'=>'Z','ж'=>'z', // ZHE |
|
178 |
'Ӂ'=>'Z','ӂ'=>'z', // ZHE WITH BREVE |
|
179 |
'Ӝ'=>'Z','ӝ'=>'z', // ZHE WITH DIAERESIS |
|
180 |
'Җ'=>'Z','җ'=>'z', // ZHE WITH DESCENDER |
|
181 |
'З'=>'Z','з'=>'z', // ZE |
|
182 |
'Ӟ'=>'Z','ӟ'=>'z', // ZE WITH DIAERESIS |
|
183 |
'Ѕ'=>'Z','ѕ'=>'z', // DZE |
|
184 |
'Ӡ'=>'Z','ӡ'=>'z', // ABKHASIAN DZE |
|
185 |
'Ѝ'=>'I','ѝ'=>'i', // I WITH GRAVE |
|
186 |
'И'=>'I','и'=>'i', // I |
|
187 |
'Ӣ'=>'I','ӣ'=>'i', // I WITH MACRON |
|
188 |
'Ӥ'=>'I','ӥ'=>'i', // I WITH DIAERESIS |
|
189 |
'І'=>'I','і'=>'i', // BYELORUSSIAN-UKRAINIAN I |
|
190 |
'Ї'=>'I','ї'=>'i', // YI |
|
191 |
'Й'=>'J','й'=>'j', // SHORT I |
|
192 |
'Ј'=>'J','ј'=>'j', // JE |
|
193 |
'К'=>'K','к'=>'k', // KA |
|
194 |
'Қ'=>'K','қ'=>'k', // KA WITH DESCENDER |
|
195 |
'Ҝ'=>'K','ҝ'=>'k', // KA WITH VERTICAL STROKE |
|
196 |
'Ҟ'=>'K','ҟ'=>'k', // KA WITH STROKE |
|
197 |
'Ҡ'=>'K','ҡ'=>'k', // BASHKIR KA |
|
198 |
'Л'=>'L','л'=>'l', // EL |
|
199 |
'Љ'=>'L','љ'=>'l', // LJE |
|
200 |
'М'=>'M','м'=>'m', // EM |
|
201 |
'Н'=>'N','н'=>'n', // EN |
|
202 |
'Њ'=>'N','њ'=>'n', // NJE |
|
203 |
'Ҥ'=>'N','ҥ'=>'n', // LIGATURE EN GHE |
|
204 |
'Ң'=>'N','ң'=>'n', // EN WITH DESCENDER |
|
205 |
'О'=>'O','о'=>'o', // O |
|
206 |
'Ӧ'=>'O','ӧ'=>'o', // O WITH DIAERESIS |
|
207 |
'Ө'=>'O','ө'=>'o', // BARRED O |
|
208 |
'Ӫ'=>'O','ӫ'=>'o', // BARRED O WITH DIAERESIS |
|
209 |
'П'=>'P','п'=>'p', // PE |
|
210 |
'Ҧ'=>'P','ҧ'=>'p', // PE WITH MIDDLE HOOK |
|
211 |
'Р'=>'R','р'=>'r', // ER |
|
212 |
'С'=>'S','с'=>'s', // ES |
|
213 |
'Ҫ'=>'C','ҫ'=>'c', // ES WITH DESCENDER |
|
214 |
'Т'=>'T','т'=>'t', // TE |
|
215 |
'Ҭ'=>'T','ҭ'=>'t', // TE WITH DESCENDER |
|
216 |
'Ћ'=>'C','ћ'=>'c', // TSHE |
|
217 |
'Ќ'=>'K','ќ'=>'k', // KJE |
|
218 |
'У'=>'U','у'=>'u', // U |
|
219 |
'Ў'=>'U','ў'=>'u', // SHORT U |
|
220 |
'Ӯ'=>'U','ӯ'=>'u', // U WITH MACRON |
|
221 |
'Ӱ'=>'U','ӱ'=>'u', // U WITH DIAERESIS |
|
222 |
'Ӳ'=>'U','ӳ'=>'u', // U WITH DOUBLE ACUTE |
|
223 |
'Ү'=>'U','ү'=>'u', // STRAIGHT U |
|
224 |
'Ұ'=>'U','ұ'=>'u', // STRAIGHT U WITH STROKE |
|
225 |
'Ф'=>'F','ф'=>'f', // EF |
|
226 |
'Х'=>'H','х'=>'h', // HA |
|
227 |
'Ҳ'=>'H','ҳ'=>'h', // HA WITH DESCENDER |
|
228 |
'Һ'=>'H','һ'=>'h', // SHHA |
|
229 |
'Ц'=>'C','ц'=>'c', // TSE |
|
230 |
'Ҵ'=>'C','ҵ'=>'c', // LIGATURE TE TSE |
|
231 |
'Ч'=>'C','ч'=>'c', // CHE |
|
232 |
'Ӵ'=>'C','ӵ'=>'c', // CHE WITH DIAERESIS |
|
233 |
'Ҷ'=>'C','ҷ'=>'c', // CHE WITH DESCENDER |
|
234 |
'Ҹ'=>'C','ҹ'=>'c', // CHE WITH VERTICAL STROKE |
|
235 |
'Џ'=>'D','џ'=>'d', // DZHE |
|
236 |
'Ш'=>'S','ш'=>'s', // SHA |
|
237 |
'Щ'=>'S','щ'=>'s', // SHCHA |
|
238 |
'Ы'=>'Y','ы'=>'y', // YERU |
|
239 |
'Ӹ'=>'Y','ӹ'=>'y', // YERU WITH DIAERESIS |
|
240 |
'Э'=>'E','э'=>'e', // E |
|
241 |
'Ӭ'=>'E','ӭ'=>'e', // E WITH DIAERESIS |
|
242 |
'Ю'=>'U','ю'=>'u', // YU |
|
243 |
'Я'=>'A','я'=>'a', // YA |
|
244 |
'Ѣ'=>'E','ѣ'=>'e', // YAT |
|
245 |
'Ѫ'=>'A','ѫ'=>'a', // BIG YUS |
|
246 |
'Ѳ'=>'F','ѳ'=>'f', // FITA |
|
247 |
'Ѵ'=>'Y','ѵ'=>'y', // IZHITSA |
|
248 |
'Ѷ'=>'Y','ѷ'=>'y', // IZHITSA WITH DOUBLE GRAVE ACCENT |
|
249 |
'Ҩ'=>'O','ҩ'=>'o', // ABKHASIAN HA |
|
250 |
'Ѡ'=>'O','ѡ'=>'o', // OMEGA |
|
251 |
'Ѥ'=>'E','ѥ'=>'e', // IOTIFIED E |
|
252 |
'Ѧ'=>'U','ѧ'=>'u', // LITTLE YUS (???) |
|
253 |
'Ѩ'=>'U','ѩ'=>'u', // IOTIFIED LITTLE YUS (???) |
|
254 |
'Ѭ'=>'U','ѭ'=>'u', // IOTIFIED BIG YUS (???) |
|
255 |
'Ѯ'=>'K','ѯ'=>'k', // KSI (???) |
|
256 |
'Ѱ'=>'P','ѱ'=>'p', // PSI (???) |
|
257 |
'Ѹ'=>'U','ѹ'=>'u', // UK |
|
258 |
'Ѻ'=>'O','ѻ'=>'o', // ROUND OMEGA (???) |
|
259 |
'Ѽ'=>'O','ѽ'=>'o', // OMEGA WITH TITLO (???) |
|
260 |
'Ѿ'=>'O','ѿ'=>'o', // OT (???) |
|
261 |
'Ҁ'=>'K','ҁ'=>'k', // KOPPA (???) |
|
262 |
'Ҋ'=>'J','ҋ'=>'j', // SHORT I WITH TAIL |
|
263 |
'Ҏ'=>'R','Ҏ'=>'r', // ER WITH TICK |
|
264 |
'Ҙ'=>'Z','ҙ'=>'z', // ZE WITH DESCENDER |
|
265 |
'Ӄ'=>'K','ӄ'=>'k', // KA WITH HOOK |
|
266 |
'Ӆ'=>'L','ӆ'=>'l', // EL WITH TAIL |
|
267 |
'Ӈ'=>'N','ӈ'=>'n', // EN WITH HOOK |
|
268 |
'Ӊ'=>'N','ӊ'=>'n', // EN WITH TAIL |
|
269 |
'Ӌ'=>'C','ӌ'=>'c', // KHAKASSIAN CHE |
|
270 |
'Ӎ'=>'M','ӎ'=>'m', // EM WITH TAIL |
|
271 |
// specialchars |
|
272 |
'ъ'=>'-','Ъ'=>'-', // HARD SIGN |
|
273 |
'Ь'=>'-','ь'=>'-', // SOFT SIGN |
|
274 |
'Ҍ'=>'-', // SEMISOFT SIGN |
|
275 |
'Ӏ'=>'-', // PALOCHKA |
|
276 |
'́'=>'', |
|
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 |
'αι'=>'e','Αι'=>'E', |
|
281 |
'ει'=>'i','Ει'=>'I', |
|
282 |
'οι'=>'i','Οι'=>'I', |
|
283 |
'ου'=>'ou','Ου'=>'Ou', |
|
284 |
'αυ'=>'av','Αυ'=>'Av', |
|
285 |
'ευ'=>'ev','Ευ'=>'Ev', |
|
286 |
'ηυ'=>'iv','Ηυ'=>'Iv', |
|
287 |
'μπ'=>'mp','Μπ'=>'B', |
|
288 |
'ντ'=>'nt','Ντ'=>'D', |
|
289 |
'τζ'=>'tz','Τζ'=>'Tz', |
|
290 |
'γκ'=>'ng','Γκ'=>'G', |
|
291 |
'γγ'=>'ng','Γγ'=>'Ng', |
|
292 |
// single chars |
|
293 |
'Ά'=>'A','Έ'=>'E','Ή'=>'I','Ί'=>'I','Ό'=>'O','Ύ'=>'Y','Ώ'=>'O','ΐ'=>'i', |
|
294 |
'Α'=>'A','Β'=>'V','Γ'=>'G','Δ'=>'D','Ε'=>'E','Ζ'=>'Z','Η'=>'I','Θ'=>'Th','Ι'=>'I','Κ'=>'K','Λ'=>'L','Μ'=>'M','Ν'=>'N','Ξ'=>'X','Ο'=>'O','Π'=>'P','Ρ'=>'R','Σ'=>'S','Τ'=>'T','Υ'=>'Y','Φ'=>'F','Χ'=>'Ch','Ψ'=>'Ps','Ω'=>'O', |
|
295 |
'Ϊ'=>'I','Ϋ'=>'Y','ά'=>'a','έ'=>'e','ή'=>'i','ί'=>'i','ΰ'=>'y', |
|
296 |
'α'=>'a','β'=>'v','γ'=>'g','δ'=>'d','ε'=>'e','ζ'=>'z','η'=>'i','θ'=>'th','ι'=>'i','κ'=>'k','λ'=>'l','μ'=>'m','ν'=>'n','ξ'=>'x','ο'=>'o','π'=>'p','ρ'=>'r','ς'=>'s','σ'=>'s','τ'=>'t','υ'=>'y','φ'=>'f','χ'=>'ch','ψ'=>'ps','ω'=>'o', |
|
297 |
'ϊ'=>'i','ϋ'=>'y','ό'=>'o','ύ'=>'y','ώ'=>'o','ϐ'=>'b','ϑ'=>'th','ϒ'=>'y','ϓ'=>'y','ϔ'=>'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 |
Also available in: Unified diff
again copied all changes for WB 2.6.6 from trunk to branches