============================================================================================================================
Modification Name: Post Minimum To Enable U2U v1.0

Compatibility: XMB v1.9.5 SP1

Code Developed By: Jamie

Description: This modification will allow you to set a restriction so a member must have a certain number of posts before they're allowed to send u2us.
                   Staff Members are exempt from this restriction.

License Note: This modification is 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.8 SP4 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
===================================
=====================================
Copy and Paste Code Below and Submit Changes:
=====================================

ALTER TABLE `$table_settings` ADD `u2umpstatus` SET('on','off') DEFAULT 'off' NOT NULL;
ALTER TABLE `$table_settings` ADD `u2umpposts` SMALLINT(5) DEFAULT '0' NOT NULL;

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

        $msgto = isset($msgto) ? $msgto : '';

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

        // Post Minimum To Enable U2U Mod Begin
        if ($SETTINGS['u2umpstatus'] == "on") {
            if (!X_STAFF && $self['postnum'] < $SETTINGS['u2umpposts']) {
               error($lang['mpu2umsg'], false, $u2uheader, $u2ufooter, false, true, false, false); 
            }
        }
        // Post Minimum To Enable U2U Mod End

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

// Post Minimum To Enable U2U Mod Begin
$lang['mpu2ustatus'] = "Minimum Posts Needed to Send U2U's Status:";
$lang['mpu2uposts'] = "Minimum Posts Needed to Send U2U's:";
$lang['mpu2umsg'] = "You need a minimum of $SETTINGS[u2umpposts] posts to be able to use the U2U send feature!";
// Post Minimum To Enable U2U Mod End

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

        $tickerstatuson = $tickerstatusoff = '';
        if ($SETTINGS['tickerstatus'] == "on") {
            $tickerstatuson = $selHTML;
        } else {
            $tickerstatusoff = $selHTML;
        }

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

        // Post Minimum To Enable U2U Mod Begin
        $mpu2ustatuson = $mpu2ustatusoff = '';
        switch ($SETTINGS['u2umpstatus']) {
            case 'on':
                $mpu2ustatuson = $selHTML;
                break;
            default:
                $mpu2ustatusoff = $selHTML;
        }
        // Post Minimum To Enable U2U Mod End

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

        printsetting2($lang['textflood'], "floodctrlnew", $SETTINGS['floodctrl'], 3);

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

        // Post Minimum To Enable U2U Mod Begin
        printsetting1($lang['mpu2ustatus'], 'u2umpstatusnew', $mpu2ustatuson, $mpu2ustatusoff);
        printsetting2($lang['mpu2uposts'], "u2umppostsnew", $SETTINGS['u2umpposts'], 5);
        // Post Minimum To Enable U2U Mod End

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

        $max_avatar_size_h_new = (int) $max_avatar_size_h_new;

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

        // Post Minimum To Enable U2U Mod Begin
        $u2umppostsnew = (int) $u2umppostsnew;
        // Post Minimum To Enable U2U Mod End

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

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Post Minimum To Enable U2U Mod Begin
        $u2umpstatusnew = ($u2umpstatusnew == 'on') ? 'on' : 'off';
        // Post Minimum To Enable U2U Mod End

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

        $db->query("UPDATE $table_settings

At The End Of This Line Find This Code  ");

=================
Add Code Before  ");
=================

, u2umpstatus='$u2umpstatusnew', u2umpposts='$u2umppostsnew'

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