Mod Title: Forum Based Signatures Display Control

Mod Author: Ahmad

Inspired by the ( Forum Based Avatures display Control ) by Scan and John Briggs

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

Compatability: XMB 1.9.5

Copyright:  2006 Ahmad. All rights reserved.

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 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 = "selected";
        } elseif ($forum['private'] == "3") {
            $type33 = "selected";
        } elseif ($forum['private'] == "4") {
            $type34 = "selected";
        } elseif ($forum['private'] == "1") {
            $type31 = "selected";
        }

===============
Add Code Below:
===============
        $fsigsyes = $fsigsno = '';
        if ($forum['fsigs'] == 'yes') {
            $fsigsyes = $selHTML;
        } else {
            $fsigsno = $selHTML;
        }
==========
Find Code:
==========


        <tr class="tablerow">
        <td bgcolor="<?php echo $altbg1?>"><?php echo $lang['textdesc']?></td>
        <td bgcolor="<?php echo $altbg2?>"><textarea rows="4" cols="30" name="descnew"><?php echo htmlspecialchars($forum['description'])?></textarea></td>
        </tr>

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

        <tr class="tablerow">
        <td bgcolor="<?php echo $altbg1?>"><?php echo $lang['fsigsstatus']?></td>
        <td bgcolor="<?php echo $altbg2?>">
        <select name="fsigsnew">
        <option value="yes" <?php echo $fsigsyes?>><?php echo $lang['textyes']?></option>
        <option value="no" <?php echo $fsigsno?>><?php echo $lang['textno']?></option>
        </select>
        </td>
        </tr>
==========
Find Code:
==========

            if ($newfname != $lang['textnewforum']) {
                $newfname = addslashes($newfname);
                $db->query("INSERT INTO $table_forums

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

 ) VALUES ('forum',

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

, fsigs ) VALUES ('forum',

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

)");

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

, 'yes')");

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


if ($newgname != $lang['textnewgroup']) {
                $newgname = addslashes($newgname);
                $db->query("INSERT INTO $table_forums

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

 ) VALUES ('group',

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

, fsigs ) VALUES ('group',

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

)");

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

, 'yes')");

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

            if ($newsubname != $lang['textnewsubf']) {
                $newsubname = addslashes($newsubname);
                $db->query("INSERT INTO $table_forums 
=====================================
Find Code In Above Statement In-line:
=====================================

 ) VALUES ('sub',

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

, fsigs ) VALUES ('sub',

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

)");

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

, 'yes')");

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

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

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

 WHERE fid='$fdetails'");

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

, fsigs='$fsigsnew' WHERE fid='$fdetails'");

=======================================================================================================================
=======
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 ($forum['fsigs'] == 'yes') {
            	        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')."\";");
        }
            }

=======================================================================================================================
=======
Step 5:
=======

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

===============
Add Code at the buttom
===============

$lang['fsigsstatus'] = 'Allow signatures to display in this forum?';

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