Ticket #397: timezone-extensions.patch.txt

File timezone-extensions.patch.txt, 41.3 kB (added by Jelmer, 1 year ago)
Line 
1 diff -Naur websitebaker-2.6.5/wb/account/details.php websitebaker-2.6.5.timezone-extensions/wb/account/details.php
2 --- websitebaker-2.6.5/wb/account/details.php   2006-12-24 08:50:44.000000000 +0100
3 +++ websitebaker-2.6.5.timezone-extensions/wb/account/details.php   2007-05-25 16:17:45.000000000 +0200
4 @@ -31,7 +31,18 @@
5  // Get entered values
6  $display_name = $wb->add_slashes(strip_tags($wb->get_post('display_name')));
7  $language = $wb->get_post('language');
8 -$timezone = $wb->get_post('timezone')*60*60;
9 +//timezone.extensions.php change!
10 +   //When using the new timezone framework, the timezone value will not be
11 +   //integer. In that case $value will just be saved (being a string)
12 +   // Spin in het web, 20070525
13 +   
14 +   //old code:
15 +       //$timezone = $wb->get_post('timezone')*60*60;
16 +   //new code:
17 +           $timezone = $wb->get_post('timezone');
18 +           if (is_numeric($timezone))
19 +               $timezone = $timezone*60*60;
20 +//end timezone.extensions.php change
21  $date_format = $wb->get_post('date_format');
22  $time_format = $wb->get_post('time_format');
23  
24 diff -Naur websitebaker-2.6.5/wb/account/preferences_form.php websitebaker-2.6.5.timezone-extensions/wb/account/preferences_form.php
25 --- websitebaker-2.6.5/wb/account/preferences_form.php  2006-12-24 08:50:44.000000000 +0100
26 +++ websitebaker-2.6.5.timezone-extensions/wb/account/preferences_form.php  2007-05-25 16:58:35.000000000 +0200
27 @@ -78,9 +78,28 @@
28             <option value="-20"><?php echo $TEXT['PLEASE_SELECT']; ?>...</option>
29             <?php
30             // Insert default timezone values
31 -           require_once(ADMIN_PATH.'/interface/timezones.php');
32 +           //timezone.extensions.php change!
33 +               //We use a call that selects between php < 5.1 and above
34 +               // Spin in het web, 20070525
35 +               
36 +               //old code:
37 +                   //require_once(ADMIN_PATH.'/interface/timezones.php');
38 +               //new code:
39 +                   set_TIMEZONES();
40 +                   global $TIMEZONES;
41 +           //end timezone.extensions.php change
42 +           
43             foreach($TIMEZONES AS $hour_offset => $title) {
44 -               if($wb->get_timezone() == $hour_offset*60*60) {
45 +           //timezone.extensions.php change!
46 +               //$hour_offset is a name when using new timezone code (EXCEPT for the standard value -20), otherwise a numeric string
47 +               //when it is a string, we should not do the hour->second conversion like with numeric
48 +               // Spin in het web, 20070525
49 +                   
50 +               //old code
51 +                   //if($wb->get_timezone() == $hour_offset*60*60) {
52 +               //new code
53 +               if ((is_numeric($hour_offset) && $wb->get_timezone() == $hour_offset*60*60) || ((! is_numeric($hour_offset)) && $wb->get_timezone() == $hour_offset)) {
54 +               //end timezone.extensions.php change
55                     ?>
56                     <option value="<?php echo $hour_offset; ?>" selected><?php echo $title; ?></option>
57                     <?php
58 diff -Naur websitebaker-2.6.5/wb/admin/interface/date_formats.php websitebaker-2.6.5.timezone-extensions/wb/admin/interface/date_formats.php
59 --- websitebaker-2.6.5/wb/admin/interface/date_formats.php  2006-12-24 08:50:44.000000000 +0100
60 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/interface/date_formats.php  2007-05-29 15:19:17.000000000 +0200
61 @@ -31,6 +31,12 @@
62  
63  */
64  
65 +//timezone.extensions.php change!
66 +//we made a lot of changes to this file. We no longer use mktime to make time and add TIMEZONE.
67 +//instead, we use the new wbdate call to create a date using the current TIMEZONE
68 +//problem with this is that date will allways be displayed in the current user's timezone, but well
69 +
70 +
71  if(!defined('WB_URL')) {
72     header('Location: ../index.php');
73     exit(0);
74 @@ -44,34 +50,66 @@
75  // Create array
76  $DATE_FORMATS = array();
77  
78 +//timezone.extensions.php change
79 +//this code removed:
80 +/*
81  // Get the current time (in the users timezone if required)
82  if(isset($user_time) AND $user_time == true) {
83     $mktime = mktime()+TIMEZONE;
84  } else {
85     $mktime = mktime()+DEFAULT_TIMEZONE;
86  }
87 +*/
88 +//end timezone.extensions.php change
89  
90  // Add values to list
91 -$DATE_FORMATS['l,|jS|F,|Y'] = gmdate('l, jS F, Y', $mktime);
92 -$DATE_FORMATS['jS|F,|Y'] = gmdate('jS F, Y', $mktime);
93 -$DATE_FORMATS['d|M|Y'] = gmdate('d M Y', $mktime);
94 -$DATE_FORMATS['M|d|Y'] = gmdate('M d Y', $mktime);
95 -$DATE_FORMATS['D|M|d,|Y'] = gmdate('D M d, Y', $mktime);
96 -$DATE_FORMATS['d-m-Y'] = gmdate('d-m-Y', $mktime).' (D-M-Y)';
97 -$DATE_FORMATS['m-d-Y'] = gmdate('m-d-Y', $mktime).' (M-D-Y)';
98 -$DATE_FORMATS['d.m.Y'] = gmdate('d.m.Y', $mktime).' (D.M.Y)';
99 -$DATE_FORMATS['m.d.Y'] = gmdate('m.d.Y', $mktime).' (M.D.Y)';
100 -$DATE_FORMATS['d/m/Y'] = gmdate('d/m/Y', $mktime).' (D/M/Y)';
101 -$DATE_FORMATS['m/d/Y'] = gmdate('m/d/Y', $mktime).' (M/D/Y)';
102  
103 -// Add "System Default" to list (if we need to)
104 -if(isset($user_time) AND $user_time == true) {
105 -   if(isset($TEXT['SYSTEM_DEFAULT'])) {
106 -       $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')';
107 -   } else {
108 -       $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' (System Default)';
109 -   }
110 -}
111 +//timezone.extensions.php change
112 +   //old code:
113 +   /*
114 +       $DATE_FORMATS['l,|jS|F,|Y'] = gmdate('l, jS F, Y', $mktime);
115 +       $DATE_FORMATS['jS|F,|Y'] = gmdate('jS F, Y', $mktime);
116 +       $DATE_FORMATS['d|M|Y'] = gmdate('d M Y', $mktime);
117 +       $DATE_FORMATS['M|d|Y'] = gmdate('M d Y', $mktime);
118 +       $DATE_FORMATS['D|M|d,|Y'] = gmdate('D M d, Y', $mktime);
119 +       $DATE_FORMATS['d-m-Y'] = gmdate('d-m-Y', $mktime).' (D-M-Y)';
120 +       $DATE_FORMATS['m-d-Y'] = gmdate('m-d-Y', $mktime).' (M-D-Y)';
121 +       $DATE_FORMATS['d.m.Y'] = gmdate('d.m.Y', $mktime).' (D.M.Y)';
122 +       $DATE_FORMATS['m.d.Y'] = gmdate('m.d.Y', $mktime).' (M.D.Y)';
123 +       $DATE_FORMATS['d/m/Y'] = gmdate('d/m/Y', $mktime).' (D/M/Y)';
124 +       $DATE_FORMATS['m/d/Y'] = gmdate('m/d/Y', $mktime).' (M/D/Y)';
125 +       
126 +       // Add "System Default" to list (if we need to)
127 +       if(isset($user_time) AND $user_time == true) {
128 +           if(isset($TEXT['SYSTEM_DEFAULT'])) {
129 +               $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' ('.$TEXT['SYSTEM_DEFAULT'].')';
130 +           } else {
131 +               $DATE_FORMATS['system_default'] = gmdate(DEFAULT_DATE_FORMAT, $mktime).' (System Default)';
132 +           }
133 +       }
134 +   */
135 +   //new code:
136 +       $DATE_FORMATS['l,|jS|F,|Y'] = wbdate('l, jS F, Y');
137 +       $DATE_FORMATS['jS|F,|Y'] = wbdate('jS F, Y');
138 +       $DATE_FORMATS['d|M|Y'] = wbdate('d M Y');
139 +       $DATE_FORMATS['M|d|Y'] = wbdate('M d Y');
140 +       $DATE_FORMATS['D|M|d,|Y'] = wbdate('D M d, Y');
141 +       $DATE_FORMATS['d-m-Y'] = wbdate('d-m-Y').' (D-M-Y)';
142 +       $DATE_FORMATS['m-d-Y'] = wbdate('m-d-Y').' (M-D-Y)';
143 +       $DATE_FORMATS['d.m.Y'] = wbdate('d.m.Y').' (D.M.Y)';
144 +       $DATE_FORMATS['m.d.Y'] = wbdate('m.d.Y').' (M.D.Y)';
145 +       $DATE_FORMATS['d/m/Y'] = wbdate('d/m/Y').' (D/M/Y)';
146 +       $DATE_FORMATS['m/d/Y'] = wbdate('m/d/Y').' (M/D/Y)';
147 +       
148 +       // Add "System Default" to list (if we need to)
149 +       if(isset($user_time) AND $user_time == true) {
150 +           if(isset($TEXT['SYSTEM_DEFAULT'])) {
151 +               $DATE_FORMATS['system_default'] = wbdate(DEFAULT_DATE_FORMAT).' ('.$TEXT['SYSTEM_DEFAULT'].')';
152 +           } else {
153 +               $DATE_FORMATS['system_default'] = wbdate(DEFAULT_DATE_FORMAT).' (System Default)';
154 +           }
155 +       }
156 +//end timezone.extensions.php change
157  
158  // Reverse array so "System Default" is at the top
159  $DATE_FORMATS = array_reverse($DATE_FORMATS, true);
160 diff -Naur websitebaker-2.6.5/wb/admin/interface/time_formats.php websitebaker-2.6.5.timezone-extensions/wb/admin/interface/time_formats.php
161 --- websitebaker-2.6.5/wb/admin/interface/time_formats.php  2006-12-24 08:50:44.000000000 +0100
162 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/interface/time_formats.php  2007-05-29 15:21:39.000000000 +0200
163 @@ -30,6 +30,11 @@
164  This file is used to generate a list of time formats for the user to select
165  
166  */
167 +//timezone.extensions.php change!
168 +//we made a lot of changes to this file. We no longer use mktime to make time and add TIMEZONE.
169 +//instead, we use the new wbdate call to create a date using the current TIMEZONE
170 +//problem with this is that date will allways be displayed in the current user's timezone, but well
171 +
172  
173  if(!defined('WB_URL')) {
174     header('Location: ../index.php');
175 @@ -44,14 +49,23 @@
176  // Create array
177  $TIME_FORMATS = array();
178  
179 +//timezone.extensions.php change
180 +//this code removed:
181 +/*
182  // Get the current time (in the users timezone if required)
183  if(isset($user_time) AND $user_time == true) {
184     $mktime = mktime()+TIMEZONE;
185  } else {
186     $mktime = mktime()+DEFAULT_TIMEZONE;
187  }
188 +//end timezone.extensions.php change
189 +
190  
191  // Add values to list
192 +
193 +//timezone.extensions.php change
194 +   //old code:
195 +   /*
196  $TIME_FORMATS['g:i|A'] = gmdate('g:i A', $mktime);
197  $TIME_FORMATS['g:i|a'] = gmdate('g:i a', $mktime);
198  $TIME_FORMATS['H:i:s'] = gmdate('H:i:s', $mktime);
199 @@ -65,6 +79,22 @@
200         $TIME_FORMATS['system_default'] = gmdate(DEFAULT_TIME_FORMAT, $mktime).' (System Default)';
201     }
202  }
203 +*/
204 +   //new code:
205 +       $TIME_FORMATS['g:i|A'] = wbdate('g:i A');
206 +       $TIME_FORMATS['g:i|a'] = wbdate('g:i a');
207 +       $TIME_FORMATS['H:i:s'] = wbdate('H:i:s');
208 +       $TIME_FORMATS['H:i'] = wbdate('H:i');
209 +       
210 +       // Add "System Default" to list (if we need to)
211 +       if(isset($user_time) AND $user_time == true) {
212 +           if(isset($TEXT['SYSTEM_DEFAULT'])) {
213 +               $TIME_FORMATS['system_default'] = wbdate(DEFAULT_TIME_FORMAT).' ('.$TEXT['SYSTEM_DEFAULT'].')';
214 +           } else {
215 +               $TIME_FORMATS['system_default'] = wbdate(DEFAULT_TIME_FORMAT).' (System Default)';
216 +           }
217 +       }
218 +//end timezone.extensions.php change
219  
220  // Reverse array so "System Default" is at the top
221  $TIME_FORMATS = array_reverse($TIME_FORMATS, true);
222 diff -Naur websitebaker-2.6.5/wb/admin/pages/modify.php websitebaker-2.6.5.timezone-extensions/wb/admin/pages/modify.php
223 --- websitebaker-2.6.5/wb/admin/pages/modify.php    2006-12-24 08:50:44.000000000 +0100
224 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/pages/modify.php    2007-05-29 12:51:59.000000000 +0200
225 @@ -49,7 +49,12 @@
226  
227  // Convert the unix ts for modified_when to human a readable form
228  if($results_array['modified_when'] != 0) {
229 -   $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
230 +   //timezone.extensions.php change!
231 +       //old code
232 +           // $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
233 +       //new code
234 +           $modified_ts = wbdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']);
235 +   //end timezone.extensions.php change
236  } else {
237     $modified_ts = 'Unknown';
238  }
239 diff -Naur websitebaker-2.6.5/wb/admin/pages/settings.php websitebaker-2.6.5.timezone-extensions/wb/admin/pages/settings.php
240 --- websitebaker-2.6.5/wb/admin/pages/settings.php  2006-12-24 08:50:44.000000000 +0100
241 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/pages/settings.php  2007-05-29 12:52:28.000000000 +0200
242 @@ -65,7 +65,12 @@
243  
244  // Convert the unix ts for modified_when to human a readable form
245  if($results_array['modified_when'] != 0) {
246 -   $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
247 +   //timezone.extensions.php change!
248 +       //old code
249 +           // $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
250 +       //new code
251 +           $modified_ts = wbdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']);
252 +   //end timezone.extensions.php change
253  } else {
254     $modified_ts = 'Unknown';
255  }
256 diff -Naur websitebaker-2.6.5/wb/admin/preferences/details.php websitebaker-2.6.5.timezone-extensions/wb/admin/preferences/details.php
257 --- websitebaker-2.6.5/wb/admin/preferences/details.php 2006-12-24 08:50:44.000000000 +0100
258 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/preferences/details.php 2007-05-29 15:38:45.000000000 +0200
259 @@ -31,7 +31,30 @@
260  // Get entered values
261  $display_name = $admin->add_slashes(strip_tags($admin->get_post('display_name')));
262  $language = $admin->get_post('language');
263 -$timezone = $admin->get_post('timezone')*60*60;
264 +
265 +//timezone.extensions.php change!
266 +   //When using the new timezone framework, the timezone value will not be
267 +   //integer. In that case $value will just be saved (being a string)
268 +   // Spin in het web, 20070525
269 +   
270 +   //old code:
271 +       //$timezone = $admin->get_post('timezone')*60*60;
272 +   //new code:
273 +           $timezone = $admin->get_post('timezone');
274 +           if (is_numeric($timezone))
275 +               $timezone = $timezone*60*60;
276 +           //this seemed to be missing in the original code
277 +           if($timezone == '-72000')
278 +           {
279 +               // Set a session var so apps can tell user is using default tz
280 +               $_SESSION['USE_DEFAULT_TIMEZONE'] = true;
281 +           }
282 +           else
283 +           {
284 +               unset($_SESSION['USE_DEFAULT_TIMEZONE']);
285 +           }
286 +//end timezone.extensions.php change
287 +
288  $date_format = $admin->get_post('date_format');
289  $time_format = $admin->get_post('time_format');
290  
291 diff -Naur websitebaker-2.6.5/wb/admin/preferences/index.php websitebaker-2.6.5.timezone-extensions/wb/admin/preferences/index.php
292 --- websitebaker-2.6.5/wb/admin/preferences/index.php   2006-12-24 08:50:44.000000000 +0100
293 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/preferences/index.php   2007-05-29 15:47:42.000000000 +0200
294 @@ -25,6 +25,8 @@
295  
296  require('../../config.php');
297  require_once(WB_PATH.'/framework/class.admin.php');
298 +
299 +
300  $admin = new admin('Preferences');
301  
302  // Create new template object for the preferences form
303 @@ -66,12 +68,40 @@
304  }
305  
306  // Insert default timezone values
307 -require(ADMIN_PATH.'/interface/timezones.php');
308 +
309 +//timezone.extensions.php change!
310 +   //We use a call that selects between php < 5.1 and above
311 +   // Spin in het web, 20070525
312 +   
313 +   //old code:
314 +       //require(ADMIN_PATH.'/interface/timezones.php');
315 +   //new code:
316 +       set_TIMEZONES();
317 +//end timezone.extensions.php change
318 +
319  $template->set_block('main_block', 'timezone_list_block', 'timezone_list');
320 +
321 +//timezone.extensions.php change!
322 +   //we save admin->get_timezone() once, saves calling it for once or twice for every timezone
323 +   //code added:
324 +   
325 +   $admintz = $admin->get_timezone();
326 +//end timezone.extensions.php change
327 +
328  foreach($TIMEZONES AS $hour_offset => $title) {
329     $template->set_var('VALUE', $hour_offset);
330     $template->set_var('NAME', $title);
331 -   if($admin->get_timezone() == $hour_offset*60*60) {
332 +   //timezone.extensions.php change!
333 +       //$hour_offset is a name when using new timezone code (EXCEPT for the standard value -20), otherwise a numeric string
334 +       //when it is a string, we should not do the hour->second conversion like with numeric
335 +       // Spin in het web, 20070525
336 +           
337 +       //old code
338 +           //if($admin->get_timezone() == $hour_offset*60*60) {
339 +       //new code
340 +
341 +           if ((is_numeric($hour_offset) && $admintz == $hour_offset*60*60) || ((! is_numeric($hour_offset)) && $admintz == $hour_offset)) {
342 +   //end timezone.extensions.php change
343         $template->set_var('SELECTED', 'selected');
344     } else {
345         $template->set_var('SELECTED', '');
346 diff -Naur websitebaker-2.6.5/wb/admin/settings/index.php websitebaker-2.6.5.timezone-extensions/wb/admin/settings/index.php
347 --- websitebaker-2.6.5/wb/admin/settings/index.php  2006-12-24 08:50:44.000000000 +0100
348 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/settings/index.php  2007-05-25 15:52:50.000000000 +0200
349 @@ -158,14 +158,34 @@
350  }
351  
352  // Insert default timezone values
353 -require(ADMIN_PATH.'/interface/timezones.php');
354 +
355 +//timezone.extensions.php change!
356 +   //We use a call that selects between php < 5.1 and above
357 +   // Spin in het web, 20070525
358 +   
359 +   //old code:
360 +       //require(ADMIN_PATH.'/interface/timezones.php');
361 +   //new code:
362 +       set_TIMEZONES();
363 +//end timezone.extensions.php change
364 +
365  $template->set_block('main_block', 'timezone_list_block', 'timezone_list');
366  foreach($TIMEZONES AS $hour_offset => $title) {
367     // Make sure we dont list "System Default" as we are setting this value!
368     if($hour_offset != '-20') {
369         $template->set_var('VALUE', $hour_offset);
370         $template->set_var('NAME', $title);
371 -       if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
372 +       
373 +       //timezone.extensions.php change!
374 +           //$hour_offset is a name when using new timezone code  (EXCEPT for the standard value -20), otherwise a numeric string
375 +           //when it is a string, we should not do the hour->second conversion like with numeric
376 +           // Spin in het web, 20070525
377 +           
378 +           //old code
379 +               //if(DEFAULT_TIMEZONE == $hour_offset*60*60) {
380 +           //new code
381 +               if ((is_numeric($hour_offset) && DEFAULT_TIMEZONE == $hour_offset*60*60) || ((! is_numeric($hour_offset)) && DEFAULT_TIMEZONE == $hour_offset)) {
382 +       //end timezone.extensions.php change
383             $template->set_var('SELECTED', 'selected');
384         } else {
385             $template->set_var('SELECTED', '');
386 diff -Naur websitebaker-2.6.5/wb/admin/settings/save.php websitebaker-2.6.5.timezone-extensions/wb/admin/settings/save.php
387 --- websitebaker-2.6.5/wb/admin/settings/save.php   2006-12-24 08:50:44.000000000 +0100
388 +++ websitebaker-2.6.5.timezone-extensions/wb/admin/settings/save.php   2007-05-25 15:32:07.000000000 +0200
389 @@ -126,6 +126,14 @@
390         $value = $admin->add_slashes($value);
391         switch ($setting_name) {
392             case 'default_timezone':
393 +               //timezone.extensions.php change!
394 +                   //When using the new timezone framework, this value will not be
395 +                   //integer. In that case $value will just be saved (being a string)
396 +                   // Spin in het web, 20070525
397 +                   
398 +                   //added code:
399 +                       if (is_numeric($value))
400 +               //end timezone.extensions.php change
401                 $value=$value*60*60;
402                 break;
403             case 'string_dir_mode':
404 diff -Naur websitebaker-2.6.5/wb/framework/initialize.php websitebaker-2.6.5.timezone-extensions/wb/framework/initialize.php
405 --- websitebaker-2.6.5/wb/framework/initialize.php  2006-12-24 08:50:44.000000000 +0100
406 +++ websitebaker-2.6.5.timezone-extensions/wb/framework/initialize.php  2007-05-29 12:21:18.000000000 +0200
407 @@ -23,6 +23,11 @@
408  
409  */
410  
411 +//timezone.extensions.php added
412 +//Spin in het Web 20070525
413 +require_once(WB_PATH.'/framework/timezone.extensions.php');
414 +//
415 +
416  if (file_exists(WB_PATH.'/framework/class.database.php')) {
417    
418     require_once(WB_PATH.'/framework/class.database.php');
419 @@ -79,12 +84,22 @@
420         }
421     }
422    
423 -   // Get users timezone
424 -   if(isset($_SESSION['TIMEZONE'])) {
425 -       define('TIMEZONE', $_SESSION['TIMEZONE']);
426 -   } else {
427 -       define('TIMEZONE', DEFAULT_TIMEZONE);
428 -   }
429 +       //timezone.extensions.php change!
430 +   //we now fix the timezone for the new timezone framework (see timezone.extensions.php)
431 +   //old code
432 +   /*
433 +       // Get users timezone
434 +       if(isset($_SESSION['TIMEZONE'])) {
435 +           define('TIMEZONE', $_SESSION['TIMEZONE']);
436 +       } else {
437 +           define('TIMEZONE', DEFAULT_TIMEZONE);
438 +       }   
439 +   */
440 +   //new code
441 +       init_timezone();
442 +   //end timezone.extensions.php change
443 +
444 +   
445     // Get users date format
446     if(isset($_SESSION['DATE_FORMAT'])) {
447         define('DATE_FORMAT', $_SESSION['DATE_FORMAT']);
448 diff -Naur websitebaker-2.6.5/wb/framework/timezone.extensions.php websitebaker-2.6.5.timezone-extensions/wb/framework/timezone.extensions.php
449 --- websitebaker-2.6.5/wb/framework/timezone.extensions.php 1970-01-01 01:00:00.000000000 +0100
450 +++ websitebaker-2.6.5.timezone-extensions/wb/framework/timezone.extensions.php 2007-05-29 16:11:38.000000000 +0200
451 @@ -0,0 +1,209 @@
452 +<?php
453 +
454 +// Timezone Extensions
455 +// This code will take advantages of the new timezone framework offered by php >= 5.1
456 +// while making sure everything keeps working when using an older php version
457 +
458 +// New timezones are like Europe/Amsterdam and automatically support daylight saving time etc
459 +
460 +// This file is (c) 2007 Spin in het Web (http://www.spininhetweb.nl), Jelmer Jellema
461 +// This code is placed into the public domain. Use it at your own risk.
462 +
463 +
464 +// This code is used in the framework of:
465 +/*
466 +
467 + Website Baker Project <http://www.websitebaker.org/>
468 + Copyright (C) 2004-2007, Ryan Djurovich
469 +
470 + Website Baker is free software; you can redistribute it and/or modify
471 + it under the terms of the GNU General Public License as published by
472 + the Free Software Foundation; either version 2 of the License, or
473 + (at your option) any later version.
474 +
475 + Website Baker is distributed in the hope that it will be useful,
476 + but WITHOUT ANY WARRANTY; without even the implied warranty of
477 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
478 + GNU General Public License for more details.
479 +
480 + You should have received a copy of the GNU General Public License
481 + along with Website Baker; if not, write to the Free Software
482 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
483 +
484 +*/
485 +
486 +
487 +/*
488 +General functions that could be used elsewhere in the Website Baker code or templates. The usualy differ in functionality with the new features enbabled (TZ+) or disabled (TZ-)
489 +
490 +- init_timezone. To be called when initializing sessions. Will define TIMEZONE the way initialize.php used to do it and:
491 +TZ-: do nothing, except for some stuff when php was *downgraded*
492 +TZ+: Will set the constant TIMEZONENAME with the chosen (new) timezone. Will set the old constant TIMEZONE to the *current* offset of that timestamp, so old code using gmtdate(.., timestamp + TIMEZONE) still works. When the preferences or user settings contain an old style timezone, this call tries to find a matching TIMEZONENAME and use it.
493 +
494 +- set_TIMEZONES: sets the TIMEZONES array like admin/interface/timezones.php does.
495 +TZ-: Will call the timezones.php file
496 +TZ+: Will fill the TIMEZONES array with the new timezones. Values and indices are both timezone names.
497 +
498 +- wbdate(timeformat,[timestamp = mktime()]). Our implementation of date() and gmdate(). Use it instead of gmdate("..",time + TIMEZONE)
499 +TZ-: will return the built-in gmdate(timeformat,timestamp + TIMEZONE)
500 +TZ+: will return date(timeformat,timestamp), using the right timezone
501 +
502 +
503 +*/
504 +
505 +// Stop this file from being accessed directly
506 +if(!defined('WB_URL')) {
507 +   header('Location: ../index.php');
508 +   exit(0);
509 +}
510 +
511 +// Define that this file has been loaded
512 +define('TIMEZONE_EXTENSIONS_FILE_LOADED', true);
513 +
514 +//Can we use the new framework?
515 +
516 +if (function_exists('date_default_timezone_set'))
517 +{
518 +///////////////////////// USING THE NEW TIMEZONE FRAMEWORK //////////////////
519 +
520 +   function init_timezone()
521 +   {
522 +       // Get users timezone
523 +       if(isset($_SESSION['TIMEZONE']) && $_SESSION['TIMEZONE'] != '-72000')
524 +           $timezone = $_SESSION['TIMEZONE'];
525 +       else
526 +           $timezone = DEFAULT_TIMEZONE;
527 +
528 +       //do we have a numeric or normal timezone?
529 +       if (is_numeric($timezone))
530 +       {
531 +           //probably upgraded php lately?
532 +           //Lets see if we can find a good one
533 +           //this is not perfect, because we do not know is dst is running or not
534 +           
535 +           //informed guess: does the server use DST
536 +           
537 +           
538 +           $tz = false;
539 +           if ($month < 5 or $month > 10)
540 +               $dst = 0;
541 +           else
542 +               $dst = 1;
543 +           if (function_exists('timezone_name_from_abbr')) //5.1.3
544 +               $tz = timezone_name_from_abbr("", $timezone,date('I'));
545 +               
546 +           if (! $tz)
547 +               $tz = 'UTC'; //what else can we do?
548 +           define('TIMEZONENAME',$tz);
549 +       }
550 +       else
551 +       {
552 +           define('TIMEZONENAME', $timezone);         
553 +       }
554 +       
555 +       //we set TIMEZONE to the offset that is now current
556 +       //there is a problem with this. All offset calculating functionality is bèta in php 5.1 and not
557 +       //included by default. So we do some tricks here
558 +       
559 +       $now_universal = mktime(); //tz-independend unix timestamp
560 +       $oldtz = date_default_timezone_get();
561 +       date_default_timezone_set('GMT');
562 +       
563 +       $gmdate = getdate($now_universal);
564 +       date_default_timezone_set(TIMEZONENAME);
565 +       $now_in_tz = mktime($gmdate['hours'],$gmdate['minutes'],$gmdate['seconds'],$gmdate['mon'],$gmdate['mday'],$gmdate['year'],-1);
566 +       
567 +       //if now_in_tz is less then now_universal, this means it is usualy *later* in the time zone than in GMT
568 +       //
569 +       define('TIMEZONE',$now_universal - $now_in_tz);
570 +   
571 +       date_default_timezone_set($oldtz);
572 +       
573 +       //print "TZ $timezone<br>Timezone: " . TIMEZONE . "<br>Session timezone: " . $_SESSION['TIMEZONE'] . "<br>Timezone name: " . TIMEZONENAME . "<br>Use default: " . ($_SESSION['USE_DEFAULT_TIMEZONE'] ? 'true' : 'false') . "<br>";
574 +       
575 +       //we do NOT use date_default_timezone_set, because this will set the TZ environment, which gives problem
576 +       //when used in apache php module: even apache will start logging in the new timezone
577 +   }
578 +   
579 +   function set_TIMEZONES()
580 +   {
581 +       //set the TIMEZONE array using the new style values
582 +       global $TIMEZONES;
583 +       global $TEXT;
584 +       
585 +       $TIMEZONES = array();
586 +       // Add "System Default" to top of list, just like timezones.php
587 +       if(isset($TEXT['SYSTEM_DEFAULT'])) {
588 +           $TIMEZONES['-20'] = $TEXT['SYSTEM_DEFAULT'];
589 +       } else {
590 +           $TIMEZONES['-20'] = 'System Default';
591 +       }
592 +
593 +       //add the current server timezone on the top of the list
594 +       $tz = date_default_timezone_get();
595 +       if ($tz)
596 +           $TIMEZONES[$tz] = $tz;
597 +       foreach (DateTimeZone::listIdentifiers() as $tz)
598 +       {
599 +           $TIMEZONES[$tz] = $tz;
600 +       }
601 +   }
602 +   
603 +   function wbdate($timeformat, $timestamp = -1)
604 +   {
605 +       //create a time string like date() and gmdate(), using the timezone in TIMEZONENAME
606 +       //this is the new framework version. Old framework will call gmdate
607 +       
608 +       //set the tz only when really needed (see init_timezone above)
609 +       $oldtz = '';
610 +       $oldtz = date_default_timezone_get();
611 +       date_default_timezone_set(TIMEZONENAME);
612 +       
613 +       if ($timestamp == -1)
614 +           $r = date($timeformat);
615 +       else
616 +           $r = date($timeformat, $timestamp);
617 +           
618 +       date_default_timezone_set($oldtz);
619 +       return $r;
620 +   }
621 +}
622 +///////////////////////// NOT USING THE NEW TIMEZONE FRAMEWORK //////////////////
623 +else
624 +{
625 +   //NOT USING THE NEW TIMEZONE FRAMEWORK
626 +   
627 +   function init_timezone()
628 +   {
629 +   
630 +       // Get users timezone
631 +       if(isset($_SESSION['TIMEZONE']) && $_SESSION['TIMEZONE'] != '-72000')
632 +           $timezone = $_SESSION['TIMEZONE'];
633 +       else
634 +           $timezone = DEFAULT_TIMEZONE;
635 +       
636 +       //very special case: downgrading php
637 +       if (! is_numeric($timezone))
638 +           define(TIMEZONE,0); #numeric again
639 +       else
640 +           define(TIMEZONE,$timezone);         
641 +   }
642 +   
643 +   function set_TIMEZONES()
644 +   {
645 +       //usual WB code to read the timezones
646 +       global $TIMEZONES;
647 +       require_once(ADMIN_PATH.'/interface/timezones.php');
648 +       
649 +   }
650 +
651 +   function wbdate($timeformat, $timestamp = -1)
652 +   {
653 +       //in the old framework, wbdate does the same as gmdate(format, timestamp + TIMEZONE)
654 +       
655 +       if ($timestamp == -1)
656 +           return gmdate($timeformat, mktime() + TIMEZONE);
657 +       else
658 +           return gmdate($timeformat, $timestamp + TIMEZONE);
659 +   }
660 +}
661 \ No newline at end of file
662 diff -Naur websitebaker-2.6.5/wb/install/index.php websitebaker-2.6.5.timezone-extensions/wb/install/index.php
663 --- websitebaker-2.6.5/wb/install/index.php 2006-12-25 02:38:05.000000000 +0100
664 +++ websitebaker-2.6.5.timezone-extensions/wb/install/index.php 2007-05-29 15:58:56.000000000 +0200
665 @@ -201,39 +201,64 @@
666             </td>
667             <td>
668                 <select tabindex="3" name="default_timezone" style="width: 100%;">
669 -                   <?php
670 -                   $TIMEZONES['-12'] = 'GMT - 12 Hours';
671 -                   $TIMEZONES['-11'] = 'GMT -11 Hours';
672 -                   $TIMEZONES['-10'] = 'GMT -10 Hours';
673 -                   $TIMEZONES['-9'] = 'GMT -9 Hours';
674 -                   $TIMEZONES['-8'] = 'GMT -8 Hours';
675 -                   $TIMEZONES['-7'] = 'GMT -7 Hours';
676 -                   $TIMEZONES['-6'] = 'GMT -6 Hours';
677 -                   $TIMEZONES['-5'] = 'GMT -5 Hours';
678 -                   $TIMEZONES['-4'] = 'GMT -4 Hours';
679 -                   $TIMEZONES['-3.5'] = 'GMT -3.5 Hours';
680 -                   $TIMEZONES['-3'] = 'GMT -3 Hours';
681 -                   $TIMEZONES['-2'] = 'GMT -2 Hours';
682 -                   $TIMEZONES['-1'] = 'GMT -1 Hour';
683 -                   $TIMEZONES['0'] = 'GMT';
684 -                   $TIMEZONES['1'] = 'GMT +1 Hour';
685 -                   $TIMEZONES['2'] = 'GMT +2 Hours';
686 -                   $TIMEZONES['3'] = 'GMT +3 Hours';
687 -                   $TIMEZONES['3.5'] = 'GMT +3.5 Hours';
688 -                   $TIMEZONES['4'] = 'GMT +4 Hours';
689 -                   $TIMEZONES['4.5'] = 'GMT +4.5 Hours';
690 -                   $TIMEZONES['5'] = 'GMT +5 Hours';
691 -                   $TIMEZONES['5.5'] = 'GMT +5.5 Hours';
692 -                   $TIMEZONES['6'] = 'GMT +6 Hours';
693 -                   $TIMEZONES['6.5'] = 'GMT +6.5 Hours';
694 -                   $TIMEZONES['7'] = 'GMT +7 Hours';
695 -                   $TIMEZONES['8'] = 'GMT +8 Hours';
696 -                   $TIMEZONES['9'] = 'GMT +9 Hours';
697 -                   $TIMEZONES['9.5'] = 'GMT +9.5 Hours';
698 -                   $TIMEZONES['10'] = 'GMT +10 Hours';
699 -                   $TIMEZONES['11'] = 'GMT +11 Hours';
700 -                   $TIMEZONES['12'] = 'GMT +12 Hours';
701 -                   $TIMEZONES['13'] = 'GMT +13 Hours';
702 +               <?php
703 +                   //timezone.extensions.php change!
704 +                   //when available, we use the new timezone framework
705 +                   
706 +                   //added code:
707 +                       if (function_exists('date_default_timezone_set'))
708 +                       {
709 +                           //New timezone framework
710 +                           $TIMEZONES = array();
711 +                           //add the current server timezone on the top of the list
712 +                           $tz = date_default_timezone_get();
713 +                           if ($tz)
714 +                               $TIMEZONES[$tz] = $tz;
715 +                           foreach (DateTimeZone::listIdentifiers() as $tz)
716 +                           {
717 +                               $TIMEZONES[$tz] = $tz;
718 +                           }
719 +                       }
720 +                       else
721 +                       {
722 +                           //old timezone framework
723 +                   //old code still active:
724 +                       $TIMEZONES['-12'] = 'GMT - 12 Hours';
725 +                       $TIMEZONES['-11'] = 'GMT -11 Hours';
726 +                       $TIMEZONES['-10'] = 'GMT -10 Hours';
727 +                       $TIMEZONES['-9'] = 'GMT -9 Hours';
728 +                       $TIMEZONES['-8'] = 'GMT -8 Hours';
729 +                       $TIMEZONES['-7'] = 'GMT -7 Hours';
730 +                       $TIMEZONES['-6'] = 'GMT -6 Hours';
731 +                       $TIMEZONES['-5'] = 'GMT -5 Hours';
732 +                       $TIMEZONES['-4'] = 'GMT -4 Hours';
733 +                       $TIMEZONES['-3.5'] = 'GMT -3.5 Hours';
734 +                       $TIMEZONES['-3'] = 'GMT -3 Hours';
735 +                       $TIMEZONES['-2'] = 'GMT -2 Hours';
736 +                       $TIMEZONES['-1'] = 'GMT -1 Hour';
737 +                       $TIMEZONES['0'] = 'GMT';
738 +                       $TIMEZONES['1'] = 'GMT +1 Hour';
739 +                       $TIMEZONES['2'] = 'GMT +2 Hours';
740 +                       $TIMEZONES['3'] = 'GMT +3 Hours';
741 +                       $TIMEZONES['3.5'] = 'GMT +3.5 Hours';
742 +                       $TIMEZONES['4'] = 'GMT +4 Hours';
743 +                       $TIMEZONES['4.5'] = 'GMT +4.5 Hours';
744 +                       $TIMEZONES['5'] = 'GMT +5 Hours';
745 +                       $TIMEZONES['5.5'] = 'GMT +5.5 Hours';
746 +                       $TIMEZONES['6'] = 'GMT +6 Hours';
747 +                       $TIMEZONES['6.5'] = 'GMT +6.5 Hours';
748 +                       $TIMEZONES['7'] = 'GMT +7 Hours';
749 +                       $TIMEZONES['8'] = 'GMT +8 Hours';
750 +                       $TIMEZONES['9'] = 'GMT +9 Hours';
751 +                       $TIMEZONES['9.5'] = 'GMT +9.5 Hours';
752 +                       $TIMEZONES['10'] = 'GMT +10 Hours';
753 +                       $TIMEZONES['11'] = 'GMT +11 Hours';
754 +                       $TIMEZONES['12'] = 'GMT +12 Hours';
755 +                       $TIMEZONES['13'] = 'GMT +13 Hours';
756 +                   //added code:
757 +                       }
758 +                   //end timezone.extensions.php change
759 +                   
760                     foreach($TIMEZONES AS $hour_offset => $title) {
761                         ?>
762                             <option value="<?php echo $hour_offset; ?>"<?php if(isset($_SESSION['default_timezone']) AND $_SESSION['default_timezone'] == $hour_offset) { echo ' selected'; } elseif(!isset($_SESSION['default_timezone']) AND $hour_offset == 0) { echo 'selected'; } ?>><?php echo $title; ?></option>
763 diff -Naur websitebaker-2.6.5/wb/install/save.php websitebaker-2.6.5.timezone-extensions/wb/install/save.php
764 --- websitebaker-2.6.5/wb/install/save.php  2006-12-25 02:13:59.000000000 +0100
765 +++ websitebaker-2.6.5.timezone-extensions/wb/install/save.php  2007-05-29 16:54:16.000000000 +0200
766 @@ -160,12 +160,35 @@
767  if(substr($wb_url, strlen($wb_url)-1, 1) == "\\") {
768     $wb_url = substr($wb_url, 0, strlen($wb_url)-1);
769  }
770 +
771  // Get the default time zone
772 -if(!isset($_POST['default_timezone']) OR !is_numeric($_POST['default_timezone'])) {
773 -   set_error('Please select a valid default timezone');
774 -} else {
775 -   $default_timezone = $_POST['default_timezone']*60*60;
776 -}
777 +//timezone.extensions.php change!
778 +//when available, we use the new timezone framework
779 +
780 +   //added code:
781 +       if (function_exists('date_default_timezone_set'))
782 +       {
783 +           //New timezone framework
784 +           if(!isset($_POST['default_timezone']) OR is_numeric($_POST['default_timezone'])) {
785 +               set_error('Please select a valid default timezone');
786 +           } else {
787 +               $default_timezone = $_POST['default_timezone'];
788 +           }
789 +       }
790 +       else
791 +       {
792 +           //old timezone framework
793 +   //old code still active:
794 +
795 +       if(!isset($_POST['default_timezone']) OR !is_numeric($_POST['default_timezone'])) {
796 +           set_error('Please select a valid default timezone');
797 +       } else {
798 +           $default_timezone = $_POST['default_timezone']*60*60;
799 +       }
800 +   //added code:
801 +       }
802 +//end timezone.extensions.php change
803 +
804  // End path and timezone details code
805  
806  // Begin operating system specific code
807 @@ -490,7 +513,10 @@
808            . ' `last_reset` INT NOT NULL DEFAULT \'0\','
809            . ' `display_name` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
810            . ' `email` TEXT NOT NULL ,'
811 -          . ' `timezone` INT NOT NULL DEFAULT \'0\','
812 +//SIHW
813 +//. ' `timezone` INT NOT NULL DEFAULT \'0\','
814 +          . ' `timezone` VARCHAR(40) NOT NULL DEFAULT \'-72000\','
815 +//_SIHW
816            . ' `date_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
817            . ' `time_format` VARCHAR( 255 ) NOT NULL DEFAULT \'\' ,'
818            . ' `language` VARCHAR( 5 ) NOT NULL DEFAULT \'\' ,'
819 @@ -685,4 +711,4 @@
820                                     'GROUPS_TABLE' => TABLE_PREFIX."groups",
821                             )
822                     );
823 -?>
824 \ No newline at end of file
825 +?>
826 diff -Naur websitebaker-2.6.5/wb/modules/admin.php websitebaker-2.6.5.timezone-extensions/wb/modules/admin.php
827 --- websitebaker-2.6.5/wb/modules/admin.php 2006-12-24 08:50:44.000000000 +0100
828 +++ websitebaker-2.6.5.timezone-extensions/wb/modules/admin.php 2007-05-29 16:06:51.000000000 +0200
829 @@ -112,7 +112,14 @@
830  
831  // Convert the unix ts for modified_when to human a readable form
832  if($results_array['modified_when'] != 0) {
833 -   $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
834 +//timezone.extensions.php change!
835 +//old code
836 +   /*
837 +       $modified_ts = gmdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']+TIMEZONE);
838 +   */
839 +//new code
840 +   $modified_ts = wbdate(TIME_FORMAT.', '.DATE_FORMAT, $results_array['modified_when']);
841 +//end timezone.extensions.php change
842  } else {
843     $modified_ts = 'Unknown';
844  }
845 diff -Naur websitebaker-2.6.5/wb/modules/backup/backup-sql.php websitebaker-2.6.5.timezone-extensions/wb/modules/backup/backup-sql.php
846 --- websitebaker-2.6.5/wb/modules/backup/backup-sql.php 2006-12-24 08:50:44.000000000 +0100
847 +++ websitebaker-2.6.5.timezone-extensions/wb/modules/backup/backup-sql.php 2007-05-29 16:14:57.000000000 +0200
848 @@ -23,9 +23,6 @@
849  
850  */
851  
852 -// Filename to use
853 -$filename = $_SERVER['HTTP_HOST'].'-backup-'.gmdate('Y-m-d', mktime()+TIMEZONE).'.sql';
854 -
855  // Check if user clicked on the backup button
856  if(!isset($_POST['backup'])){
857     header('Location: ../');
858 @@ -39,12 +36,32 @@
859  require(WB_PATH.'/framework/class.admin.php');
860  $admin = new admin('Settings', 'settings_advanced', false);
861  
862 +// Filename to use
863 +
864 +//timezone.extensions.php change!
865 +//we moved it a bit
866 +//old code
867 +   /*
868 +       $filename = $_SERVER['HTTP_HOST'].'-backup-'.gmdate('Y-m-d', mktime()+TIMEZONE).'.sql';
869 +   */
870 +//new code
871 +   $filename = $_SERVER['HTTP_HOST'].'-backup-'.wbdate('Y-m-d', mktime()).'.sql';
872 +//end timezone.extensions.php change
873 +
874 +
875  // Begin output var
876  $output = "".
877  "#\n".
878  "# Website Baker ".WB_VERSION." Database Backup\n".
879  "# ".WB_URL."\n".
880 -"# ".gmdate(DATE_FORMAT, mktime()+TIMEZONE).", ".gmdate(TIME_FORMAT, mktime()+TIMEZONE)."\n".
881 +//timezone.extensions.php change!
882 +//old code
883 +   /*
884 +   "# ".gmdate(DATE_FORMAT, mktime()+TIMEZONE).", ".gmdate(TIME_FORMAT, mktime()+TIMEZONE)."\n".
885 +   */
886 +//new code
887 +       "# ".wbdate(DATE_FORMAT).", ".wbdate(TIME_FORMAT)."\n".
888 +//end timezone.extensions.php change
889  "#".
890  "\n";
891  
892 diff -Naur websitebaker-2.6.5/wb/modules/form/modify.php websitebaker-2.6.5.timezone-extensions/wb/modules/form/modify.php
893 --- websitebaker-2.6.5/wb/modules/form/modify.php   2006-12-24 08:50:44.000000000 +0100
894 +++ websitebaker-2.6.5.timezone-extensions/wb/modules/form/modify.php   2007-05-29 16:10:25.000000000 +0200
895 @@ -164,7 +164,16 @@
896                 </a>
897             </td>
898             <td width="237"><?php echo $TEXT['SUBMISSION_ID'].': '.$submission['submission_id']; ?></td>
899 -           <td><?php echo $TEXT['SUBMITTED'].': '.gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
900 +           <td><?php echo $TEXT['SUBMITTED'].': '.
901 +                   //timezone.extensions.php change!
902 +                   //old code
903 +                       /*
904 +                       gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE);
905 +                       */
906 +                   //new code
907 +                       wbdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']);
908 +                   //end timezone.extensions.php change
909 +                   ?></td>
910             <td width="20">
911                 <a href="javascript: confirm_link('<?php echo $TEXT['ARE_YOU_SURE']; ?>', '<?php echo WB_URL; ?>/modules/form/delete_submission.php?page_id=<?php echo $page_id; ?>&section_id=<?php echo $section_id; ?>&submission_id=<?php echo $submission['submission_id']; ?>');" title="<?php echo $TEXT['DELETE']; ?>">
912                     <img src="<?php echo ADMIN_URL; ?>/images/delete_16.png" border="0" alt="X" />
913 diff -Naur websitebaker-2.6.5/wb/modules/form/view_submission.php websitebaker-2.6.5.timezone-extensions/wb/modules/form/view_submission.php
914 --- websitebaker-2.6.5/wb/modules/form/view_submission.php  2006-12-24 08:50:44.000000000 +0100
915 +++ websitebaker-2.6.5.timezone-extensions/wb/modules/form/view_submission.php  2007-05-29 16:09:11.000000000 +0200
916 @@ -63,7 +63,16 @@
917  </tr>
918  <tr>
919     <td><?php echo $TEXT['SUBMITTED']; ?>:</td>
920 -   <td><?php echo gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE); ?></td>
921 +   <td><?php
922 +           //timezone.extensions.php change!
923 +   //old code
924 +       /*
925 +           echo gmdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']+TIMEZONE);
926 +       */
927 +   //new code
928 +           echo wbdate(TIME_FORMAT.', '.DATE_FORMAT, $submission['submitted_when']);
929 +   //end timezone.extensions.php change
930 +   ?></td>
931  </td>
932  <tr>
933     <td><?php echo $TEXT['USER']; ?>:</td>
934 diff -Naur websitebaker-2.6.5/wb/modules/news/view.php websitebaker-2.6.5.timezone-extensions/wb/modules/news/view.php
935 --- websitebaker-2.6.5/wb/modules/news/view.php 2006-12-24 08:50:44.000000000 +0100
936 +++ websitebaker-2.6.5.timezone-extensions/wb/modules/news/view.php 2007-05-29 16:18:00.000000000 +0200
937 @@ -167,8 +167,16 @@
938             if(isset($groups[$post['group_id']]['active']) AND $groups[$post['group_id']]['active'] != false) { // Make sure parent group is active
939                 $uid = $post['posted_by']; // User who last modified the post
940                 // Workout date and time of last modified post
941 -               $post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
942 -               $post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
943 +               //timezone.extensions.php change!
944 +               //old code
945 +                   /*
946 +                       $post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
947 +                       $post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
948 +                   */
949 +               //new code
950 +                   $post_date = wbdate(DATE_FORMAT, $post['posted_when']);
951 +                   $post_time = wbdate(TIME_FORMAT, $post['posted_when']);
952 +               //end timezone.extensions.php change
953                 // Work-out the post link
954                 $post_link = page_link($post['link']);
955                 if(isset($_GET['p']) AND $position > 0) {
956 @@ -257,8 +265,16 @@
957         if(isset($groups[$post['group_id']]['active']) AND $groups[$post['group_id']]['active'] != false) { // Make sure parent group is active
958             $uid = $post['posted_by']; // User who last modified the post
959             // Workout date and time of last modified post
960 -           $post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
961 -           $post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
962 +           //timezone.extensions.php change!
963 +           //old code
964 +               /*
965 +                   $post_date = gmdate(DATE_FORMAT, $post['posted_when']+TIMEZONE);
966 +                   $post_time = gmdate(TIME_FORMAT, $post['posted_when']+TIMEZONE);
967 +               */
968 +           //new code
969 +               $post_date = wbdate(DATE_FORMAT, $post['posted_when']);
970 +               $post_time = wbdate(TIME_FORMAT, $post['posted_when']);
971 +           //end timezone.extensions.php change
972             // Get group id, title, and image
973             $group_id = $post['group_id'];
974             $group_title = $groups[$group_id]['title'];
975 @@ -305,8 +321,16 @@
976                 $comment['comment'] = nl2br(($comment['comment']));
977                 $comment['title'] = ($comment['title']);
978                 // Print comments loop
979 -               $commented_date = gmdate(DATE_FORMAT, $comment['commented_when']+TIMEZONE);
980 -               $commented_time = gmdate(TIME_FORMAT, $comment['commented_when']+TIMEZONE);
981 +               //timezone.extensions.php change!
982 +               //old code
983 +&