Title: Forum Based Quick Reply Status v1.0

Author: John Briggs

Description:
This mod will provide an on/off control for quick reply per forum. XMB does not have this by default.

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.5 Final

Install Note: Before adding this mod to your forum, you should back up all files related to this mod.

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

Author Note:
You downloaded this hack from XMBMods.com, the #1 source for XMB related downloads.
Please visit http://www.xmbmods.com/ for support.

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

===================================
Go To Admin Panel -> Insert Raw SQL
===================================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

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

================================
Edit File: lang/English.lang.php
================================

================================
Add Code At Very Bottom Of File:
================================

// Forum Based Quick Reply Status Mod Begin
$lang['qreplystatus'] = "Quick Reply Status:<br /><span class=\"smalltxt\">This will disable the quick reply for members only.</span>";
// Forum Based Quick Reply Status Mod End

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

=================
Edit File: cp.php
=================

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

        $type31 = $type32 = $type33 = $type34 = '';
        if ($forum['private'] == "2") {
            $type32 = "selected";
        } elseif ($forum['private'] == "3") {
            $type33 = "selected";
        } elseif ($forum['private'] == "4") {
            $type34 = "selected";
        } elseif ($forum['private'] == "1") {
            $type31 = "selected";
        }

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

        // Forum Based Quick Reply Status Mod Begin
        $qreplyon = $qreplyoff = '';
        switch ($forum['qreplystatus']) {
            case 'on':
                $qreplyon = $selHTML;
                break;
            default:
                $qreplyoff = $selHTML;
                break;
        }
        // Forum Based Quick Reply Status Mod End

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

        <tr class="tablerow">
        <td bgcolor="<?php echo $altbg1?>"><?php echo $lang['texttheme']?></td>
        <td bgcolor="<?php echo $altbg2?>"><?php echo $themelist?></td>
        </tr>

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

        <?php
        printsetting1($lang['qreplystatus'], 'qreplystatusnew', $qreplyon, $qreplyoff);
        ?>

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

            if ($newfname != $lang['textnewforum']) {
                $newfname = addslashes($newfname);
                $db->query("INSERT INTO $table_forums ( type, fid, name, status, lastpost, moderator, displayorder, private, description, allowhtml, allowsmilies, allowbbcode, userlist, theme, posts, threads, fup, postperm, allowimgcode, attachstatus, pollstatus, password, guestposting ) VALUES ('forum', '', '$newfname', '$newfstatus', '', '', '$newforder', '1', '', 'no', 'yes', 'yes', '', '', '0', '0', '$newffup', '1|1', 'yes', 'on', 'on', '', 'off')");
            }

=====================================
Find Code IN-LINE in Above Statement:
=====================================

) VALUES ('forum',

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

, qreplystatus ) VALUES ('forum',

====================================
Find Code At End Of Above Statement:
====================================

)");

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

, 'on')");

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

            if ($newgname != $lang['textnewgroup']) {
                $newgname = addslashes($newgname);
                $db->query("INSERT INTO $table_forums ( type, fid, name, status, lastpost, moderator, displayorder, private, description, allowhtml, allowsmilies, allowbbcode, userlist, theme, posts, threads, fup, postperm, allowimgcode, attachstatus, pollstatus, password, guestposting ) VALUES ('group', '', '$newgname', '$newgstatus', '', '', '$newgorder', '', '', '', '', '', '', '', '0', '0', '', '', '', '', '', '', 'off')");
            }

=====================================
Find Code IN-LINE in Above Statement:
=====================================

) VALUES ('group',

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

, qreplystatus ) VALUES ('group',

====================================
Find Code At End Of Above Statement:
====================================

)");

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

, 'on')");

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

            if ($newsubname != $lang['textnewsubf']) {
                $newsubname = addslashes($newsubname);
                $db->query("INSERT INTO $table_forums ( type, fid, name, status, lastpost, moderator, displayorder, private, description, allowhtml, allowsmilies, allowbbcode, userlist, theme, posts, threads, fup, postperm, allowimgcode, attachstatus, pollstatus, password, guestposting ) VALUES ('sub', '', '$newsubname', '$newsubstatus', '', '', '$newsuborder', '1', '', 'no', 'yes', 'yes', '', '', '0', '0', '$newsubfup', '1|1', 'yes', 'on', 'on', '', 'off')");
            }

=====================================
Find Code IN-LINE in Above Statement:
=====================================

) VALUES ('sub',

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

, qreplystatus ) VALUES ('sub',

====================================
Find Code At End Of Above Statement:
====================================

)");

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

, 'on')");

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

            $check_vars = array('allowhtmlnew', 'allowsmiliesnew', 'allowbbcodenew', 'allowimgcodenew', 'attachstatusnew', 'pollstatusnew', 'guestpostingnew');
            foreach ($check_vars as $key) {
                if ($$key != 'on' && $$key != 'yes') {
                    $$key = 'off';
                }
            }

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

            // Forum Based Quick Reply Status Mod Begin
            $qreplystatusnew = ($qreplystatusnew == 'on') ? 'on' : 'off';
            // Forum Based Quick Reply Status Mod End

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

$db->query("UPDATE $table_forums SET name='$namenew',

====================================
Find Code At End Of Above Statement:
====================================

 WHERE fid='$fdetails'");

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

, qreplystatus='$qreplystatusnew' WHERE fid='$fdetails'");

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

=========================
Edit File: viewthread.php
=========================

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

    if ($thread['closed'] == 'yes') {
        if (X_SADMIN) {
            eval("\$replylink = \"".template('viewthread_reply')."\";");
            eval("\$quickreply = \"".template('viewthread_quickreply')."\";");
        }
        $closeopen = $lang['textopenthread'];
    } else {
        $closeopen = $lang['textclosethread'];
        eval("\$replylink = \"".template('viewthread_reply')."\";");
        eval("\$quickreply = \"".template('viewthread_quickreply')."\";");
    }

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

    // Forum Based Quick Reply Status Mod Begin
    if ($thread['closed'] == 'yes') {
        if (X_SADMIN) {
            eval('$replylink = "'.template('viewthread_reply').'";');
            eval('$quickreply = "'.template('viewthread_quickreply').'";');
        }
        $closeopen = $lang['textopenthread'];
    } else {
        $closeopen = $lang['textclosethread'];
        eval('$replylink = "'.template('viewthread_reply').'";');
        if (isset($forum['qreplystatus']) && $forum['qreplystatus'] == 'on') {
            eval('$quickreply = "'.template('viewthread_quickreply').'";');
        }
    }
    // Forum Based Quick Reply Status Mod End

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