1 |
4
|
ryan
|
<?php
|
2 |
|
|
|
3 |
213
|
stefan
|
// $Id$
|
4 |
4
|
ryan
|
|
5 |
|
|
/*
|
6 |
|
|
|
7 |
|
|
Website Baker Project <http://www.websitebaker.org/>
|
8 |
915
|
Ruebenwurz
|
Copyright (C) 2004-2009, Ryan Djurovich
|
9 |
4
|
ryan
|
|
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 |
|
|
Date format list file
|
29 |
|
|
|
30 |
|
|
This file is used to generate a list of date formats for the user to select
|
31 |
|
|
|
32 |
|
|
*/
|
33 |
|
|
|
34 |
231
|
ryan
|
if(!defined('WB_URL')) {
|
35 |
1059
|
aldus
|
header('Location: ../../../index.php');
|
36 |
286
|
stefan
|
exit(0);
|
37 |
231
|
ryan
|
}
|
38 |
|
|
|
39 |
4
|
ryan
|
// Define that this file is loaded
|
40 |
|
|
if(!defined('DATE_FORMATS_LOADED')) {
|
41 |
|
|
define('DATE_FORMATS_LOADED', true);
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
// Create array
|
45 |
|
|
$DATE_FORMATS = array();
|
46 |
|
|
|
47 |
|
|
// Get the current time (in the users timezone if required)
|
48 |
1059
|
aldus
|
$actual_time = time()+ ((isset($user_time) AND $user_time == true) ? TIMEZONE : DEFAULT_TIMEZONE);
|
49 |
4
|
ryan
|
|
50 |
|
|
// Add values to list
|
51 |
1059
|
aldus
|
$DATE_FORMATS['l,|jS|F,|Y'] = gmdate('l, jS F, Y', $actual_time);
|
52 |
|
|
$DATE_FORMATS['jS|F,|Y'] = gmdate('jS F, Y', $actual_time);
|
53 |
|
|
$DATE_FORMATS['d|M|Y'] = gmdate('d M Y', $actual_time);
|
54 |
|
|
$DATE_FORMATS['M|d|Y'] = gmdate('M d Y', $actual_time);
|
55 |
|
|
$DATE_FORMATS['D|M|d,|Y'] = gmdate('D M d, Y', $actual_time);
|
56 |
|
|
$DATE_FORMATS['d-m-Y'] = gmdate('d-m-Y', $actual_time).' (D-M-Y)';
|
57 |
|
|
$DATE_FORMATS['m-d-Y'] = gmdate('m-d-Y', $actual_time).' (M-D-Y)';
|
58 |
|
|
$DATE_FORMATS['d.m.Y'] = gmdate('d.m.Y', $actual_time).' (D.M.Y)';
|
59 |
|
|
$DATE_FORMATS['m.d.Y'] = gmdate('m.d.Y', $actual_time).' (M.D.Y)';
|
60 |
|
|
$DATE_FORMATS['d/m/Y'] = gmdate('d/m/Y', $actual_time).' (D/M/Y)';
|
61 |
|
|
$DATE_FORMATS['m/d/Y'] = gmdate('m/d/Y', $actual_time).' (M/D/Y)';
|
62 |
4
|
ryan
|
|
63 |
|
|
// Add "System Default" to list (if we need to)
|
64 |
|
|
if(isset($user_time) AND $user_time == true) {
|
65 |
|
|
if(isset($TEXT['SYSTEM_DEFAULT'])) {
|
66 |
1059
|
aldus
|
$DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $actual_time).' ('.$TEXT['SYSTEM_DEFAULT'].')';
|
67 |
4
|
ryan
|
} else {
|
68 |
1059
|
aldus
|
$DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $actual_time).' (System Default)';
|
69 |
4
|
ryan
|
}
|
70 |
|
|
}
|
71 |
|
|
|
72 |
|
|
// Reverse array so "System Default" is at the top
|
73 |
|
|
$DATE_FORMATS = array_reverse($DATE_FORMATS, true);
|
74 |
|
|
|
75 |
|
|
?>
|