============================================================================================================================
Modification Title: Daylight Saving Time

Version: 1.0

Author: Area51mafia

Last Updated: 04/19/10

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

Supported Version: XMB 1.9.5 SP1

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 v3. A copy is provided with this software package.

Author Notes:
This modification is developed and released for use with XMB 1.9.5 SP1 which is provided by XMBGarage.com.
Please backup your files, templates and database before installing this modification.
Neither XMB Garage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================

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

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

        $useoldu2u     = (isset($useoldu2u) && $useoldu2u == 'yes') ? 'yes' : 'no';

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

        // Daylight Saving Time Mod Begin
        $dststatus = (isset($dststatus) && $dststatus == 'yes') ? 'yes' : 'no';
        // Daylight Saving Time Mod End

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

        $db->query("INSERT INTO $table_members (uid,

=============================
Find Code In-Line In Above Statement:
=============================

) VALUES ('', '$username',

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

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

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

)");

================
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 Mod Begin
        $dststatusyes = $dststatusno = '';
        if ($member['dststatus'] == 'yes') {
            $dststatusyes = 'selected="selected"';
        } else {
            $dststatusno = 'selected="selected"';
        }
        // Daylight Saving Time Mod End

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

        $useoldu2u      = (isset($useoldu2u) && $useoldu2u == 'yes') ? 'yes' : 'no';

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

        // Daylight Saving Time Mod Begin
        $dststatus = (isset($dststatus) && $dststatus == 'yes') ? 'yes' : 'no';
        // Daylight Saving Time Mod End

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

$db->query("UPDATE $table_members SET $pwtxt email='$email',

========================================
Find Code In-Line 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 Mod Begin
    $dststatusyes = $dststatusno = '';
    if ($member['dststatus'] == 'yes') {
        $dststatusyes = $selHTML;
    } else {
        $dststatusno = $selHTML;
    }
    // Daylight Saving Time Mod End

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

    $useoldu2u      = (isset($useoldu2u) && $useoldu2u == 'yes') ? 'yes' : 'no';

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

    // Daylight Saving Time Mod Begin
    $dststatus = (isset($dststatus) && $dststatus == 'yes') ? 'yes' : 'no';
    // Daylight Saving Time Mod End

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

$db->query("UPDATE $table_members SET email='$email',

========================================
Find Code In-Line 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 Mod Begin
    if ($self['dststatus'] == 'yes') {
        $timeoffset = $self['timeoffset'] + 1.0;
    } else {
        $timeoffset = $self['timeoffset'];
    }
    // Daylight Saving Time Mod 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 Administration Panel --> Templates
===============================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[texttimeformat]</td>
<td bgcolor="$altbg2" class="tablerow"><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="$altbg1" width="22%">$lang[dststatus]</td>
<td bgcolor="$altbg2">
<select name="dststatus">
<option value="yes" $dststatusyes>$lang[textyes]</option>
<option value="no" $dststatusno>$lang[textno]</option>
</select>
</td>
</tr>

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

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[texttimeformat]</td>
<td bgcolor="$altbg2" class="tablerow"><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="$altbg1" width="22%">$lang[dststatus]</td>
<td bgcolor="$altbg2">
<select name="dststatus">
<option value="no">$lang[textno]</option>
<option value="yes">$lang[textyes]</option>
</select>
</td>
</tr>

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

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[texttimeformat]</td>
<td bgcolor="$altbg2" class="tablerow"><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="$altbg1" width="22%">$lang[dststatus]</td>
<td bgcolor="$altbg2">
<select name="dststatus">
<option value="yes" $dststatusyes>$lang[textyes]</option>
<option value="no" $dststatusno>$lang[textno]</option>
</select>
</td>
</tr>

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