Modification Title: Daylight Saving Time v1.0

Modification Author: Area51mafia

Last Updated: 05/20/09

Modification Description:
This modification will let you specify if you are observing Daylight Saving Time and adjusts your time accordingly.

Supported Version: XMB 1.9.8 SP3

Updated for 1.9.8 by: WormHole @ XMB Garage

Installation Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy is provided with this software package.

=======================================================================================================================
=======
Step 1:
=======
==============================
Go To Admin Panel -> Insert Raw SQL
==============================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

=======================================================================================================================
=======
Step 2:
=======

==================
Edit File: member.php
==================
==========
Find Code:
==========

            $useoldu2u = formYesNo('useoldu2u');

===============
Add Code Below:
===============

            // Daylight Saving Time Hack Begin
            $dststatus = formYesNo('dststatus');
            // Daylight Saving Time Hack End

================
Find Code 2 Times:
================

) VALUES ('$username'

========================
Replace Code With Both Times:
========================

, dststatus) VALUES ('', '$username'

===================================
Find Code At End Of Above Query Statements:
===================================

)");

================
Replace Code With:
================

, '$dststatus')");

=======================================================================================================================
=======
Step 3:
=======
=================
Edit File: memcp.php
=================
==========
Find Code:
==========

        $invchecked = '';
        if ($member['invisible'] == 1) {
            $invchecked = $cheHTML;
        }

===============
Add Code Below:
===============

        // Daylight Saving Time Hack Begin
        $dststatuschecked = '';
        if ($member['dststatus'] == 'yes') {
            $dststatuschecked = $cheHTML;
        }
        // Daylight Saving Time Hack End

==========
Find Code:
==========

        $useoldu2u = formYesNo('useoldu2u');

===============
Add Code Below:
===============

        // Daylight Saving Time Hack Begin
        $dststatus = formYesNo('dststatus');
        // Daylight Saving Time Hack End

==========
Find Code:
==========

        $db->query("UPDATE ".X_PREFIX."members SET $pwtxt
 WHERE username='$xmbuser'");

==========================================================
Find Code At End Of Above Query Statement - WHERE username='$xmbuser'");
==========================================================
================
Replace Code With:
================

, dststatus='$dststatus' WHERE username='$xmbuser'");

=======================================================================================================================
=======
Step 4:
=======
===================
Edit File: editprofile.php
===================
==========
Find Code:
==========

    $eouchecked = '';
    if ($member['emailonu2u'] == 'yes') {
        $eouchecked = $cheHTML;
    }

===============
Add Code Below:
===============

    // Daylight Saving Time Hack Begin
    $dststatuschecked = '';
    if ($member['dststatus'] == 'yes') {
        $dststatuschecked = $cheHTML;
    }
    // Daylight Saving Time Hack End

==========
Find Code:
==========

    $useoldu2u = formYesNo('useoldu2u');

===============
Add Code Below:
===============

    // Daylight Saving Time Hack Begin
    $dststatus = formYesNo('dststatus');
    // Daylight Saving Time Hack End

==========
Find Code:
==========

    $db->query("UPDATE ".X_PREFIX."members SET email='$email'

=======================================================
Find Code At End Of Above Query Statement - WHERE username='$user'");
=======================================================
================
Replace Code With:
================

, dststatus='$dststatus' WHERE username='$user'");

=======================================================================================================================
=======
Step 5:
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

    $timeoffset = $self['timeoffset'];

==================
Replace Code With:
==================

    // Daylight Saving Time Hack Begin
    if ($self['dststatus'] == "yes") {
        $timeoffset = $self['timeoffset'] + 1.0;
    } else {
        $timeoffset = $self['timeoffset'];
    }
    // Daylight Saving Time Hack End

=======================================================================================================================
=======
Step 6:
=======
===============
Edit File: cp2.php
===============
======================
Find Code (on 2 occasions):
======================

        $date = gmdate($dateformat, $recordinfo['date']);
        $time = gmdate($timecode, $recordinfo['date']);

================
Replace Code With:
================

        // Daylight Saving Time Mod Begin
        $tmoffset = ($timeoffset * 3600) + ($addtime * 3600);
        $date = gmdate($dateformat, $recordinfo['date'] + $tmoffset);
        $time = gmdate($timecode, $recordinfo['date'] + $tmoffset);
        // Daylight Saving Time Mod End

=======================================================================================================================
=======
Step 7:
=======
=======================
Edit File: /lang/English.lang.php
=======================
========================
Add To End Of File Above ?>
========================

// Daylight Saving Time Mod Begin
$lang['dststatus'] = "Do you observe Daylight Saving Time?";
// Daylight Saving Time Mod End

=======================================================================================================================
=======
Step 8:
=======
==========================
Go To Admin Panel -> Templates
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[texttimeformat]</td>
<td bgcolor="$altbg2"><input type="radio" value="24" name="timeformatnew" $check24 />&nbsp;$lang[text24hour]&nbsp;<input type="radio" value="12" name="timeformatnew" $check12 />&nbsp;$lang[text12hour]</td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[dststatus]</td>
<td bgcolor="$THEME[altbg2]"><input type="checkbox" name="dststatus" value="yes" $dststatuschecked /></td>
</tr>

=======================================================================================================================
=======
Step 9:
=======
==========================
Go To Admin Panel -> Templates
==========================
=====================
Edit Template: member_reg
=====================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[texttimeformat]</td>
<td bgcolor="$altbg2"><input type="radio" value="24" name="timeformatnew" $timeFormat24Checked/>&nbsp;$lang[text24hour]&nbsp;<input type="radio" value="12" name="timeformatnew" $timeFormat12Checked />&nbsp;$lang[text12hour]</td>
</tr>

===============
Add Code Below:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[dststatus]</td>
<td bgcolor="$THEME[altbg2]"><input type="checkbox" name="dststatus" value="yes" /></td>
</tr>

=======================================================================================================================
========
Step 10:
========
==========================
Go To Admin Panel -> Templates
==========================
=======================
Edit Template: memcp_profile
=======================
==========
Find Code:
==========

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[texttimeformat]</td>
<td bgcolor="$altbg2"><input type="radio" value="24" name="timeformatnew" $check24 />&nbsp;$lang[text24hour]&nbsp;<input type="radio" value="12" name="timeformatnew" $check12 />&nbsp;$lang[text12hour]</td>
</tr>

===============
Add Code Above:
===============

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[dststatus]</td>
<td bgcolor="$THEME[altbg2]"><input type="checkbox" name="dststatus" value="yes" $dststatuschecked /></td>
</tr>

===============================================================================================================
Enjoy!