Modification Title: Flood Control Override v1.0

Modification Author: John Briggs

Updated for 1.9.8 by: WormHole @ XMB Garage

Modification Description:
This modification will allow staff members to be exempt by the flood control time settings.

Supported Version: XMB 1.9.8 SP3/SP4

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

Mod History:

3-13-05 - Version 1.0
- Initial commit.

3-31-06 - Version 1.0
- Updated for 1.9.5

01-07-08 - Version 1.0
- Updated for 1.9.8

08-26-09 - Version 1.0
- Updated for 1.9.8 SP4

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

            $query = $db->query("SELECT lastpost, type, fup FROM ".X_PREFIX."forums WHERE fid='$fid'");
            $for = $db->fetch_array($query);
            $db->free_result($query);
            $last = $for['lastpost'];

            if ($last != '') {
                $lastpost = explode('|', $last);
                $rightnow = $onlinetime - $floodctrl;
                if ($rightnow <= $lastpost[0] && $username == $lastpost[1]) {
                    $floodlink = "<a href=\"viewthread.php?fid=$fid&tid=$tid\">Click here</a>";
                    error($lang['floodprotect'].' '.$floodlink.' '.$lang['tocont']);
                }
            }
        
============
Replace With:
============

            // Flood Control Override Mod Begin
            if (!X_STAFF) {
                $query = $db->query("SELECT lastpost, type, fup FROM ".X_PREFIX."forums WHERE fid = '$fid'");
                $for = $db->fetch_array($query);
                $db->free_result($query);

                if (!empty($for['lastpost'])) {
                    $lastpost = explode("|", $for['lastpost']);
                    $rightnow = time() - $floodctrl;

                    if ($rightnow <= $lastpost['0'] && $username == $lastpost['1']) {
                        error($lang['floodprotect'].' '.$floodlink.' '.$lang['tocont']);
                    }
                }
            }
            // Flood Control Override Mod End

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

            $query = $db->query("SELECT lastpost, type, fup FROM ".X_PREFIX."forums WHERE fid='$fid'");
            $for = $db->fetch_array($query);
            $db->free_result($query);

            if ($for['lastpost'] != '') {
                $lastpost = explode('|', $for['lastpost']);
                $rightnow = $onlinetime - $floodctrl;
                if ($rightnow <= $lastpost[0] && $username == $lastpost[1]) {
                    error($lang['floodprotect'].' '.$floodlink.' '.$lang['tocont']);
                }
            }

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

            // Flood Control Override Mod Begin
            if (!X_STAFF) {
                $query = $db->query("SELECT lastpost, type, fup FROM ".X_PREFIX."forums WHERE fid = '$fid'");
                $for = $db->fetch_array($query);
                $db->free_result($query);
                $last = $for['lastpost'];

                if (!empty($last)) {
                $lastpost = explode("|", $last);
                $rightnow = time() - $floodctrl;

                    if ($rightnow <= $lastpost['0'] && $username == $lastpost['1']) {
                        $floodlink = "<a href=\"viewthread.php?fid=$fid&tid=$tid\">Click here</a>";
                        error($lang['floodprotect'].' '.$floodlink.' '.$lang['tocont']);
                    }
                }
            }
            // Flood Control Override Mod End

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