Revision 109
Added by stefan about 19 years ago
trunk/wb/install/save.php | ||
---|---|---|
403 | 403 |
. ' '; |
404 | 404 |
$database->query($pages); |
405 | 405 |
|
406 |
require(WB_PATH.'/admin/interface/version.php'); |
|
407 |
|
|
406 | 408 |
// Settings table |
407 | 409 |
$settings="CREATE TABLE `".TABLE_PREFIX."settings` ( `setting_id` INT NOT NULL auto_increment, |
408 | 410 |
`name` VARCHAR( 255 ) NOT NULL , |
409 | 411 |
`value` TEXT NOT NULL , |
410 | 412 |
PRIMARY KEY ( `setting_id` ) )"; |
411 | 413 |
$database->query($settings); |
412 |
$settings_rows= "INSERT INTO `".TABLE_PREFIX."settings` VALUES ('', 'website_title', '$website_title')," |
|
414 |
$settings_rows= "INSERT INTO `".TABLE_PREFIX."settings` VALUES " |
|
415 |
." ('', 'wb_version', '".VERSION."')," |
|
416 |
." ('', 'website_title', '$website_title')," |
|
413 | 417 |
." ('', 'website_description', '')," |
414 | 418 |
." ('', 'website_keywords', '')," |
415 | 419 |
." ('', 'website_header', '')," |
trunk/wb/admin/settings/save.php | ||
---|---|---|
124 | 124 |
while($setting = $results->fetchRow()) { |
125 | 125 |
$setting_name = $setting['name']; |
126 | 126 |
$value = $admin->get_post($setting_name); |
127 |
$value = $admin->add_slashes($value); |
|
128 |
switch ($setting_name) { |
|
129 |
case 'default_timezone': |
|
130 |
$value=$value*60*60; |
|
131 |
break; |
|
132 |
case 'string_dir_mode': |
|
133 |
$value=$dir_mode; |
|
134 |
break; |
|
135 |
case 'string_file_mode': |
|
136 |
$value=$file_mode; |
|
137 |
break; |
|
127 |
if ($value!=null) { |
|
128 |
$value = $admin->add_slashes($value); |
|
129 |
switch ($setting_name) { |
|
130 |
case 'default_timezone': |
|
131 |
$value=$value*60*60; |
|
132 |
break; |
|
133 |
case 'string_dir_mode': |
|
134 |
$value=$dir_mode; |
|
135 |
break; |
|
136 |
case 'string_file_mode': |
|
137 |
$value=$file_mode; |
|
138 |
break; |
|
139 |
} |
|
140 |
//echo $setting_name.':'.$value."<br />"; |
|
141 |
$database->query("UPDATE ".TABLE_PREFIX."settings SET value = '$value' WHERE name = '$setting_name'"); |
|
138 | 142 |
} |
139 |
//echo $setting_name.':'.$value."<br />"; |
|
140 |
$database->query("UPDATE ".TABLE_PREFIX."settings SET value = '$value' WHERE name = '$setting_name'"); |
|
141 | 143 |
} |
142 | 144 |
|
143 | 145 |
// Query current search settings in the db, then loop through them and update the db with the new value |
Also available in: Unified diff
Added new setting 'wb_version' which is not changeable in admin>>settings but allows for easier upgrade scripts in the future.