Project

General

Profile

« Previous | Next » 

Revision 544

Added by thorn almost 17 years ago

changed admin/pages/save.php to allow hidden config-elements in table search

View differences:

save.php
143 143
}
144 144

  
145 145
// Query current search settings in the db, then loop through them and update the db with the new value
146
$query = "SELECT name FROM ".TABLE_PREFIX."search WHERE extra = ''";
146
$query = "SELECT name, value FROM ".TABLE_PREFIX."search WHERE extra = ''";
147 147
$results = $database->query($query);
148 148
while($search_setting = $results->fetchRow()) {
149
	$old_value = $search_setting['value'];
149 150
	$setting_name = $search_setting['name'];
150 151
	$post_name = 'search_'.$search_setting['name'];
151
	$value = $admin->get_post($post_name);
152
	if($admin->get_post($post_name) == '')
153
		$value = $old_value;
154
	else
155
		$value = $admin->get_post($post_name);
152 156
	$value = $admin->add_slashes($value);
153 157
	$database->query("UPDATE ".TABLE_PREFIX."search SET value = '$value' WHERE name = '$setting_name'");
154 158
}
......
163 167
$admin->print_success($MESSAGE['SETTINGS']['SAVED'], ADMIN_URL.'/settings/index.php'.$advanced);
164 168
$admin->print_footer();
165 169

  
166
?>
170
?>

Also available in: Unified diff