============================================================================================================================
Modification Name: Minimum Post Characters

Version: 1.0

Description: This modification gives a setting in the admin control panel to set a minimum number of how many characters are needed before a post will be posted.

Inspired By FunForum's Version so he deserves credit for this being completed.

Code Designed By: John Briggs

Compatability: XMB 1.9.5 SP1

Note: Please backup all effected files, templates & databases prior to proceeding with this modification for your own safety.

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

Author Note:
You downloaded this modification from XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======
===================================
Go To Administration Panel --> Insert Raw SQL
==============================
Insert Code Below and Submit Changes:
==============================

ALTER TABLE $table_settings ADD `min_chars_in_msg` text NOT NULL;

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

            if ($self['status'] == "Banned") {
                error($lang['bannedmessage']);
            }

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

            // Minimum Post Characters Mod Begin
            if (strlen($message) < $min_chars_in_msg) {
                eval('$header = "'.template('header').'";');
                echo $header;
                echo "<center><span class=\"mediumtxt \">$lang[minamountmessage]</span></center>";
                ?>
                <script>
                function redirect() {
                    window.location.replace("viewthread.php?tid=<?=$tid?>");
                }
                setTimeout("redirect();", 1250);
                </script>
                <?php
                end_time();
                eval('$footer = "'.template('footer').'";');
                echo $footer;
                exit();
            }
            // Minimum Post Characters Mod End

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

        if ($self['status'] == "Banned") {
            error($lang['bannedmessage']);
        }

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

        // Minimum Post Characters Mod Begin
        if (strlen($message) < $min_chars_in_msg) {
            eval('$header = "'.template('header').'";');
            echo $header;
            echo "<center><span class=\"mediumtxt \">$lang[minamountmessage]</span></center>";
            ?>
            <script>
            function redirect() {
                window.location.replace("forumdisplay.php?fid=<?=$fid?>");
            }
            setTimeout("redirect();", 1250);
            </script>
            <?php
            end_time();
            eval('$footer = "'.template('footer').'";');
            echo $footer;
            exit();
        }
        // Minimum Post Characters Mod End

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

        if ($self['status'] == "Banned") {
            error($lang['bannedmessage']);
        }

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

        // Minimum Post Characters Mod Begin
        if (strlen($message) < $min_chars_in_msg) {
            eval("\$header = \"".template("header")."\";");
            echo $header;
            echo "<center><span class=\"mediumtxt \">$lang[minamountmessage]</span></center>";
            ?>
            <script>
            function redirect() {
                window.location.replace("forumdisplay.php?fid=<?=$fid?>");
            }
            setTimeout("redirect();", 1250);
            </script>
            <?php	
            end_time();
            eval("\$footer = \"".template("footer")."\";");
            echo $footer;
            exit();
        }
        // Minimum Post Characters Mod End

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

// Minimum Post Characters Mod Begin
$lang['minamountofchars'] = "Minimum amount of characters in a post:";
$lang['minamountmessage'] = "Your post contains less than $min_chars_in_msg characters. Please go back and make a full post.";
// Minimum Post Characters Mod End

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

        $SETTINGS['tickercontents'] = stripslashes($SETTINGS['tickercontents']);

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

        // Minimum Post Characters Mod Begin
        $SETTINGS['min_chars_in_msg'] = stripslashes($SETTINGS['min_chars_in_msg']);
        // Minimum Post Characters Mod End

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

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

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

        // Minimum Post Characters Mod Begin
        printsetting2($lang['minamountofchars'], "min_chars_in_msgnew", $SETTINGS['min_chars_in_msg'], "2");
        // Minimum Post Characters Mod End

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

        $bboffreasonnew = addslashes($bboffreasonnew);

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

        // Minimum Post Characters Mod Begin
        $min_chars_in_msgnew = addslashes($min_chars_in_msgnew);
        // Minimum Post Characters Mod End

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

        $db->query("UPDATE $table_settings SET

===========================
Find Code In-Line At The Very End:
===========================

");

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

, min_chars_in_msg = '$min_chars_in_msgnew'");

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