Project

General

Profile

1
<?php
2

    
3
// $Id: upgrade.php 997 2009-06-17 10:27:56Z aldus $
4

    
5
/*
6
*	@version	1.0
7
*	@author		Ruud Eisinga (Ruud) John (PCWacht)
8
*	@date		June 2009
9
*
10
*
11
*	droplets are small codeblocks that are called from anywhere in the template. 
12
* 	To call a droplet just use [[dropletname]]. optional parameters for a droplet can be used like [[dropletname?parameter=value&parameter2=value]]
13
*/
14

    
15
if(!defined('WB_PATH')) die(header('Location: ../../index.php'));
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("admin_edit", $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
}
41
?>
(13-13/13)