Modification Title: Forum Based Signature Display Control v1.0

Modification Author: Ahmad

Based On The Forum Based Avatar Display Control by Scan and John Briggs

Modification Description:
This modification will provide an on/off control per forum settings to allow signatures to display in a specific forum or not.

Compatability: XMB 1.9.8 SP3

Copyright:  2006 Ahmad. All rights reserved.

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

=======================================================================================================================
=======
Step 1:
=======
===================================
Go To Administration Panel-->Insert Raw SQL
===================================

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

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

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

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

        // Forum Based Signature Display Control Mod Begin
        $fsigyes = $fsigno = '';
        switch ($forum['fsig']) {
            case 'yes':
                $fsigyes = $selHTML;
                break;
            case 'no':
                $fsigno = $selHTML;
                break;
        }
        // Forum Based Signature Display Control Mod End

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

        <input type="checkbox" name="guestpostingnew" value="on" <?php echo $checked8?> /><?php echo $lang['textanonymousposting']?><br />
        </td>
        </tr>

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

        <!-- Forum Based Signature Display Control Mod Begin -->
        <tr class="tablerow">
        <td bgcolor="<?php echo $THEME['altbg1']?>"><?php echo $lang['fsigstatus']?></td>
        <td bgcolor="<?php echo $THEME['altbg2']?>">
        <select name="fsignew">
        <option value="yes" <?php echo $fsigyes?>><?php echo $lang['textyes']?></option>
        <option value="no" <?php echo $fsigno?>><?php echo $lang['textno']?></option>
        </select>
        </td>
        </tr>
        <!-- Forum Based Signature Display Control Mod End -->

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

        if ($newfname != $lang['textnewforum']) {
            $newfname = addslashes($newfname);
            $db->query("INSERT INTO ".X_PREFIX."forums (type, 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', '', '', ".(int)$newforder.", '1', '', 'no', 'yes', 'yes', '', 0, 0, 0, ".(int)$newffup.", '1|1', 'yes', 'on', 'on', '', 'off')");
        }

=============================
Find Code In Above Statement In-line:
=============================


) VALUES ('forum',

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

, fsig) VALUES ('forum',

============================
Find Code At End Of The Same Line:
============================

)");

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

, 'yes')");

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

        if ($newgname != $lang['textnewgroup']) {
            $newgname = addslashes($newgname);
            $db->query("INSERT INTO ".X_PREFIX."forums (type, 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', '', '', ".(int)$newgorder.", '', '', '', '', '', '', 0, 0, 0, 0, '', '', '', '', '', 'off')");
        }

=============================
Find Code In Above Statement In-line:
=============================

) VALUES ('group',

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

, fsig) VALUES ('group',

============================
Find Code At End Of The Same Line:
============================

)");

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

, 'yes')");

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

        if ($newsubname != $lang['textnewsubf']) {
            $newsubname = addslashes($newsubname);
            $db->query("INSERT INTO ".X_PREFIX."forums (type, 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', '', '', ".(int)$newsuborder.", '1', '', 'no', 'yes', 'yes', '', 0, 0, 0, ".(int)$newsubfup.", '1|1', 'yes', 'on', 'on', '', 'off')");
        }

=============================
Find Code In Above Statement In-line:
=============================

) VALUES ('sub',

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

, fsig) VALUES ('sub',

============================
Find Code At End Of The Same Line:
============================

)");

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

, 'yes')");

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

        $guestpostingnew = formOnOff('guestpostingnew');

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

        // Forum Based Signature Display Control Mod Begin
        $fsignew = formYesNo('fsignew');
        // Forum Based Signature Display Control Mod End

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

        $db->query("UPDATE ".X_PREFIX."forums SET

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

        $db->query("UPDATE ".X_PREFIX."forums SET
            fsig='$fsignew',

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

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

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

        if ($post['usesig'] == 'yes') {
            $post['sig'] = postify($post['sig'], 'no', 'no', $forum['allowsmilies'], $SETTINGS['sightml'], $SETTINGS['sigbbcode'], $forum['allowimgcode'], false);
            eval("\$post['message'] .= \"".template('viewthread_post_sig')."\";");
        } else {
            eval("\$post['message'] .= \"".template('viewthread_post_nosig')."\";");
        }


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

        if ($post['usesig'] == 'yes') {
            // Forum Based Signature Display Control Mod Begin
            if ($forum['fsig'] == 'yes') {
            // Forum Based Signature Display Control Mod End
                $post['sig'] = postify($post['sig'], 'no', 'no', $forum['allowsmilies'], $SETTINGS['sightml'], $SETTINGS['sigbbcode'], $forum['allowimgcode'], false);
                eval("\$post['message'] .= \"".template('viewthread_post_sig')."\";");
            } else {
                eval("\$post['message'] .= \"".template('viewthread_post_nosig')."\";");
            }
        }

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

==============================
Add Code To Bottom Of File Above ?>
==============================

// Forum Based Signature Display Control Mod Begin
$lang['fsigstatus'] = 'Allow signatures to display in this forum?';
// Forum Based Signature Display Control Mod End

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