Modification Name: More Banning Options

Version: 1.0

Compatibility: XMB 1.9.8 SP3

Author: Area51mafia

Updated for 1.9.8 by: WormHole @ XMB Garage

Description: This modification will allow you to ban a member from making new threads, or limit there postings too 5, 10, 15, 25, or 50 posts in a 24 hour period.

Notes: Please backup all php files and templates before installing this modification.

This modification is released under the GPL License. A copy is provided with this software package.

Please backup your files 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:
=======
===============
Edit File: post.php
===============
==========
Find Code:
==========

if ($self['ban'] == "posts" || $self['ban'] == "both") {
    error($lang['textbanfrompost']);
}

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

// More Banning Options Begin
if ($self['ban'] == "day5ban" || $self['ban'] == "day10ban" || $self['ban'] == "day15ban" || $self['ban'] == "day25ban" || $self['ban'] == "day50ban") {
    $timesearch = time() - 86400;
    $hm = $db->query("SELECT * FROM $table_posts WHERE dateline >= '$timesearch' AND author='$xmbuser'");
    $numposts = $db->num_rows($hm);
    if ($self['ban'] == "day5ban" && $numposts >=5 && $action != "edit") {
        error($lang['textbanfor5days']);
    } else if ($self['ban'] == "day10ban" && $numposts >=10 && $action != "edit") {
        error($lang['textbanfor10days']);
    } else if ($self['ban'] == "day15ban" && $numposts >=15 && $action != "edit") {
        error($lang['textbanfor15days']);
    } else if ($self['ban'] == "day25ban" && $numposts >=25 && $action != "edit") {
        error($lang['textbanfor25days']);
    } else if ($self['ban'] == "day50ban" && $numposts >=50 && $action != "edit") {
         error($lang['textbanfor50days']);
    }
    $db->free_result($hm);
}
// More Banning Options End

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

    case 'newthread':

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

        // More Banning Options Begin
        if ($self['ban'] == "topics") {
            error($lang['textbanfromtopics']);
        }
        // More Banning Options End

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

            $noban = $u2uban = $postban = $bothban = '';

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

            // More Banning Options Begin
            $noban = $u2uban = $postban = $bothban = $topicsban = $day5ban = $day10ban = $day15ban = $day25ban = $day50ban = '';
            // More Banning Options End

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

                    case 'both':
                        $bothban = $selHTML;
                        break;

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

                    // More Banning Options Begin
                    case 'topics':
                        $topicsban = $selHTML;
                        break;
                    case 'day5ban':
                        $day5ban = $selHTML;
                        break;
                    case 'day10ban':
                        $day10ban = $selHTML;
                        break;
                    case 'day15ban':
                        $day15ban = $selHTML;
                        break;
                    case 'day25ban':
                        $day25ban = $selHTML;
                        break;
                    case 'day50ban':
                        $day50ban = $selHTML;
                        break;
                    // More Banning Options End

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

                <option value="both" <?php echo $bothban?>><?php echo $lang['banboth']?></option>

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

                <!-- More Banning Options Begin -->
                <option value="topics" <?php echo $topicsban?>><?php echo $lang['bantopics']?></option>
                <option value="day5ban" <?php echo $day5ban?>><?php echo $lang['ban5pday']?></option>
                <option value="day10ban" <?php echo $day10ban?>><?php echo $lang['ban10pday']?></option>
                <option value="day15ban" <?php echo $day15ban?>><?php echo $lang['ban15pday']?></option>
                <option value="day25ban" <?php echo $day25ban?>><?php echo $lang['ban25pday']?></option>
                <option value="day50ban" <?php echo $day50ban?>><?php echo $lang['ban50pday']?></option>
                <!-- More Banning Options End -->

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

                $noban = $u2uban = $postban = $bothban = '';

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

                // More Banning Options Begin
                $noban = $u2uban = $postban = $bothban = $topicsban = $day5ban = $day10ban = $day15ban = $day25ban = $day50ban = '';
                // More Banning Options End

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

// More Banning Options Begin
$lang['textbanfromtopics'] = "You cannot make a new topic because your posting rights are limited.";
$lang['textbanfor5days'] = "You cannot post any more today because you are limited to 5 posts per day.";
$lang['textbanfor10days'] = "You cannot post any more today because you are limited to 10 posts per day.";
$lang['textbanfor15days'] = "You cannot post any more today because you are limited to 15 posts per day.";
$lang['textbanfor25days'] = "You cannot post any more today because you are limited to 25 posts per day.";
$lang['textbanfor50days'] = "You cannot post any more today because you are limited to 50 posts per day.";
$lang['bantopics'] = "New topics";
$lang['ban5pday'] = "5 posts per day";
$lang['ban10pday'] = "10 posts per day";
$lang['ban15pday'] = "15 posts per day";
$lang['ban25pday'] = "25 posts per day";
$lang['ban50pday'] = "50 posts per day";
// More Banning Options End

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