Revision 2104
Added by darkviper about 10 years ago
index.php | ||
---|---|---|
32 | 32 |
* @since File available since 2012-04-01 |
33 | 33 |
* @description xyz |
34 | 34 |
*/ |
35 |
// PHP less then 5.3.2 is prohibited ---
|
|
36 |
if (version_compare(PHP_VERSION, '5.3.2', '<')) {
|
|
37 |
$sMsg = '<p style="color: #ff0000;">WebsiteBaker 2.8.4 and above is not able to run with PHP-Version less then 5.3.2!!<br />'
|
|
38 |
. 'Please change your PHP-Version to any kind from 5.3.2 and up!<br />'
|
|
35 |
// PHP less then 5.4.0 is prohibited ---
|
|
36 |
if (version_compare(PHP_VERSION, '5.4.0', '<')) {
|
|
37 |
$sMsg = '<p style="color: #ff0000;">WebsiteBaker 2.8.4 and above is not able to run with PHP-Version less then 5.4.0!!<br />'
|
|
38 |
. 'Please change your PHP-Version to any kind from 5.4.0 and up!<br />'
|
|
39 | 39 |
. 'If you have problems to solve that, ask your hosting provider for it.<br />' |
40 | 40 |
. 'The very best solution is the use of PHP-5.4 and up</p>'; |
41 | 41 |
die($sMsg); |
42 | 42 |
} |
43 |
include(__DIR__.'/InstallHelper.php'); |
|
43 | 44 |
// Start a session |
44 | 45 |
if(!defined('SESSION_STARTED')) { |
45 | 46 |
session_name('wb_session_id'); |
... | ... | |
203 | 204 |
</tr> |
204 | 205 |
<?php } ?> |
205 | 206 |
<tr> |
206 |
<td style="color: #666666;">PHP Version 5.3.2 and up</td>
|
|
207 |
<td style="color: #666666;">PHP Session Support</td>
|
|
207 | 208 |
<td> |
208 |
<?php |
|
209 |
if (version_compare(PHP_VERSION, '5.3.2', '>=')) |
|
210 |
{ |
|
211 |
?><font class="good">Yes</font><?php |
|
212 |
} else { |
|
213 |
$installFlag = false; |
|
214 |
?><font class="bad">No</font><?php |
|
215 |
} |
|
216 |
?> |
|
209 |
<?php echo $session_support; ?> |
|
210 |
?> |
|
217 | 211 |
</td> |
218 |
<td style="color: #666666;">PHP Session Support</td> |
|
219 |
<td><?php echo $session_support; ?></td> |
|
212 |
<td style="color: #666666;"> |
|
213 |
|
|
214 |
</td> |
|
215 |
<td> |
|
216 |
$nbsp; |
|
217 |
</td> |
|
220 | 218 |
</tr> |
221 | 219 |
<tr> |
222 | 220 |
<td style="color: #666666;">PHP Interface</td> |
... | ... | |
226 | 224 |
<?php echo $sapi ?> |
227 | 225 |
</font> |
228 | 226 |
</td> |
229 |
<td style="color: #666666;">magic_quotes_gpc</td>
|
|
227 |
<td style="color: #666666;">Server DefaultCharset</td>
|
|
230 | 228 |
<td > |
231 | 229 |
<?php |
232 |
?><font class="good"> |
|
233 |
<?php echo $getMagicQuotesGpc ?> |
|
234 |
</font> |
|
235 |
</td> |
|
236 |
|
|
237 |
</tr> |
|
238 |
|
|
239 |
<td style="color: #666666;">Server DefaultCharset</td> |
|
240 |
<td> |
|
241 |
<?php |
|
242 | 230 |
$chrval = (($e_adc != '') && (strtolower($e_adc) != 'utf-8') ? true : false); |
243 | 231 |
if($chrval == false) { |
244 | 232 |
?><font class="good"> |
... | ... | |
248 | 236 |
} else { |
249 | 237 |
?><font class="bad"><?php echo $e_adc ?></font><?php |
250 | 238 |
} |
251 |
|
|
252 | 239 |
?> |
253 | 240 |
</td> |
254 |
<td style="color: #666666;">PHP Safe Mode</td> |
|
255 |
<td> |
|
256 |
<?php |
|
257 |
if(ini_get('safe_mode')=='' || strpos(strtolower(ini_get('safe_mode')), 'off')!==FALSE || ini_get('safe_mode')==0) { |
|
258 |
?><font class="good">Disabled</font><?php |
|
259 |
} else { |
|
260 |
$installFlag = false; |
|
261 |
?><font class="bad">Enabled</font><?php |
|
262 |
} |
|
263 |
?> |
|
264 |
</td> |
|
265 | 241 |
</tr> |
266 | 242 |
<?php if($chrval == true) { |
267 | 243 |
?> |
... | ... | |
363 | 339 |
</td> |
364 | 340 |
<td> |
365 | 341 |
<select <?php echo field_error('default_timezone');?> tabindex="3" name="default_timezone" style="width: 100%;"> |
366 |
<?php |
|
367 |
$TIMEZONES['-12'] = 'GMT - 12 Hours'; |
|
368 |
$TIMEZONES['-11'] = 'GMT -11 Hours'; |
|
369 |
$TIMEZONES['-10'] = 'GMT -10 Hours'; |
|
370 |
$TIMEZONES['-9'] = 'GMT -9 Hours'; |
|
371 |
$TIMEZONES['-8'] = 'GMT -8 Hours'; |
|
372 |
$TIMEZONES['-7'] = 'GMT -7 Hours'; |
|
373 |
$TIMEZONES['-6'] = 'GMT -6 Hours'; |
|
374 |
$TIMEZONES['-5'] = 'GMT -5 Hours'; |
|
375 |
$TIMEZONES['-4'] = 'GMT -4 Hours'; |
|
376 |
$TIMEZONES['-3.5'] = 'GMT -3.5 Hours'; |
|
377 |
$TIMEZONES['-3'] = 'GMT -3 Hours'; |
|
378 |
$TIMEZONES['-2'] = 'GMT -2 Hours'; |
|
379 |
$TIMEZONES['-1'] = 'GMT -1 Hour'; |
|
380 |
$TIMEZONES['0'] = 'GMT'; |
|
381 |
$TIMEZONES['1'] = 'GMT +1 Hour'; |
|
382 |
$TIMEZONES['2'] = 'GMT +2 Hours'; |
|
383 |
$TIMEZONES['3'] = 'GMT +3 Hours'; |
|
384 |
$TIMEZONES['3.5'] = 'GMT +3.5 Hours'; |
|
385 |
$TIMEZONES['4'] = 'GMT +4 Hours'; |
|
386 |
$TIMEZONES['4.5'] = 'GMT +4.5 Hours'; |
|
387 |
$TIMEZONES['5'] = 'GMT +5 Hours'; |
|
388 |
$TIMEZONES['5.5'] = 'GMT +5.5 Hours'; |
|
389 |
$TIMEZONES['6'] = 'GMT +6 Hours'; |
|
390 |
$TIMEZONES['6.5'] = 'GMT +6.5 Hours'; |
|
391 |
$TIMEZONES['7'] = 'GMT +7 Hours'; |
|
392 |
$TIMEZONES['8'] = 'GMT +8 Hours'; |
|
393 |
$TIMEZONES['9'] = 'GMT +9 Hours'; |
|
394 |
$TIMEZONES['9.5'] = 'GMT +9.5 Hours'; |
|
395 |
$TIMEZONES['10'] = 'GMT +10 Hours'; |
|
396 |
$TIMEZONES['11'] = 'GMT +11 Hours'; |
|
397 |
$TIMEZONES['12'] = 'GMT +12 Hours'; |
|
398 |
$TIMEZONES['13'] = 'GMT +13 Hours'; |
|
399 |
foreach($TIMEZONES AS $hour_offset => $title) { |
|
400 |
?> |
|
401 |
<option value="<?php echo $hour_offset; ?>"<?php if(isset($_SESSION['default_timezone']) AND $_SESSION['default_timezone'] == $hour_offset) { echo ' selected="selected"'; } elseif(!isset($_SESSION['default_timezone']) AND $hour_offset == 0) { echo ' selected="selected"'; } ?>><?php echo $title; ?></option> |
|
402 |
<?php |
|
403 |
} |
|
404 |
?> |
|
342 |
<?php |
|
343 |
/* |
|
344 |
build list of TimeZone options |
|
345 |
*/ |
|
346 |
$aZones = array(-12,-11,-10,-9,-8,-7,-6,-5,-4,-3.5,-3,-2,-1,0,1,2,3,3.5,4,4.5,5,5.5,6,6.5,7,8,9,9.5,10,11,12,13); |
|
347 |
$sOutput = PHP_EOL; |
|
348 |
foreach($aZones as $fOffset) { |
|
349 |
$sItemTitle = 'GMT '.(($fOffset>0)?'+':'').(($fOffset==0)?'':(string)$fOffset.' Hours'); |
|
350 |
$sOutput .= '<option value="'.(string)$fOffset.'"'; |
|
351 |
if ( |
|
352 |
(isset($_SESSION['default_timezone']) AND $_SESSION['default_timezone'] == (string)$fOffset) || |
|
353 |
(!isset($_SESSION['default_timezone']) AND $fOffset == 0) |
|
354 |
) { |
|
355 |
$sOutput .= ' selected="selected"'; |
|
356 |
} |
|
357 |
$sOutput .= '>'.$sItemTitle.'</option>'.PHP_EOL; |
|
358 |
} |
|
359 |
// output Timezone options |
|
360 |
echo $sOutput; |
|
361 |
?> |
|
405 | 362 |
</select> |
406 | 363 |
</td> |
407 | 364 |
</tr> |
... | ... | |
411 | 368 |
</td> |
412 | 369 |
<td> |
413 | 370 |
<select <?php echo field_error('default_language');?> tabindex="3" name="default_language" style="width: 100%;"> |
414 |
<?php
|
|
415 |
$sAutoLanguage = 'EN'; // default, if no information from client available
|
|
416 |
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
|
417 |
if(preg_match('/([a-z]{2})(?:-[a-z]{2})*/i', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $matches)) {
|
|
418 |
$sAutoLanguage = strtoupper($matches[1]);
|
|
419 |
}
|
|
420 |
}
|
|
421 |
$sAutoLanguage = isset($_SESSION['default_language']) ? $_SESSION['default_language'] : $sAutoLanguage;
|
|
422 |
$DEFAULT_LANGUAGE = array(
|
|
423 |
'BG'=>'Bulgarian', 'CA'=>'Catalan', 'CS'=>'Čeština', 'DA'=>'Danish', 'DE'=>'Deutsch', 'EN'=>'English',
|
|
424 |
'ES'=>'Spanish', 'ET'=>'Eesti', 'FI'=>'Suomi', 'FR'=>'Français',
|
|
425 |
'HR'=>'Hrvatski', 'HU'=>'Magyar','IT'=>'Italiano', 'LV'=>'Latviesu',
|
|
426 |
'NL'=>'Nederlands', 'NO'=>'Norsk', 'PL'=>'Polski', 'PT'=>'Portuguese (Brazil)', 'RU'=>'Russian', 'SE'=>'Svenska','SK'=>'Slovensky','TR'=>'Turkish'
|
|
427 |
);
|
|
428 |
foreach($DEFAULT_LANGUAGE as $lang_id => $lang_title) {
|
|
429 |
?>
|
|
430 |
<option value="<?php echo $lang_id; ?>"<?php if($sAutoLanguage == $lang_id) { echo ' selected="selected"'; } ?> ><?php echo $lang_title; ?></option>
|
|
431 |
<?php
|
|
432 |
}
|
|
433 |
?>
|
|
371 |
<?php |
|
372 |
/*
|
|
373 |
Find all available languages in /language/ folder and build option list from
|
|
374 |
*/
|
|
375 |
$sLangDir = str_replace('\\', '/', dirname(__DIR__).'/languages/');
|
|
376 |
$aAvailableLanguages = InstallHelper::getAvailableLanguages($sLangDir);
|
|
377 |
$sOutput = PHP_EOL;
|
|
378 |
foreach ($aAvailableLanguages as $sLangCode => $sLangName) {
|
|
379 |
$sOutput .= '<option value="'.$sLangCode.'"';
|
|
380 |
if (
|
|
381 |
(isset($_SESSION['default_language']) AND $_SESSION['default_language'] == $sLangCode) ||
|
|
382 |
(!isset($_SESSION['default_language']) AND $sLangCode == 'EN')
|
|
383 |
) {
|
|
384 |
$sOutput .= ' selected="selected"';
|
|
385 |
}
|
|
386 |
$sOutput .= '>'.$sLangName.'</option>'.PHP_EOL;
|
|
387 |
}
|
|
388 |
// output Language options
|
|
389 |
echo $sOutput;
|
|
390 |
?> |
|
434 | 391 |
</select> |
435 | 392 |
</td> |
436 | 393 |
</tr> |
Also available in: Unified diff
! complete rebuild of wb/install/ - changed to use import-struct.sql
! change class WbDatabase from mysql to msqli
! rework of WbDatabase::importSql()
! function db_update_key_value() optimized for speed
! field `settings_id`removed from table `settings` and new primary key set to `name`
! update-script extended to modify table `settings`