I still don't have a test forum up and running with BOTH mods yet
(so the following is provided with zero testing), but I think this covers all the required changes to add support for auto DST to the calendar mod.
NOTE these changes are not required to run the calendar - it's only here for those who want to run both mods together. Also note that these changes assume both the event creator and event viewer are using the auto dst setting... if any one user on your forum isn't using auto dst, the times displayed for that user would be "off". A user with auto dst disabled, would even see the wrong time when previewing their own new events (which could cause them to altar the start/end times to compensate for the difference - which would make the start/end time appear wrong to every other user who views it with auto dst on). To avoid this potential problem you may choose to set the user dst value to 2 (auto dst on) for all users, and remove the option to change the dst value in the UCP. Remember the auto dst mod won't work if your server is located in a part of the world that observes different DST start/end dates then your users (ie if you have a global forum, it's not recommended).
Required changes for calendar mod to add support for auto dst mod.
In calendarpost.php
Find:
Code: Select all
$event_start_date = gmmktime($start_hr, $start_mn, 0, $date['month_no'], $date['day'], $date['year'] ) - $user->timezone - $user->dst;
Replace with:
Code: Select all
$event_start_date = gmmktime($start_hr, $start_mn, 0, $date['month_no'], $date['day'], $date['year'] ) - $user->timezone - 3600 * date('I', gmmktime($start_hr, $start_mn, 0, $date['month_no'], $date['day'], $date['year']));
Find:
Code: Select all
$event_end_date = gmmktime($end_hr, $end_mn, 0, $end_m, $end_d, $end_y ) - $user->timezone - $user->dst;
Replace with:
Code: Select all
$event_end_date = gmmktime($end_hr, $end_mn, 0, $end_m, $end_d, $end_y ) - $user->timezone - 3600 * date('I', gmmktime($end_hr, $end_mn, 0, $end_m, $end_d, $end_y));
Find:
Code: Select all
$user_event_start = $event_data['event_start_time'] + $user->timezone + $user->dst;
Replace with:
Code: Select all
$user_event_start = $event_data['event_start_time'] + $user->timezone + 3600 * date('I', $event_data['event_start_time']);
Find:
Code: Select all
$user_event_end = $event_data['event_end_time'] + $user->timezone + $user->dst;
Replace with:
Code: Select all
$user_event_end = $event_data['event_end_time'] + $user->timezone + 3600 * date('I', $event_data['event_end_time']);
Find:
Code: Select all
$event_days_time = gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year']) - $user->timezone - $user->dst;
Replace with:
Code: Select all
$event_days_time = gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year']) - $user->timezone - 3600 * date('I', gmmktime(0, 0, 0, $eday['eday_month'], $eday['eday_day'], $eday['eday_year']));
Find:
Code: Select all
$event_start = $event_data['event_start_time'] + $user->timezone + $user->dst;
Replace with:
Code: Select all
$event_start = $event_data['event_start_time'] + $user->timezone + 3600 * date('I', $event_data['event_start_time']);
Find:
Code: Select all
$event_end = $event_data['event_end_time'] + $user->timezone + $user->dst;
Replace with:
Code: Select all
$event_end = $event_data['event_end_time'] + $user->timezone + 3600 * date('I', $event_data['event_end_time']);
in includes\functions_calendar.php:
Find:
Code: Select all
$test_hi_time = time() + $user->timezone + $user->dst;
Replace with:
Code: Select all
$test_hi_time = time() + $user->timezone + 3600 * date('I');
Find:
Code: Select all
$start_temp_date = gmmktime(0,0,0,$date['month_no'], $j, $date['year']) - $user->timezone - $user->dst;
Replace with:
Code: Select all
$start_temp_date = gmmktime(0,0,0,$date['month_no'], $j, $date['year']) - $user->timezone - 3600 * date('I', gmmktime(0,0,0,$date['month_no'], $j, $date['year']));
Find:
Code: Select all
$temp_date = time() + $user->timezone + $user->dst;
Replace with:
Code: Select all
$temp_date = time() + $user->timezone + 3600 * date('I');
Find:
Code: Select all
$test_hi_time = time() + $user->timezone + $user->dst;
Replace with:
Code: Select all
$test_hi_time = time() + $user->timezone + 3600 * date('I');
Find:
Code: Select all
$start_temp_date = gmmktime(0,0,0,$true_m, $true_j, $true_y) - $user->timezone - $user->dst;
Replace with:
Code: Select all
$start_temp_date = gmmktime(0,0,0,$true_m, $true_j, $true_y) - $user->timezone - 3600 * date('I', gmmktime(0,0,0,$true_m, $true_j, $true_y));
Find:
Code: Select all
$start_temp_date = gmmktime(0,0,0,$date['month_no'], $date['day'], $date['year']) - $user->timezone - $user->dst;
Replace with:
Code: Select all
$start_temp_date = gmmktime(0,0,0,$date['month_no'], $date['day'], $date['year']) - $user->timezone - 3600 * date('I', gmmktime(0,0,0,$date['month_no'], $date['day'], $date['year']));
Find:
Code: Select all
$event_start = $event_data['event_start_time'] + $user->timezone + $user->dst;
Replace with:
Code: Select all
$event_start = $event_data['event_start_time'] + $user->timezone + 3600 * date('I', $event_data['event_start_time']);
Find:
Code: Select all
$event_end = $event_data['event_end_time'] + $user->timezone + $user->dst;
Replace with:
Code: Select all
$event_end = $event_data['event_end_time'] + $user->timezone + 3600 * date('I', $event_data['event_end_time']);
Find:
Code: Select all
$event_days_time = gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year'])- $user->timezone - $user->dst;
Replace with:
Code: Select all
$event_days_time = gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year'])- $user->timezone - 3600 * date('I', gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year']));
Find:
Code: Select all
$row['event_start_time'] = gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year'])- $user->timezone - $user->dst;
Replace with:
Code: Select all
$row['event_start_time'] = gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year'])- $user->timezone - 3600 * date('I', gmmktime(0,0,0,$eday['eday_month'], $eday['eday_day'], $eday['eday_year']));
Find:
Code: Select all
$temp_now_time = time() + $user->timezone + $user->dst;
Replace with:
Code: Select all
$temp_now_time = time() + $user->timezone + 3600 * date('I');