Revision 1503
Added by Luisehahne over 14 years ago
| upgrade.php | ||
|---|---|---|
| 16 | 16 |
* @lastmodified $Date$ |
| 17 | 17 |
* |
| 18 | 18 |
*/ |
| 19 |
/* -------------------------------------------------------- */ |
|
| 20 |
// Must include code to stop this file being accessed directly |
|
| 21 |
if(!defined('WB_PATH')) {
|
|
| 19 | 22 |
|
| 20 |
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
|
|
| 23 |
require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php'); |
|
| 24 |
throw new IllegalFileException(); |
|
| 25 |
} |
|
| 26 |
/* -------------------------------------------------------- */ |
|
| 21 | 27 |
|
| 22 |
$table = TABLE_PREFIX .'mod_droplets'; |
|
| 23 |
|
|
| 24 |
$info = $database->query("SELECT * from `$table` limit 0,1" );
|
|
| 25 |
$fields = $info->fetchRow(); |
|
| 26 |
if (!array_key_exists("admin_edit", $fields)) {
|
|
| 27 |
/** |
|
| 28 |
* Call from the upgrade-script |
|
| 29 |
*/ |
|
| 30 |
|
|
| 31 |
if (function_exists('db_add_field')) {
|
|
| 32 |
db_add_field("admin_edit", 'mod_droplets', "INT NOT NULL default '0'");
|
|
| 33 |
db_add_field("admin_view", 'mod_droplets', "INT NOT NULL default '0'");
|
|
| 34 |
db_add_field("show_wysiwyg", 'mod_droplets', "INT NOT NULL default '0'");
|
|
| 35 |
} else {
|
|
| 36 |
/** |
|
| 37 |
* Not call by the upgrade-script |
|
| 38 |
*/ |
|
| 39 |
$database->query("ALTER TABLE `$table` (
|
|
| 40 |
`admin_edit` INT NOT NULL default '0', |
|
| 41 |
`admin_view` INT NOT NULL default '0', |
|
| 42 |
`show_wysiwyg` INT NOT NULL default '0' |
|
| 43 |
)"); |
|
| 44 |
} |
|
| 45 |
} |
|
| 46 |
?> |
|
| 28 |
$table_name = TABLE_PREFIX .'mod_droplets'; |
|
| 29 |
$description = 'INT NOT NULL default 0 '; |
|
| 30 |
$database->field_add($table_name,'show_wysiwyg',$description.'AFTER `active`' ); |
|
| 31 |
$database->field_add($table_name,'admin_view',$description.'AFTER `active`' ); |
|
| 32 |
$database->field_add($table_name,'admin_edit',$description.'AFTER `active`' ); |
|
Also available in: Unified diff
change sql statements to strict in module droplets
fix vars in compatibility mode for versions before 2.8.1 in frontend.functions.php