Title: Custom Status Quota

Author: John Briggs

Description:
This modification will add the option for members to edit there custom status after so many posts.
This modification will add the option for administrator to control how many posts a member must have in order to edit custom status.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.11

Install 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.

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

============================================
Go to Administration Panel -> Insert Raw SQL
============================================

Drop each line below into the window and press the "submit" button:

ALTER TABLE `$table_settings` ADD `customquota` smallint(5) NOT NULL default '100';

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

=====================
Edit file: header.php
=====================

/* Set Up HTML Templates and Themes */

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

// Custom Status Quota Mod Begin
// Assert Custom Status Quota Translation
if (!isset($lang['customquota_no'])) {
    require_once(ROOT.'include/translation.inc.php');
    $phrases = array();
    $phrases['customquota_no'] = " posts are required to change your ";
    $phrases['set_customquota'] = "Custom status quota:<br /><small>The total will be the amount of posts required to edit custom status.</small>";
    setManyLangValues($phrases, $langfile);
    loadLang($langfile);
}
// Custom Status Quota Mod End

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

=================
Edit file: cp.php
=================

==========
Find code:
==========

        printsetting2($lang['u2uquota'], 'u2uquotanew', ((int)$SETTINGS['u2uquota']), 3);

===============
Add code below:
===============

        // Custom Status Quota Mod Begin
        printsetting2($lang['set_customquota'], 'customquotanew', ((int)$SETTINGS['customquota']), 3);
        // Custom Status Quota Mod End

==========
Find code:
==========

        $remoteimages = formOnOff('remoteimages');

===============
Add code below:
===============

        // Custom Status Quota Mod Begin
        $customquotanew = formInt('customquotanew');
        // Custom Status Quota Mod End

==========
Find code:
==========

        $sql = "UPDATE ".X_PREFIX."settings SET

===============
Add code below:
===============

            customquota='$customquotanew',

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

====================
Edit file: memcp.php
====================

==========
Find code:
==========

loadtemplates(

===============
Add code below:
===============

'memcp_profile_custom',
'memcp_profile_custom_none',

==========
Find code:
==========

        $member['icq'] = ($member['icq'] > 0) ? $member['icq'] : '';

===============
Add code below:
===============

        // Custom Status Quota Mod Begin
        $customblock = 'memcp_profile_custom_none';
        if (X_STAFF || (X_MEMBER && $member['postnum'] > $SETTINGS['customquota'])) {
            $customblock = 'memcp_profile_custom';
        }
        eval('$customblock = "'.template($customblock).'";');
        // Custom Status Quota Mod End

==========
Find code:
==========

        $sig = postedVar('newsig', 'javascript', ($SETTINGS['sightml']=='off'), TRUE, TRUE);

===============
Add code below:
===============

        // Custom Status Quota Mod Begin
        $cstatus = '';
        if (X_STAFF || (X_MEMBER && $self['postnum'] > $SETTINGS['customquota'])) {
            $customstatus = postedVar('newcustomstatus', 'javascript', TRUE, TRUE, TRUE);
            $cstatus = "customstatus = '$customstatus',";
        }
        // Custom Status Quota Mod End

==========
Find code:
==========

        $db->query("UPDATE ".X_PREFIX."members SET $pwtxt

==================
Replace code with:
==================

        $db->query("UPDATE ".X_PREFIX."members SET $pwtxt $cstatus

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

=======================================
Go to administration panel -> templates
=======================================

==========================================
Create template name: memcp_profile_custom
==========================================

==========================
Add code and click submit:
==========================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textcusstatus]:</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newcustomstatus" size="25" value="$member[customstatus]" /></td>
</tr>

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

=======================================
Go to administration panel -> templates
=======================================

=================================
Edit template name: memcp_profile
=================================

==========
Find code:
==========

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textsite]</td>
<td bgcolor="$THEME[altbg2]"><input type="text" name="newsite" size="25" value="$member[site]" /></td>
</tr>

===============
Add code above:
===============

$customblock

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

=======================================
Go to administration panel -> templates
=======================================

===============================================
Create template name: memcp_profile_custom_none
===============================================

==========================
Add code and click submit:
==========================

<tr class="tablerow">
<td bgcolor="$THEME[altbg1]" width="22%">$lang[textcusstatus]:</td>
<td bgcolor="$THEME[altbg2]"><strong><span class="smalltxt">$SETTINGS[customquota]$lang[customquota_no]$lang[textcusstatus].</span></strong></td>
</tr>

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