Title: Auto Subscribe To Threads Option v1.0

Author: John Briggs

Description:
This mod will provide an option in member control panel for members to choose to auto subscribe to threads on posting.

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.5 Final

Install Note: Before adding this mod to your forum, you should back up all files related to this mod.

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

Author Note:
You downloaded this hack from XMBMods.com, the #1 source for XMB related downloads.
Please visit http://www.xmbmods.com/ for support.

=======================================================================================================================================
=======
Step 1:
=======

===================================
Go To Admin Panel -> Insert Raw SQL
===================================

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

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

==========================
Edit File: editprofile.php
==========================

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

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

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

    $autosubchecked = '';
    if ($member['autosub'] == 'yes') {
        $autosubchecked = $cheHTML;
    }

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

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

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

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


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

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

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

 WHERE username='$user'");

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

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

=======================================================================================================================================
=======
Step 3:
=======

====================
Edit File: memcp.php
====================

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

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

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

        $autosubchecked = '';
        if ($member['autosub'] == 'yes') {
            $autosubchecked = $cheHTML;
        }

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

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

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

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

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

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

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

 WHERE username='$xmbuser'");

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

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

=======================================================================================================================================
=======
Step 4:
=======

=====================
Edit File: member.php
=====================

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

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

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

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

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

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

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

) VALUES ('', '$username',

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

, autosub) VALUES ('', '$username',

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

)");

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

, '$autosub')");

=======================================================================================================================================
=======
Step 5:
=======

=========================
Edit File: viewthread.php
=========================

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

    $smileoffcheck = (isset($smileyoff) && $smileyoff == 'yes') ? 'checked="checked"' : '';

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

    $autosubcheck = (isset($self['autosub']) && $self['autosub'] == 'yes') ? 'checked="checked"' : '';
    $self['autosub'] = (isset($self['autosub']) && $self['autosub'] == 'yes') ? 'yes' : 'no';

=======================================================================================================================================
=======
Step 6:
=======

===================
Edit File: post.php
===================

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

if (isset($emailnotify) && $emailnotify == 'yes') {
    $emailnotifycheck = 'checked="checked"';
} else {
    $emailnotifycheck = '';
    $emailnotify = 'no';
}

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

$autosubcheck = (isset($self['autosub']) && $self['autosub'] == 'yes') ? 'checked="checked"' : '';
$self['autosub'] = (isset($self['autosub']) && $self['autosub'] == 'yes') ? 'yes' : 'no';

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

if ( $emailnotify == "yes") {

=====================================
Replace Code With On Both Occassions:
=====================================

if ($emailnotify == 'yes' || $self['autosub'] == 'yes') {

=======================================================================================================================================
=======
Step 7:
=======

================================
Edit File: lang/English.lang.php
================================

================================
Add Code At Very Bottom Of File:
================================

// Auto Subscribe To Threads Option Mod Begin
$lang['autosub'] = "Auto-subscribe to all threads you post in?";
// Auto Subscribe To Threads Option Mod End

=======================================================================================================================================
=======
Step 8:
=======

=======================================================
Go to admin panel -> templates -> viewthread_quickreply
=======================================================

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

<tr>
<td width="15%"> <div align="left"><input type="checkbox" name="emailnotify" value="yes" /></div></td>
<td width="85%"> <div align="left">$lang[textemailnotify] </div></td>
</tr>

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

<tr>
<td width="15%"> <div align="left"><input type="checkbox" name="emailnotify" value="yes" $autosubcheck /></div></td>
<td width="85%"> <div align="left">$lang[textemailnotify] </div></td>
</tr>

=======================================================================================================================================
=======
Step 9:
=======

================================================
Go to admin panel -> templates -> post_newthread
================================================

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

<input type="checkbox" name="emailnotify" value="yes" $emailnotifycheck />

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

<input type="checkbox" name="emailnotify" value="yes" $emailnotifycheck $autosubcheck />

=======================================================================================================================================
========
Step 10:
========

============================================
Go to admin panel -> templates -> post_reply
============================================

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

<input type="checkbox" name="emailnotify" value="yes" $emailnotifycheck/>

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

<input type="checkbox" name="emailnotify" value="yes" $emailnotifycheck $autosubcheck />

=======================================================================================================================================
========
Step 11:
========

==============================================
Go to admin panel -> templates -> post_newpoll
==============================================

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

<input type="checkbox" name="emailnotify" value="yes" />

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

<input type="checkbox" name="emailnotify" value="yes" $emailnotifycheck $autosubcheck />

=======================================================================================================================================
========
Step 12:
========

=======================================================
Go to admin panel -> templates -> admintool_editprofile
=======================================================

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

<input type="checkbox" name="emailonu2u" value="yes" $eouchecked /> $lang[textemailonu2u]<br />

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

<input type="checkbox" name="autosub" value="yes" $autosubchecked /> $lang[autosub]<br />

=======================================================================================================================================
========
Step 13:
========

============================================
Go to admin panel -> templates -> member_reg
============================================

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

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

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

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

=======================================================================================================================================
========
Step 13:
========

===============================================
Go to admin panel -> templates -> memcp_profile
===============================================

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

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

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

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

=======================================================================================================================================