Project

General

Profile

« Previous | Next » 

Revision 1671

Added by Dietmar over 12 years ago

fixes installer and upgrade-script

View differences:

branches/2.8.x/CHANGELOG
11 11
! = Update/Change
12 12
===============================================================================
13 13

  
14
18 Apr-2012 Build 1668 Dietmar Woellbrink (Luisehahne)
15
# fixes installer and upgrade-script
14 16
17 Apr-2012 Build 1670 Werner v.d.Decken(DarkViper)
15 17
+ added new global exceptionhandler (class AppException)
16 18
17 Apr-2012 Build 1669 Werner v.d.Decken(DarkViper)
branches/2.8.x/wb/upgrade-script.php
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 23
$admin = new admin('Addons', 'modules', false, false);
23 24

  
24 25
/* display a status message on the screen **************************************
......
48 49
$OK            = ' <span class="ok">OK</span> ';
49 50
$FAIL          = ' <span class="error">FAILED</span> ';
50 51
$DEFAULT_THEME = 'wb_theme';
51
$stepID = 1;
52
$stepID = 0;
52 53
$dirRemove = array(
53 54
/*
54 55
			'[TEMPLATE]/allcss/',
......
68 69

  
69 70
		 );
70 71

  
71
$filesRemove['1'] = array(
72
if(version_compare(WB_REVISION, '1671', '<'))
73
{
74
	$filesRemove['1'] = array(
72 75

  
73 76
			'[TEMPLATE]/argos_theme/templates/access.htt',
74 77
			'[TEMPLATE]/argos_theme/templates/addons.htt',
......
78 81
			'[TEMPLATE]/argos_theme/templates/groups_form.htt',
79 82
			'[TEMPLATE]/argos_theme/templates/languages.htt',
80 83
			'[TEMPLATE]/argos_theme/templates/languages_details.htt',
81
/*
84
	/*
82 85
			'[TEMPLATE]/argos_theme/templates/login.htt',
83 86
			'[TEMPLATE]/argos_theme/templates/login_forgot.htt',
84
*/
87
	*/
85 88
			'[TEMPLATE]/argos_theme/templates/media.htt',
86 89
			'[TEMPLATE]/argos_theme/templates/media_browse.htt',
87 90
			'[TEMPLATE]/argos_theme/templates/media_rename.htt',
......
110 113
			'[TEMPLATE]/wb_theme/templates/languages.htt',
111 114
			'[TEMPLATE]/wb_theme/templates/languages_details.htt',
112 115

  
113
/*
116
	/*
114 117
			'[TEMPLATE]/wb_theme/templates/login.htt',
115 118
			'[TEMPLATE]/wb_theme/templates/login_forgot.htt',
116
*/
119
	*/
117 120

  
118 121
			'[TEMPLATE]/wb_theme/templates/media.htt',
119 122
			'[TEMPLATE]/wb_theme/templates/media_browse.htt',
......
134 137
			'[TEMPLATE]/wb_theme/templates/users.htt',
135 138
			'[TEMPLATE]/wb_theme/templates/users_form.htt',
136 139
		 );
140
}
137 141

  
138 142
// analyze/check database tables
139 143
function mysqlCheckTables( $dbName )
......
196 200
// check existing tables
197 201
$all_tables = check_wb_tables();
198 202

  
199
?>
200
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
203
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
201 204
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
202 205
<head>
203 206
<title>Upgrade script</title>
......
248 251

  
249 252
h1 { font-size:150%; }
250 253
h2 { font-size: 130%; border-bottom: 1px #CCC solid; }
251
h3 { font-size: 120%; }
254
h3 { font-size: 110%; font-weight: bold;; }
252 255

  
253 256
.ok, .error { font-weight:bold; }
254 257
.ok { color:green; }
......
325 328
	exit();
326 329
}
327 330

  
328
echo '<h2>Step '.(++$stepID).' : Updating database entries</h2>';
331
echo '<h3>Step '.(++$stepID).': Setting default_theme</h3>';
329 332

  
330
// function to add a var/value-pair into settings-table
331
function db_add_key_value($key, $value) {
332
	global $database; global $OK; global $FAIL;
333
	$table = TABLE_PREFIX.'settings';
334
	$query = $database->query("SELECT value FROM $table WHERE name = '$key' LIMIT 1");
335
	if($query->numRows() > 0) {
336
		echo "$key: already exists. $OK.<br />";
337
		return true;
338
	} else {
339
		$database->query("INSERT INTO $table (name,value) VALUES ('$key', '$value')");
340
		echo (mysql_error()?mysql_error().'<br />':'');
341
		$query = $database->query("SELECT value FROM $table WHERE name = '$key' LIMIT 1");
342
		if($query->numRows() > 0) {
343
			echo "$key: $OK.<br />";
344
			return true;
345
		} else {
346
			echo "$key: $FAIL!<br />";
347
			return false;
348
		}
349
	}
350
}
351

  
352
// function to add a new field into a table
353
function db_add_field($field, $table, $desc) {
354
	global $database; global $OK; global $FAIL;
355
	$table = TABLE_PREFIX.$table;
356
	$query = $database->query("DESCRIBE $table '$field'");
357
	if($query->numRows() == 0) { // add field
358
		$query = $database->query("ALTER TABLE $table ADD $field $desc");
359
		echo (mysql_error()?mysql_error().'<br />':'');
360
		$query = $database->query("DESCRIBE $table '$field'");
361
		echo (mysql_error()?mysql_error().'<br />':'');
362
		if($query->numRows() > 0) {
363
			echo "'$field' added. $OK.<br />";
364
		} else {
365
			echo "adding '$field' $FAIL!<br />";
366
		}
367
	} else {
368
		echo "'$field' already exists. $OK.<br />";
369
	}
370
}
371

  
372 333
/**********************************************************
373 334
 *  - Adding field default_theme to settings table
374 335
 */
375
echo "<br />Adding default_theme to settings table<br />";
376
db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
377
/**********************************************************
378
 *  - install droplets
379
 */
380
    $drops = (!in_array ( "mod_droplets", $all_tables)) ? "<br />Install droplets<br />" : "<br />Upgrade droplets<br />";
381
    echo $drops;
336
echo "<br />Adding default_theme to settings table";
337
// db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
338
echo (db_update_key_value( 'settings', 'default_theme', $DEFAULT_THEME ) ? " $OK<br />" : " $FAIL!<br />");
382 339

  
383
     $file_name = (!in_array ( "mod_droplets", $all_tables) ? "install.php" : "upgrade.php");
384
     require_once (WB_PATH."/modules/droplets/".$file_name);
385

  
386 340
// check again all tables, to get a new array
387 341
 if(sizeof($all_tables) < 22) { $all_tables = check_wb_tables(); }
388 342
/**********************************************************
......
422 376
        exit();
423 377
    }
424 378

  
379

  
380
echo '<h3>Step '.(++$stepID).': Updating settings</h3>';
425 381
/**********************************************************
426 382
 *  - Adding field sec_anchor to settings table
427 383
 */
428
echo "<br />Adding sec_anchor to settings table<br />";
384
echo "<br />Adding sec_anchor to settings table";
429 385
$cfg = array(
430 386
	'sec_anchor' => 'wb_'
431 387
);
432
foreach($cfg as $key=>$value) {
433
	db_add_key_value($key, $value);
434
}
435 388

  
389
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
390

  
391

  
436 392
/**********************************************************
437 393
 *  - Adding redirect timer to settings table
438 394
 */
439
echo "<br />Adding redirect timer to settings table<br />";
395
echo "Adding redirect timer to settings table";
440 396
$cfg = array(
441 397
	'redirect_timer' => '1500'
442 398
);
443
foreach($cfg as $key=>$value) {
444
	db_add_key_value($key, $value);
445
}
399
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
446 400

  
447 401
/**********************************************************
448 402
 *  - Adding rename_files_on_upload to settings table
449 403
 */
450
echo "<br />Updating rename_files_on_upload to settings table<br />";
404
echo "Updating rename_files_on_upload to settings table";
451 405
$cfg = array(
452 406
	'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js'
453 407
);
454
db_update_key_value('settings', 'rename_files_on_upload', $cfg['rename_files_on_upload']);
408
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
455 409

  
456 410
/**********************************************************
457 411
 *  - Adding mediasettings to settings table
458 412
 */
459
echo "<br />Adding mediasettings to settings table<br />";
413
echo "Adding mediasettings to settings table";
460 414
$cfg = array(
461 415
	'mediasettings' => '',
462 416
);
463 417

  
464
foreach($cfg as $key=>$value) {
465
	db_add_key_value($key, $value);
466
}
418
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
467 419

  
468 420
/**********************************************************
469 421
 *  - Adding fingerprint_with_ip_octets to settings table
470 422
 */
471
echo "<br />Adding fingerprint_with_ip_octets to settings table<br />";
423
echo "Adding fingerprint_with_ip_octets to settings table";
472 424
$cfg = array(
473 425
	'fingerprint_with_ip_octets' => '2',
474 426
	'secure_form_module' => ''
475 427
);
476
foreach($cfg as $key=>$value) {
477
	db_add_key_value($key, $value);
478
}
428

  
429
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
430

  
479 431
/**********************************************************
480 432
 *  - Adding page_icon_dir to settings table
481 433
 */
482
echo "<br />Adding page_icon_dir to settings table<br />";
434
echo "Adding page_icon_dir to settings table";
483 435
$cfg = array(
484 436
	'page_icon_dir' => '/templates/*/title_images',
485 437
);
486
foreach($cfg as $key=>$value) {
487
	db_add_key_value($key, $value);
488
}
438

  
439
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
440

  
489 441
/**********************************************************
490 442
 *  - Adding dev_infos to settings table
491 443
 */
492
echo "<br />Adding dev_infos to settings table<br />";
444
echo "Adding dev_infos to settings table";
493 445
$cfg = array(
494 446
	'dev_infos' => 'true',
495 447
);
496
foreach($cfg as $key=>$value) {
497
	db_add_key_value($key, $value);
498
}
499 448

  
500
/**********************************************************
449
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
450

  
451
if(version_compare(WB_REVISION, '1671', '<'))
452
{
453
	echo '<h3>Step '.(++$stepID).': Updating core tables</h3>';
454

  
455
	/**********************************************************
456
	 *  - Update search no results database filed to create
457
	 *  valid XHTML if search is empty
458
	 */
459
	if (version_compare(WB_VERSION, '2.8', '<'))
460
	{
461
	    echo "<br />Updating database field `no_results` of search table: ";
462
	    $search_no_results = addslashes('<tr><td><p>[TEXT_NO_RESULTS]</p></td></tr>');
463
	    $sql  = 'UPDATE `'.TABLE_PREFIX.'search` ';
464
		$sql .= 'SET `value`=\''.$search_no_results.'\' ';
465
		$sql .= 'WHERE `name`=\'no_results\'';
466
	    echo ($database->query($sql)) ? ' $OK<br />' : ' $FAIL<br />';
467
	}
468
	/**********************************************************
501 469
 *  - Add field "redirect_type" to table "mod_menu_link"
502 470
 */
503
echo "<br />Adding field redirect_type to mod_menu_link table<br />";
504
db_add_field('redirect_type', 'mod_menu_link', "INT NOT NULL DEFAULT '302' AFTER `target_page_id`");
471
	$table_name = TABLE_PREFIX.'mod_menu_link';
472
	$field_name = 'redirect_type';
473
	$description = "INT NOT NULL DEFAULT '302' AFTER `target_page_id`";
474
	if(!$database->field_exists($table_name,$field_name)) {
475
		echo "<br />Adding field redirect_type to mod_menu_link table";
476
		echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
477
	} else {
478
		echo "<br />Modify field redirect_type to mod_menu_link table";
479
		echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
480
	}
505 481

  
506
/**********************************************************
482
	/**********************************************************
483
	 *  - Add field "page_trail" to table "pages"
484
	 */
485
	$table_name = TABLE_PREFIX.'pages';
486
	$field_name = 'page_trail';
487
	$description = "VARCHAR( 255 ) NOT NULL DEFAULT ''";
488
	echo "Modify field page_trail to pages table";
489
	echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
490

  
491
	/**********************************************************
507 492
 *  - Add field "page_icon" to table "pages"
508 493
 */
509
echo "<br />Adding field page_icon to pagestable<br />";
510
db_add_field('page_icon', 'pages', "TEXT NOT NULL DEFAULT '' AFTER `page_title`");
494
	$table_name = TABLE_PREFIX.'pages';
495
	$field_name = 'page_icon';
496
	$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `page_title`";
497
	if(!$database->field_exists($table_name,$field_name)) {
498
		echo "Adding field page_icon to pages table";
499
		echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
500
	} else {
501
		echo "Modify field page_icon to pages table";
502
		echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
503
	}
511 504

  
512
/**********************************************************
505
	/**********************************************************
506
	 *  - Add field "page_code" to table "pages"
507
	 */
508
	$table_name = TABLE_PREFIX.'pages';
509
	$field_name = 'page_code';
510
	$description = "INT NOT NULL DEFAULT '0' AFTER `language`";
511
	if(!$database->field_exists($table_name,$field_name)) {
512
		echo "Adding field page_code to pages table";
513
		echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
514
	} else {
515
		echo "Modify field page_code to pages table";
516
		echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
517
	}
518

  
519
	/**********************************************************
513 520
 *  - Add field "menu_icon_0" to table "pages"
514 521
 */
515
echo "<br />Adding field menu_icon_0 to pages table<br />";
516
db_add_field('menu_icon_0', 'pages', "TEXT NOT NULL DEFAULT '' AFTER `menu_title`");
522
	$table_name = TABLE_PREFIX.'pages';
523
	$field_name = 'menu_icon_0';
524
	$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `menu_title`";
525
	if(!$database->field_exists($table_name,$field_name)) {
526
		echo "Adding field menu_icon_0 to pages table";
527
		echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
528
	} else {
529
		echo "Modify field menu_icon_0 to pages table";
530
		echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
531
	}
517 532

  
518
/**********************************************************
519
 *  - Add field "menu_icon_1" to table "mod_menu_link"
533
	/**********************************************************
534
	 *  - Add field "menu_icon_1" to table "pages"
520 535
 */
521
echo "<br />Adding field menu_icon_1 to pages table<br />";
522
db_add_field('menu_icon_1', 'pages', "TEXT NOT NULL DEFAULT '' AFTER `menu_icon_0`");
536
	$table_name = TABLE_PREFIX.'pages';
537
	$field_name = 'menu_icon_1';
538
	$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `menu_icon_0`";
539
	if(!$database->field_exists($table_name,$field_name)) {
540
		echo "Adding field menu_icon_1 to pages table";
541
		echo ($database->field_add($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
542
	} else {
543
		echo "Modify field menu_icon_1 to pages table";
544
		echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
545
	}
523 546

  
524
/**********************************************************
525
 *  - Update search no results database filed to create
526
 *  valid XHTML if search is empty
547
	/**********************************************************
548
	 *  - Add field "admin_groups" to table "pages"
527 549
 */
528
if (version_compare(WB_VERSION, '2.8', '<'))
529
{
530
    echo "<br />Updating database field `no_results` of search table: ";
531
    $search_no_results = addslashes('<tr><td><p>[TEXT_NO_RESULTS]</p></td></tr>');
532
    $sql  = 'UPDATE `'.TABLE_PREFIX.'search` ';
533
	$sql .= 'SET `value`=\''.$search_no_results.'\' ';
534
	$sql .= 'WHERE `name`=\'no_results\'';
535
    echo ($database->query($sql)) ? ' $OK<br />' : ' $FAIL<br />';
550
	$table_name = TABLE_PREFIX.'pages';
551
	$field_name = 'admin_groups';
552
	$description = "VARCHAR( 512 ) NOT NULL DEFAULT '1'";
553
	echo "Modify field admin_groups to pages table";
554
	echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
555

  
556
	/**********************************************************
557
	 *  - Add field "admin_users" to table "pages"
558
	 */
559
	$table_name = TABLE_PREFIX.'pages';
560
	$field_name = 'admin_users';
561
	$description = "VARCHAR( 512 ) NOT NULL DEFAULT ''";
562
	echo "Modify field admin_users to pages table";
563
	echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
564

  
565
	/**********************************************************
566
	 *  - Add field "viewing_groups" to table "pages"
567
	 */
568
	$table_name = TABLE_PREFIX.'pages';
569
	$field_name = 'viewing_groups';
570
	$description = "VARCHAR( 512 ) NOT NULL DEFAULT '1'";
571
	echo "Modify field viewing_groups to pages table";
572
	echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
573

  
574
	/**********************************************************
575
	 *  - Add field "viewing_users" to table "pages"
576
	 */
577
	$table_name = TABLE_PREFIX.'pages';
578
	$field_name = 'viewing_users';
579
	$description = "VARCHAR( 512 ) NOT NULL DEFAULT ''";
580
	echo "Modify field viewing_users to pages table";
581
	echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
536 582
}
583

  
537 584
/**********************************************************
538 585
 * upgrade media folder index protect files
586
 ALTER TABLE `wb_pages` CHANGE `page_icon` `page_icon` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''
539 587
 */
540 588
	$dir = (WB_PATH.MEDIA_DIRECTORY);
541 589
	echo '<h4>Upgrade '.MEDIA_DIRECTORY.'/ index.php protect files</h4><br />';
......
562 610
 * - check for deprecated / never needed files
563 611
 */
564 612
	if(sizeof($filesRemove)) {
565
		echo '<h2>Step '.(++$stepID).': Remove deprecated and old files</h2>';
613
		echo '<h3>Step '.(++$stepID).': Remove deprecated and old files</h3>';
566 614
	}
567 615
	$searches = array(
568 616
		'[ADMIN]',
......
618 666
 * - check for deprecated / never needed files
619 667
 */
620 668
	if(sizeof($dirRemove)) {
621
		echo '<h2>Step  '.(++$stepID).': Remove deprecated and old folders</h2>';
669
		echo '<h3>Step  '.(++$stepID).': Remove deprecated and old folders</h3>';
622 670
		$searches = array(
623 671
			'[ADMIN]',
624 672
			'[MEDIA]',
......
666 714
			$currModulVersion = get_modul_version ($sModul, false);
667 715
			$newModulVersion =  get_modul_version ($sModul, true);
668 716
			if((version_compare($currModulVersion, $newModulVersion) <= 0)) {
669
				echo '<h2>Step '.(++$stepID).' : Upgrade module \''.$sModul.'\' to version '.$newModulVersion.'</h2>';
717
				echo '<h3>Step '.(++$stepID).' : Upgrade module \''.$sModul.'\' to version '.$newModulVersion.'</h3>';
670 718
				require_once(WB_PATH.'/modules/'.$sModul.'/upgrade.php');
671 719
			}
672 720
		}
......
675 723
 *  - Reload all addons
676 724
 */
677 725

  
678
	echo '<h2>Step '.(++$stepID).' : Reload all addons database entry (no upgrade)</h2>';
726
	echo '<h3>Step '.(++$stepID).' : Reload all addons database entry (no upgrade)</h3>';
679 727
	////delete modules
680 728
	//$database->query("DELETE FROM ".TABLE_PREFIX."addons WHERE type = 'module'");
681 729
	// Load all modules
......
717 765
	echo '<br />Languages reloaded<br />';
718 766

  
719 767
/**********************************************************
768
 *  - install new droplets
769
	$drops = (!in_array ( "mod_droplets", $all_tables)) ? "<br />Install droplets<br />" : "<br />Upgrade droplets<br />";
770
	echo $drops;
771
	$file_name = (!in_array ( "mod_droplets", $all_tables) ? "install.php" : "upgrade.php");
772
	require_once (WB_PATH."/modules/droplets/".$file_name);
773
********************************************************** */
774

  
775
/**********************************************************
720 776
 *  - End of upgrade script
721 777
 */
722

  
723
// require(WB_PATH.'/framework/initialize.php');
724

  
725 778
	if(!defined('DEFAULT_THEME')) { define('DEFAULT_THEME', $DEFAULT_THEME); }
726 779
	if(!defined('THEME_PATH')) { define('THEME_PATH', WB_PATH.'/templates/'.DEFAULT_THEME);}
727 780
/**********************************************************
728 781
 *  - Set Version to new Version
729 782
 */
730
	echo '<br />Update database version number to '.VERSION.' '.SP.' '.' Revision ['.REVISION.'] : ';
731
	// echo ($database->query("UPDATE `".TABLE_PREFIX."settings` SET `value`='".VERSION."' WHERE `name` = 'wb_version'")) ? " $OK<br />" : " $FAIL<br />";
732
	db_update_key_value('settings', 'wb_version', VERSION);
733
	db_update_key_value('settings', 'wb_revision', REVISION);
734
	db_update_key_value('settings', 'wb_sp', SP);
783
echo '<br />Update database version number to '.VERSION.' '.SP.' '.' Revision ['.REVISION.'] : ';
735 784

  
785
$cfg = array(
786
	'wb_version' => VERSION,
787
	'wb_revision' => REVISION,
788
	'wb_sp' => SP
789
);
790

  
791
echo (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
792

  
736 793
	echo '<p style="font-size:120%;"><strong>Congratulations: The upgrade script is finished ...</strong></p>';
737 794
	status_msg('<strong>Warning:</strong><br />Please delete the file <strong>upgrade-script.php</strong> via FTP before proceeding.', 'warning', 'div');
738 795
	// show buttons to go to the backend or frontend
branches/2.8.x/wb/admin/interface/version.php
51 51

  
52 52
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
53 53
if(!defined('VERSION')) define('VERSION', '2.8.3');
54
if(!defined('REVISION')) define('REVISION', '1670');
54
if(!defined('REVISION')) define('REVISION', '1671');
55 55
if(!defined('SP')) define('SP', '');
branches/2.8.x/wb/install/save.php
401 401
	       . ' `parent` INT NOT NULL DEFAULT \'0\','
402 402
	       . ' `root_parent` INT NOT NULL DEFAULT \'0\','
403 403
	       . ' `level` INT NOT NULL DEFAULT \'0\','
404
	       . ' `link` TEXT NOT NULL,'
404
	       . ' `link` VARCHAR( 255 ) NOT NULL,'
405 405
	       . ' `target` VARCHAR( 7 ) NOT NULL DEFAULT \'\' ,'
406 406
	       . ' `page_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
407
		   . ' `page_icon` TEXT NOT NULL DEFAULT \'/templates/*/title_images\' ,'
407
		   . ' `page_icon` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
408 408
	       . ' `menu_title` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
409
		   . ' `menu_icon_0` TEXT NOT NULL DEFAULT \'\' ,'
410
		   . ' `menu_icon_1` TEXT NOT NULL DEFAULT \'\' ,'
409
		   . ' `menu_icon_0` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
410
		   . ' `menu_icon_1` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
411 411
	       . ' `description` TEXT NOT NULL ,'
412 412
	       . ' `keywords` TEXT NOT NULL ,'
413
	       . ' `page_trail` TEXT NOT NULL  ,'
413
	       . ' `page_trail` VARCHAR( 255 ) NOT NULL  ,'
414 414
	       . ' `template` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
415 415
	       . ' `visibility` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
416 416
	       . ' `position` INT NOT NULL DEFAULT \'0\','
417 417
	       . ' `menu` INT NOT NULL DEFAULT \'0\','
418 418
	       . ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,'
419
	       . ' `page_code` INT NOT NULL DEFAULT \'0\','
419 420
	       . ' `searching` INT NOT NULL DEFAULT \'0\','
420
	       . ' `admin_groups` TEXT NOT NULL DEFAULT \'1\' ,'
421
	       . ' `admin_users` TEXT NOT NULL ,'
422
	       . ' `viewing_groups` TEXT NOT NULL DEFAULT \'1\' ,'
423
	       . ' `viewing_users` TEXT NOT NULL ,'
421
	       . ' `admin_groups` VARCHAR( 512 ) NOT NULL DEFAULT \'1\' ,'
422
	       . ' `admin_users` VARCHAR( 512 ) NOT NULL ,'
423
	       . ' `viewing_groups` VARCHAR( 512 ) NOT NULL DEFAULT \'1\' ,'
424
	       . ' `viewing_users` VARCHAR( 512 ) NOT NULL ,'
424 425
	       . ' `modified_when` INT NOT NULL DEFAULT \'0\','
425 426
	       . ' `modified_by` INT NOT NULL  DEFAULT \'0\','
426 427
	       . ' PRIMARY KEY ( `page_id` ) '
427 428
	       . ' ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci';
428
	$database->query($pages);
429
	if(!$database->query($pages)) {
430
	}
429 431
	
430 432
	// Sections table
431 433
	$pages = 'CREATE TABLE `'.TABLE_PREFIX.'sections` ( `section_id` INT NOT NULL auto_increment,'

Also available in: Unified diff