Project

General

Profile

« Previous | Next » 

Revision 275

Added by stefan almost 19 years ago

Replace 'admin' by 'wb' in all account pages. Moved print_success and print_error code to class.wb.php. Added correct parameters to these functions in account pages.

View differences:

details.php
28 28
}
29 29

  
30 30
// Get entered values
31
$display_name = $admin->get_post('display_name');
32
$language = $admin->get_post('language');
33
$timezone = $admin->get_post('timezone')*60*60;
34
$date_format = $admin->get_post('date_format');
35
$time_format = $admin->get_post('time_format');
31
$display_name = $wb->get_post('display_name');
32
$language = $wb->get_post('language');
33
$timezone = $wb->get_post('timezone')*60*60;
34
$date_format = $wb->get_post('date_format');
35
$time_format = $wb->get_post('time_format');
36 36

  
37 37
// Create a javascript back link
38 38
$js_back = "javascript: history.go(-1);";
39 39

  
40 40
// Update the database
41 41
$database = new database();
42
$query = "UPDATE ".TABLE_PREFIX."users SET display_name = '$display_name', language = '$language', timezone = '$timezone', date_format = '$date_format', time_format = '$time_format' WHERE user_id = '".$admin->get_user_id()."'";
42
$query = "UPDATE ".TABLE_PREFIX."users SET display_name = '$display_name', language = '$language', timezone = '$timezone', date_format = '$date_format', time_format = '$time_format' WHERE user_id = '".$wb->get_user_id()."'";
43 43
$database->query($query);
44 44
if($database->is_error()) {
45
	$admin->print_error($database->get_error);
45
	$wb->print_error($database->get_error,'index.php',false);
46 46
} else {
47
	$admin->print_success($MESSAGE['PREFERENCES']['DETAILS_SAVED'], WB_URL.'/account/preferences'.PAGE_EXTENSION);
47
	$wb->print_success($MESSAGE['PREFERENCES']['DETAILS_SAVED'], WB_URL.'/account/preferences'.PAGE_EXTENSION);
48 48
	$_SESSION['DISPLAY_NAME'] = $display_name;
49 49
	$_SESSION['LANGUAGE'] = $language;
50 50
	$_SESSION['TIMEZONE'] = $timezone;

Also available in: Unified diff