Title: Marital Status Selection v1.0

Author: John Briggs

Description:
This mod will provide an option on registration to select a marital status.
This mod will provide an option in member control panel to select a marital status.
This mod will provide an option in admin editprofile to select a marital status.
This mod will display marital status in the member's profile.
This mod will display marital status in the member's posts.
This mod will display marital status in the member's control panel.

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: member.php
=====================

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

loadtemplates(

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

loadtemplates('member_profile_marital',

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

        $sig           = checkInput($_POST['sig']);

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

        $marital = isset($marital) ? checkInput($marital, '', '', 'javascript', false) : '';

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

        $locationnew    = addslashes($locationnew);

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

        $marital = addslashes($marital);

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

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

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

) VALUES ('', '$username'

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

, marital) VALUES ('', '$username'

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

)");

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

, '$marital')");

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

            if ($memberinfo['customstatus'] != '') {
                $showtitle = $rank['title'];
                $customstatus = '<br />'.$memberinfo['customstatus'];
            } else {
                $showtitle = $rank['title'];
                $customstatus = '';
            }

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

            if ($memberinfo['marital'] != '' && $memberinfo['marital'] == $lang['married']) {
                $maritaltxt = $lang['married'];
                eval('$maritalblock = "'.template('member_profile_marital').'";');
            } elseif ($memberinfo['marital'] != '' && $memberinfo['marital'] == $lang['single']) {
                $maritaltxt = $lang['single'];
                eval('$maritalblock = "'.template('member_profile_marital').'";');
            } elseif ($memberinfo['marital'] != '' && $memberinfo['marital'] == $lang['divorced']) {
                $maritaltxt = $lang['divorced'];
                eval('$maritalblock = "'.template('member_profile_marital').'";');
            } elseif ($memberinfo['marital'] != '' && $memberinfo['marital'] == $lang['widowed']) {
                $maritaltxt = $lang['widowed'];
                eval('$maritalblock = "'.template('member_profile_marital').'";');
            } elseif ($memberinfo['marital'] != '' && $memberinfo['marital'] == $lang['engaged']) {
                $maritaltxt = $lang['engaged'];
                eval('$maritalblock = "'.template('member_profile_marital').'";');
            } else {
                $maritaltxt = $maritalblock = '';
            }

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

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

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

        eval("\$profile = \"".template("memcp_profile")."\";");
        $profile = stripslashes($profile);
        echo $profile;

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

        $marital_none = $marital_married = '';
        $marital_single = $marital_divorced = '';
        $marital_widowed = $marital_engaged = '';
        if ($member['marital'] == '') {
            $marital_none = 'selected="selected"';
        } elseif ($member['marital'] == $lang['married']) {
            $marital_married = 'selected="selected"';
        } elseif ($member['marital'] == $lang['single']) {
            $marital_single = 'selected="selected"';
        } elseif ($member['marital'] == $lang['divorced']) {
            $marital_divorced = 'selected="selected"';
        } elseif ($member['marital'] == $lang['widowed']) {
            $marital_widowed = 'selected="selected"';
        } elseif ($member['marital'] == $lang['engaged']) {
            $marital_engaged = 'selected="selected"';
        }

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

        $sig            = isset($newsig) ? checkInput($newsig, '', $SETTINGS['sightml'], '', false) : '';

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

        $marital = isset($marital) ? checkInput($marital, '', '', 'javascript', false) : '';

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

        $memlocation    = addslashes($memlocation);

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

        $marital = addslashes($marital);

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

        $db->query("UPDATE $table_members SET $pwtxt

==================================================
Find Code In-Line At End Of Above Query Statement:
==================================================

 WHERE username='$xmbuser'");

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

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

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

    if ($member['mood'] != '') {
        $member['mood'] = censor($member['mood']);
        $member['mood'] = postify($member['mood'], 'no', 'no', 'yes', 'no', 'yes', 'no', true, 'yes');
    } else {
        $member['mood'] = '&nbsp;';
    }

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

    if ($member['marital'] != '' && $member['marital'] == $lang['married']) {
        $maritaltxt = $lang['married'] ;
    } elseif ($member['marital'] != '' && $member['marital'] == $lang['single']) {
        $maritaltxt = $lang['single'];
    } elseif ($member['marital'] != '' && $member['marital'] == $lang['divorced']) {
        $maritaltxt = $lang['divorced'];
    } elseif ($member['marital'] != '' && $member['marital'] == $lang['widowed']) {
        $maritaltxt = $lang['widowed'];
    } elseif ($member['marital'] != '' && $member['marital'] == $lang['engaged']) {
        $maritaltxt = $lang['engaged'];
    } else {
        $maritaltxt = '';
    }

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

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

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

    eval('echo stripslashes("'.template('admintool_editprofile').'");');

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

    $marital_none = $marital_married = '';
    $marital_single = $marital_divorced = '';
    $marital_widowed = $marital_engaged = '';
    if ($member['marital'] == '') {
        $marital_none = $selHTML;
    } elseif ($member['marital'] == $lang['married']) {
        $marital_married = $selHTML;
    } elseif ($member['marital'] == $lang['single']) {
        $marital_single = $selHTML;
    } elseif ($member['marital'] == $lang['divorced']) {
        $marital_divorced = $selHTML;
    } elseif ($member['marital'] == $lang['widowed']) {
        $marital_widowed = $selHTML;
    } elseif ($member['marital'] == $lang['engaged']) {
        $marital_engaged = $selHTML;
    }

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

    $sig            = isset($newsig) ? checkInput($newsig, '', $SETTINGS['sightml'], '', false) : '';

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

    $marital = isset($marital) ? checkInput($marital, '', '', 'javascript', false) : '';

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

    $memlocation    = addslashes($newmemlocation);

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

    $marital = addslashes($marital);

==========
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:
==================

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

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

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

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

            if ($post['location'] != '') {
                $post['location'] = censor($post['location']);
                $location = '<br />'.$lang['textlocation'].' '.$post['location'];
            } else {
                $location = '';
            }

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

            if ($post['marital'] != '' && $post['marital'] == $lang['married']) {
                $maritaltxt = '<br /><strong>'.$lang['marital'].'</strong> '.$lang['married'];
            } elseif ($post['marital'] != '' && $post['marital'] == $lang['single']) {
                $maritaltxt = '<br /><strong>'.$lang['marital'].'</strong> '.$lang['single'];
            } elseif ($post['marital'] != '' && $post['marital'] == $lang['divorced']) {
                $maritaltxt = '<br /><strong>'.$lang['marital'].'</strong> '.$lang['divorced'];
            } elseif ($post['marital'] != '' && $post['marital'] == $lang['widowed']) {
                $maritaltxt = '<br /><strong>'.$lang['marital'].'</strong> '.$lang['widowed'];
            } elseif ($post['marital'] != '' && $post['marital'] == $lang['engaged']) {
                $maritaltxt = '<br /><strong>'.$lang['marital'].'</strong> '.$lang['engaged'];
            } else {
                $maritaltxt = '';
            }

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

            $location = '';
            $mood = '';

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

            $maritaltxt = '';

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

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

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

$lang['marital'] = 'Marital Status:';
$lang['maritalnone'] = 'None';
$lang['married'] = 'Married';
$lang['single'] = 'Single';
$lang['divorced'] = 'Divorced';
$lang['widowed'] = 'Widowed';
$lang['engaged'] = 'Engaged';

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

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

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

$location

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

$maritaltxt

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

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

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

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[textlanguage]</td>
<td bgcolor="$altbg2" class="tablerow">$langfileselect</td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[marital]</td>
<td bgcolor="$altbg2">
<select name="marital">
<option value="">$lang[maritalnone]</option>
<option value="$lang[married]">$lang[married]</option>
<option value="$lang[single]">$lang[single]</option>
<option value="$lang[divorced]">$lang[divorced]</option>
<option value="$lang[widowed]">$lang[widowed]</option>
<option value="$lang[engaged]">$lang[engaged]</option>
</select>
</td>
</tr>

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

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

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

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[textlanguage]</td>
<td bgcolor="$altbg2" class="tablerow">$langfileselect </td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[marital]</td>
<td bgcolor="$altbg2">
<select name="marital">
<option value="" $marital_none>$lang[maritalnone]</option>
<option value="$lang[married]" $marital_married>$lang[married]</option>
<option value="$lang[single]" $marital_single>$lang[single]</option>
<option value="$lang[divorced]" $marital_divorced>$lang[divorced]</option>
<option value="$lang[widowed]" $marital_widowed>$lang[widowed]</option>
<option value="$lang[engaged]" $marital_engaged>$lang[engaged]</option>
</select>
</td>
</tr>

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

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

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

<tr>
<td bgcolor="$altbg1" class="tablerow" width="22%">$lang[textlanguage]</td>
<td bgcolor="$altbg2" class="tablerow">$langfileselect </td>
</tr>

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

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[marital]</td>
<td bgcolor="$altbg2">
<select name="marital">
<option value="" $marital_none>$lang[maritalnone]</option>
<option value="$lang[married]" $marital_married>$lang[married]</option>
<option value="$lang[single]" $marital_single>$lang[single]</option>
<option value="$lang[divorced]" $marital_divorced>$lang[divorced]</option>
<option value="$lang[widowed]" $marital_widowed>$lang[widowed]</option>
<option value="$lang[engaged]" $marital_engaged>$lang[engaged]</option>
</select>
</td>
</tr>

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

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

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

$emailblock

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

$maritalblock

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

================================================================================
Go to admin panel -> templates -> create template name -> member_profile_marital
================================================================================

================================
Add Code & Click Submit Changes:
================================

<tr class="tablerow">
<td bgcolor="$altbg1" width="22%">$lang[marital]</td>
<td bgcolor="$altbg2">$maritaltxt</td>
</tr>

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

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

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

<td bgcolor="$altbg1" valign="top">&nbsp;</td>
<td bgcolor="$altbg2" valign="top">&nbsp;</td>

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

<td bgcolor="$altbg1" valign="top">$lang[marital]</td>
<td bgcolor="$altbg2" valign="top">$maritaltxt</td>

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