Project

General

Profile

1
<?php
2

    
3
// $Id: time_formats.php 231 2005-11-20 10:56:13Z ryan $
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
/*
27

    
28
Time format list file
29

    
30
This file is used to generate a list of time formats for the user to select
31

    
32
*/
33

    
34
if(!defined('WB_URL')) {
35
	header('Location: ../index.php');
36
}
37

    
38
// Define that this file is loaded
39
if(!defined('TIME_FORMATS_LOADED')) {
40
	define('TIME_FORMATS_LOADED', true);
41
}
42

    
43
// Create array
44
$TIME_FORMATS = array();
45

    
46
// Get the current time (in the users timezone if required)
47
if(isset($user_time) AND $user_time == true) {
48
	$mktime = mktime()+TIMEZONE;
49
} else {
50
	$mktime = mktime()+DEFAULT_TIMEZONE;
51
}
52

    
53
// Add values to list
54
$TIME_FORMATS['g:i|A'] = gmdate('g:i A', $mktime);
55
$TIME_FORMATS['g:i|a'] = gmdate('g:i a', $mktime);
56
$TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $mktime);
57
$TIME_FORMATS['H:i'] = gmdate('H:i', $mktime);
58

    
59
// Add "System Default" to list (if we need to)
60
if(isset($user_time) AND $user_time == true) {
61
	if(isset($TEXT['SYSTEM_DEFAULT'])) {
62
		$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')';
63
	} else {
64
		$TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' (System Default)';
65
	}
66
}
67

    
68
// Reverse array so "System Default" is at the top
69
$TIME_FORMATS = array_reverse($TIME_FORMATS, true);
70

    
71
?>
(11-11/13)