Revision 995
Added by aldus over 15 years ago
upgrade.php | ||
---|---|---|
12 | 12 |
* To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value¶meter2=value]] |
13 | 13 |
*/ |
14 | 14 |
|
15 |
if(!defined('WB_PATH')) { exit("Cannot access this file directly"); }
|
|
15 |
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
|
|
16 | 16 |
|
17 |
$table = TABLE_PREFIX .'mod_droplets'; |
|
18 |
|
|
19 |
$info = $database->query("SELECT * from `$table` limit 0,1" ); |
|
20 |
$fields = $info->fetchRow(); |
|
21 |
if (!array_key_exists("look_for_it", $fields)) { |
|
22 |
/** |
|
23 |
* Call from the upgrade-script |
|
24 |
*/ |
|
25 |
|
|
26 |
if (function_exists('db_add_field')) { |
|
27 |
db_add_field($table, "admin_edit", "INT NOT NULL default '0'"); |
|
28 |
db_add_field($table, "admin_view", "INT NOT NULL default '0'"); |
|
29 |
db_add_field($table, "show_wysiwyg", "INT NOT NULL default '0'"); |
|
30 |
} else { |
|
31 |
/** |
|
32 |
* Not call by the upgrade-script |
|
33 |
*/ |
|
34 |
$database->query("ALTER TABLE `$table` ( |
|
35 |
`admin_edit` INT NOT NULL default '0', |
|
36 |
`admin_view` INT NOT NULL default '0', |
|
37 |
`show_wysiwyg` INT NOT NULL default '0' |
|
38 |
)"; |
|
39 |
} |
|
40 |
} |
|
17 | 41 |
?> |
Also available in: Unified diff
update upgrade-script to avoid droping droplet-tables if the modul still exists. Add an upgrade-script to the droplets.