Revision 1684
Added by Dietmar over 12 years ago
upgrade-script.php | ||
---|---|---|
4 | 4 |
* @category backend |
5 | 5 |
* @package installation |
6 | 6 |
* @author WebsiteBaker Project |
7 |
* @copyright 2009-2011, Website Baker Org. e.V.
|
|
8 |
* @link http://www.websitebaker2.org/
|
|
7 |
* @copyright 2009-2012, Website Baker Org. e.V.
|
|
8 |
* @link http://www.websitebaker2.org/
|
|
9 | 9 |
* @license http://www.gnu.org/licenses/gpl.html |
10 | 10 |
* @platform WebsiteBaker 2.8.x |
11 | 11 |
* @requirements PHP 5.2.2 and higher |
... | ... | |
19 | 19 |
|
20 | 20 |
require_once(WB_PATH.'/framework/functions.php'); |
21 | 21 |
require_once(WB_PATH.'/framework/class.admin.php'); |
22 |
require_once(WB_PATH.'/framework/class.database.php');
|
|
22 |
// require_once(WB_PATH.'/framework/Database.php');
|
|
23 | 23 |
$admin = new admin('Addons', 'modules', false, false); |
24 | 24 |
|
25 | 25 |
$oldVersion = 'Version '.WB_VERSION; |
... | ... | |
62 | 62 |
'[ADMIN]/preferences/details.php', |
63 | 63 |
'[ADMIN]/preferences/email.php', |
64 | 64 |
'[ADMIN]/preferences/password.php', |
65 |
'[ADMIN]/pages/settings2.php' |
|
65 |
'[ADMIN]/pages/settings2.php',
|
|
66 | 66 |
|
67 |
'[FRAMEWORK]/class.msg_queue.php', |
|
68 |
'[FRAMEWORK]/class.database.php', |
|
69 |
|
|
67 | 70 |
); |
68 | 71 |
|
69 |
if(version_compare(WB_REVISION, '1671', '<'))
|
|
72 |
if(version_compare(WB_REVISION, '1681', '<'))
|
|
70 | 73 |
{ |
71 | 74 |
$filesRemove['1'] = array( |
72 | 75 |
|
... | ... | |
218 | 221 |
<title>Upgrade script</title> |
219 | 222 |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
220 | 223 |
<style type="text/css"> |
221 |
html { overflow: -moz-scrollbars-vertical; /* Force firefox to always show room for a vertical scrollbar */ }
|
|
224 |
html { overflow-y: scroll; /* Force firefox to always show room for a vertical scrollbar */ }
|
|
222 | 225 |
|
223 | 226 |
body { |
224 | 227 |
margin:0; |
... | ... | |
385 | 388 |
*/ |
386 | 389 |
echo "<br />Adding sec_anchor to settings table"; |
387 | 390 |
$cfg = array( |
388 |
'sec_anchor' => 'wb_' |
|
391 |
'sec_anchor' => defined('SEC_ANCHOR') ? SEC_ANCHOR : 'wb_'
|
|
389 | 392 |
); |
390 | 393 |
|
391 | 394 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
396 | 399 |
*/ |
397 | 400 |
echo "Adding redirect timer to settings table"; |
398 | 401 |
$cfg = array( |
399 |
'redirect_timer' => '1500' |
|
402 |
'redirect_timer' => defined('Redirect_Timer') ? Redirect_Timer : '1500'
|
|
400 | 403 |
); |
401 | 404 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
402 | 405 |
|
... | ... | |
405 | 408 |
*/ |
406 | 409 |
echo "Updating rename_files_on_upload to settings table"; |
407 | 410 |
$cfg = array( |
408 |
'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js'
|
|
411 |
'rename_files_on_upload' => (defined('RENAME_FILES_ON_UPLOAD') ? RENAME_FILES_ON_UPLOAD : 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js')
|
|
409 | 412 |
); |
410 | 413 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
411 | 414 |
|
... | ... | |
414 | 417 |
*/ |
415 | 418 |
echo "Adding mediasettings to settings table"; |
416 | 419 |
$cfg = array( |
417 |
'mediasettings' => '',
|
|
420 |
'mediasettings' => (defined('MEDIASETTINGS') ? MEDIASETTINGS : ''),
|
|
418 | 421 |
); |
419 | 422 |
|
420 | 423 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
424 | 427 |
*/ |
425 | 428 |
echo "Adding fingerprint_with_ip_octets to settings table"; |
426 | 429 |
$cfg = array( |
427 |
'fingerprint_with_ip_octets' => '2',
|
|
428 |
'secure_form_module' => ''
|
|
430 |
'fingerprint_with_ip_octets' => (defined('FINGERPRINT_WITH_IP_OCTETS') ? FINGERPRINT_WITH_IP_OCTETS : '2'),
|
|
431 |
'secure_form_module' => (defined('SECURE_FORM_MODULE') ? SECURE_FORM_MODULE : '')
|
|
429 | 432 |
); |
430 | 433 |
|
431 | 434 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
435 | 438 |
*/ |
436 | 439 |
echo "Adding page_icon_dir to settings table"; |
437 | 440 |
$cfg = array( |
438 |
'page_icon_dir' => '/templates/*/title_images',
|
|
441 |
'page_icon_dir' => (defined('PAGE_ICON_DIR') ? PAGE_ICON_DIR : '/templates/*/title_images'),
|
|
439 | 442 |
); |
440 | 443 |
|
441 | 444 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
445 | 448 |
*/ |
446 | 449 |
echo "Adding dev_infos to settings table"; |
447 | 450 |
$cfg = array( |
448 |
'dev_infos' => 'true',
|
|
451 |
'dev_infos' => (defined('DEV_INFOS') ? DEV_INFOS : 'false')
|
|
449 | 452 |
); |
450 | 453 |
|
451 | 454 |
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />"); |
452 | 455 |
|
453 |
if(version_compare(WB_REVISION, '1675', '<'))
|
|
456 |
if(version_compare(WB_REVISION, '1680', '<'))
|
|
454 | 457 |
{ |
455 | 458 |
echo '<h3>Step '.(++$stepID).': Updating core tables</h3>'; |
456 | 459 |
|
... | ... | |
495 | 498 |
*/ |
496 | 499 |
$table_name = TABLE_PREFIX.'pages'; |
497 | 500 |
$field_name = 'page_icon'; |
498 |
$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `page_title`";
|
|
501 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `page_title`";
|
|
499 | 502 |
if(!$database->field_exists($table_name,$field_name)) { |
500 | 503 |
echo "Adding field page_icon to pages table"; |
501 | 504 |
echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
523 | 526 |
*/ |
524 | 527 |
$table_name = TABLE_PREFIX.'pages'; |
525 | 528 |
$field_name = 'menu_icon_0'; |
526 |
$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `menu_title`";
|
|
529 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `menu_title`";
|
|
527 | 530 |
if(!$database->field_exists($table_name,$field_name)) { |
528 | 531 |
echo "Adding field menu_icon_0 to pages table"; |
529 | 532 |
echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
537 | 540 |
*/ |
538 | 541 |
$table_name = TABLE_PREFIX.'pages'; |
539 | 542 |
$field_name = 'menu_icon_1'; |
540 |
$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `menu_icon_0`";
|
|
543 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `menu_icon_0`";
|
|
541 | 544 |
if(!$database->field_exists($table_name,$field_name)) { |
542 | 545 |
echo "Adding field menu_icon_1 to pages table"; |
543 | 546 |
echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />"); |
... | ... | |
547 | 550 |
} |
548 | 551 |
|
549 | 552 |
/********************************************************** |
553 |
* - Add field "tooltip" to table "pages" |
|
554 |
*/ |
|
555 |
$table_name = TABLE_PREFIX.'pages'; |
|
556 |
$field_name = 'tooltip'; |
|
557 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `menu_icon_1`"; |
|
558 |
if(!$database->field_exists($table_name,$field_name)) { |
|
559 |
echo "Adding field tooltip to pages table"; |
|
560 |
echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />"); |
|
561 |
} else { |
|
562 |
echo "Modify field tooltip to pages table"; |
|
563 |
echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />"); |
|
564 |
} |
|
565 |
|
|
566 |
/********************************************************** |
|
550 | 567 |
* - Add field "admin_groups" to table "pages" |
551 | 568 |
*/ |
552 | 569 |
$table_name = TABLE_PREFIX.'pages'; |
Also available in: Unified diff
! update upgrade-script, now don't overwrite existings values in settings
+ add field tooltip to table pages in installer
! change some module tool_icon.png (Tks to Stefek)
! add date_time string to backup_droplets.zip
- search and comment out founded require_once(WB_PATH."/framework/class.database.php");
- this will be never needed anymore and produce errors
! rename class.msg_queue.php in msgQueue.php to work with autokoader
+ add function format_message to class.wb.php