| 
      1
     | 
    
      <?php
 
     | 
  
  
    | 
      2
     | 
    
      
 
     | 
  
  
    | 
      3
     | 
    
      // $Id: details.php 17 2005-09-04 16:07:33Z stefan $
 
     | 
  
  
    | 
      4
     | 
    
      
 
     | 
  
  
    | 
      5
     | 
    
      /*
 
     | 
  
  
    | 
      6
     | 
    
      
 
     | 
  
  
    | 
      7
     | 
    
       Website Baker Project <http://www.websitebaker.org/>
 
     | 
  
  
    | 
      8
     | 
    
       Copyright (C) 2004-2005, Ryan Djurovich
 
     | 
  
  
    | 
      9
     | 
    
      
 
     | 
  
  
    | 
      10
     | 
    
       Website Baker is free software; you can redistribute it and/or modify
 
     | 
  
  
    | 
      11
     | 
    
       it under the terms of the GNU General Public License as published by
 
     | 
  
  
    | 
      12
     | 
    
       the Free Software Foundation; either version 2 of the License, or
 
     | 
  
  
    | 
      13
     | 
    
       (at your option) any later version.
 
     | 
  
  
    | 
      14
     | 
    
      
 
     | 
  
  
    | 
      15
     | 
    
       Website Baker is distributed in the hope that it will be useful,
 
     | 
  
  
    | 
      16
     | 
    
       but WITHOUT ANY WARRANTY; without even the implied warranty of
 
     | 
  
  
    | 
      17
     | 
    
       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
     | 
  
  
    | 
      18
     | 
    
       GNU General Public License for more details.
 
     | 
  
  
    | 
      19
     | 
    
      
 
     | 
  
  
    | 
      20
     | 
    
       You should have received a copy of the GNU General Public License
 
     | 
  
  
    | 
      21
     | 
    
       along with Website Baker; if not, write to the Free Software
 
     | 
  
  
    | 
      22
     | 
    
       Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
     | 
  
  
    | 
      23
     | 
    
      
 
     | 
  
  
    | 
      24
     | 
    
      */
 
     | 
  
  
    | 
      25
     | 
    
      
 
     | 
  
  
    | 
      26
     | 
    
      if(!defined('WB_URL')) {
     | 
  
  
    | 
      27
     | 
    
      	header('Location: ../pages/index.php');
     | 
  
  
    | 
      28
     | 
    
      }
 
     | 
  
  
    | 
      29
     | 
    
      
 
     | 
  
  
    | 
      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');
     | 
  
  
    | 
      36
     | 
    
      
 
     | 
  
  
    | 
      37
     | 
    
      // Create a javascript back link
 
     | 
  
  
    | 
      38
     | 
    
      $js_back = "javascript: history.go(-1);";
 
     | 
  
  
    | 
      39
     | 
    
      
 
     | 
  
  
    | 
      40
     | 
    
      // Update the database
 
     | 
  
  
    | 
      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()."'";
 
     | 
  
  
    | 
      43
     | 
    
      $database->query($query);
 
     | 
  
  
    | 
      44
     | 
    
      if($database->is_error()) {
     | 
  
  
    | 
      45
     | 
    
      	$admin->print_error($database->get_error);
 
     | 
  
  
    | 
      46
     | 
    
      } else {
     | 
  
  
    | 
      47
     | 
    
      	$admin->print_success($MESSAGE['PREFERENCES']['DETAILS_SAVED'], WB_URL.'/account/preferences'.PAGE_EXTENSION);
 
     | 
  
  
    | 
      48
     | 
    
      	$_SESSION['DISPLAY_NAME'] = $display_name;
 
     | 
  
  
    | 
      49
     | 
    
      	$_SESSION['LANGUAGE'] = $language;
 
     | 
  
  
    | 
      50
     | 
    
      	$_SESSION['TIMEZONE'] = $timezone;
 
     | 
  
  
    | 
      51
     | 
    
      	// Update date format
 
     | 
  
  
    | 
      52
     | 
    
      	if($date_format != '') {
     | 
  
  
    | 
      53
     | 
    
      		$_SESSION['DATE_FORMAT'] = $date_format;
 
     | 
  
  
    | 
      54
     | 
    
      		if(isset($_SESSION['USE_DEFAULT_DATE_FORMAT'])) { unset($_SESSION['USE_DEFAULT_DATE_FORMAT']); }
     | 
  
  
    | 
      55
     | 
    
      	} else {
     | 
  
  
    | 
      56
     | 
    
      		$_SESSION['USE_DEFAULT_DATE_FORMAT'] = true;
 
     | 
  
  
    | 
      57
     | 
    
      		if(isset($_SESSION['DATE_FORMAT'])) { unset($_SESSION['DATE_FORMAT']); }
     | 
  
  
    | 
      58
     | 
    
      	}
 
     | 
  
  
    | 
      59
     | 
    
      	// Update time format
 
     | 
  
  
    | 
      60
     | 
    
      	if($time_format != '') {
     | 
  
  
    | 
      61
     | 
    
      		$_SESSION['TIME_FORMAT'] = $time_format;
 
     | 
  
  
    | 
      62
     | 
    
      		if(isset($_SESSION['USE_DEFAULT_TIME_FORMAT'])) { unset($_SESSION['USE_DEFAULT_TIME_FORMAT']); }
     | 
  
  
    | 
      63
     | 
    
      	} else {
     | 
  
  
    | 
      64
     | 
    
      		$_SESSION['USE_DEFAULT_TIME_FORMAT'] = true;
 
     | 
  
  
    | 
      65
     | 
    
      		if(isset($_SESSION['TIME_FORMAT'])) { unset($_SESSION['TIME_FORMAT']); }
     | 
  
  
    | 
      66
     | 
    
      	}
 
     | 
  
  
    | 
      67
     | 
    
      }
 
     | 
  
  
    | 
      68
     | 
    
      
 
     | 
  
  
    | 
      69
     | 
    
      ?>
 
     |