Title: Forum Based Forum Info v1.1

Author: John Briggs

Description:
This modification will allow admins to set information per forum via Admin Panel -> Forums -> More Options.
There is also an on/off control via the Admin Panel -> Forums -> More Options.

Copyright:  2009 John Briggs. All rights reserved.

Compatability: XMB 1.9.11

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.

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

====================================================================
Go To Admin Panel -> Insert Raw SQL -> Copy & Paste Code Below & Click Submit CHanges
====================================================================

ALTER TABLE `$table_forums` ADD `finfo_status` set('on', 'off') DEFAULT 'off' NOT NULL;
ALTER TABLE `$table_forums` ADD `finfo` text NOT NULL;

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

==============================================
Go To Admin Panel -> Translations & Download Language File:
==============================================

===============
Edit Language File:
===============

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

// Forum Based Forum Info Mod Begin
$lang['finfocp'] = "Forum Information:<br /><small>Apply information for this forum here. BB Code is applicable.</small>";
$lang['finfotxt'] = "Forum Information";
$lang['finfo_status'] = "Forum Information Status:<br /><small>This will enable/disable the forum information display in this forum.</small>";
// Forum Based Forum Info Mod End

============================================
Go To Admin Panel -> Translations & Upload Language File:
============================================

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

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

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

        if ($forum['attachstatus'] == "on") {
            $checked6 = $cheHTML;
        } else {
            $checked6 = '';
        }

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

        // Forum Based Forum Info Mod Begin
        $finfo_statuson = $finfo_statusoff = '';
        if ($forum['finfo_status'] == 'on') {
            $finfo_statuson = $selHTML;
        } else {
            $finfo_statusoff = $selHTML;
        }
        // Forum Based Forum Info 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:
===============

        <!-- Forum Based Forum Info Mod Begin -->
        <?php
        printsetting1($lang['finfo_status'], 'finfo_statusnew', $finfo_statuson, $finfo_statusoff);
        printsetting4($lang['finfocp'], 'finfonew', $forum['finfo'], 4, 30);
        ?>
        <!-- Forum Based Forum Info Mod End -->

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

        if ($newfname != $lang['textnewforum'] And $newfname != '') {
            $db->query("INSERT INTO ".X_PREFIX."forums (type, name, status, lastpost, moderator, displayorder, description, allowhtml, allowsmilies, allowbbcode, userlist, theme, posts, threads, fup, postperm, allowimgcode, attachstatus, password, mt_status, mt_open, mt_close) VALUES ('forum', '$newfname', '$newfstatus', '', '', $newforder, '', 'no', 'yes', 'yes', '', 0, 0, 0, $newffup, '31,31,31,63', 'yes', 'on', '', 'off', '', '')");
        }

========================
Find Code In Above Statement:
========================

) VALUES ('forum',

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

, finfo_status, finfo) VALUES ('forum',

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

)");

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

, 'off', '')");

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

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

========================
Find Code In Above Statement:
========================

) VALUES ('group',

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

, finfo_status, finfo) VALUES ('group',

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

)");

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

, 'off', '')");

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

        if ($newsubname != $lang['textnewsubf'] And $newsubname != '') {
            $db->query("INSERT INTO ".X_PREFIX."forums (type, name, status, lastpost, moderator, displayorder, description, allowhtml, allowsmilies, allowbbcode, userlist, theme, posts, threads, fup, postperm, allowimgcode, attachstatus, password) VALUES ('sub', '$newsubname', '$newsubstatus', '', '', $newsuborder, '', 'no', 'yes', 'yes', '', 0, 0, 0, $newsubfup, '31,31,31,63', 'yes', 'on', '')");
        }

========================
Find Code In Above Statement:
========================

) VALUES ('sub',

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

, finfo_status, finfo) VALUES ('sub',

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

)");

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

, 'off', '')");

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

        $delete = formInt('delete');

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

        // Forum Based Forum Info Mod Begin
        $finfo_statusnew = formOnOff('finfo_statusnew');
        $finfonew = postedVar('finfonew');
        // Forum Based Forum Info Mod End

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

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

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

            finfo_status='$finfo_statusnew',
            finfo='$finfonew',

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

====================
Edit File: forumdisplay.php
====================

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

loadtemplates(

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

'forumdisplay_info',

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

eval('$sortby = "'.template('forumdisplay_sortby').'";');

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

// Forum Based Forum Info Mod Begin
$foruminfo = '';
if ($forum['finfo_status'] == 'on') {
    $forum['finfo'] = postify($forum['finfo'], 'no', 'no', 'yes', 'yes', 'yes', 'yes', false, 'yes', 'no');
    eval('$foruminfo = "'.template('forumdisplay_info').'";');
}
// Forum Based Forum Info Mod End

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

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

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

loadtemplates(

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

'forumdisplay_info',

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

    $modoptions = '';
    if ('Moderator' == $status1) {
        eval('$modoptions = "'.template('viewthread_modoptions').'";');
    }

===============
Add Code Above:
===============

    // Forum Based Forum Info Mod Begin
    $foruminfo = '';
    if ($forum['finfo_status'] == 'on') {
        $forum['finfo'] = postify($forum['finfo'], 'no', 'no', 'yes', 'yes', 'yes', 'yes', false, 'yes', 'no');
        eval('$foruminfo = "'.template('forumdisplay_info').'";');
    }
    // Forum Based Forum Info Mod End

=======================================================================================================================================
=======
Step 6:
=======

==========================
Edit Template: forumdisplay_admin
==========================

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

$subforums

===============
Add Code Above:
===============

$foruminfo

=======================================================================================================================================
=======
Step 7:
=======

=====================
Edit Template: forumdisplay
=====================

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

$subforums

===============
Add Code Above:
===============

$foruminfo

=======================================================================================================================================
=======
Step 8:
=======

=========================
Edit Template: viewthread
=========================

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

$poll

===============
Add Code Above:
===============

$foruminfo

=======================================================================================================================================
=======
Step 9:
=======

==========================
Create Template: forumdisplay_info
==========================

<table cellspacing="0" cellpadding="0" border="0" width="$THEME[tablewidth]" align="center">
<tr>
<td bgcolor="$THEME[bordercolor]">
<table border="0" cellspacing="{$THEME['borderwidth']}" cellpadding="$THEME[tablespace]" width="100%">
<tr>
<td class="category"><font color="$THEME[cattext]"><strong>$lang[finfotxt]</strong></font></td>
</tr>
<tr class="tablerow">
<td bgcolor="$THEME[altbg1]">{$forum['finfo']}</td>
</tr>
</table>
</td>
</tr>
</table>
<br />

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