Title: Forum Based Forum Icons v1.0

Author: John Briggs

Description:
This mod will give you the option in forum options to set to show a 32x32 icon (Ideal Size) next to each forum.

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 Engage Final SP2

Updated for 1.9.8 by: WormHole @ XMB Garage

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 XMBGarage.com, the #1 source for XMB related downloads.
Please visit http://www.xmbgarage.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: include/functions.php
========================

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

function forum($forum, $template) {
    global $timecode, $dateformat, $lang, $xmbuser, $self, $lastvisit2, $timeoffset, $hideprivate, $addtime, $oldtopics, $lastvisit;
    global $altbg1, $altbg2, $imgdir, $THEME, $SETTINGS, $index_subforums;

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

    // Forum Based Forum Icons Mod Begin
    if ($forum['ficon_status'] == 'on' && $forum['ficon'] != '' && file_exists('./images/ficons/'.$forum['ficon'])) {
        $forum['ficon'] = '<a href="forumdisplay.php?fid='.$forum['fid'].'"><img src="./images/ficons/'.$forum['ficon'].'" border="0" alt="'.$lang['ficonalt'].'" title="'.$lang['ficonalt'].'" /></a>';
    } else {
        $forum['ficon'] = '';
    }
    // Forum Based Forum Icons Mod End

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

=================
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 Forum Icons Mod Begin
        $ficon_statuson = $ficon_statusoff = '';
        switch ($forum['ficon_status']) {
            case 'on':
                $ficon_statuson = $selHTML;
                break;
            default:
                $ficon_statusoff = $selHTML;
                break;
        }
        // Forum Based Forum Icons Mod End

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

        $forum['description'] = stripslashes($forum['description']);

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

        // Forum Based Forum Icons Mod Begin
        $forum['ficon'] = stripslashes($forum['ficon']);
        // Forum Based Forum Icons Mod End

==========
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_decode($forum['description'])?></textarea></td>
        </tr>

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

        <?php
        // Forum Based Forum Icons Mod Begin
        printsetting1($lang['ficonstatus'], 'ficon_statusnew', $ficon_statuson, $ficon_statusoff);
        printsetting2($lang['ficoninfo'], 'ficonnew', $forum['ficon'], 20);
        // Forum Based Forum Icons 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-LINE in Above Statement:
=====================================

) VALUES ('forum',

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

, ficon_status, ficon ) VALUES ('forum',

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

)");

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

, 'off', '')");

==========
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-LINE in Above Statement:
=====================================

) VALUES ('group',

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

, ficon_status, ficon ) VALUES ('group',

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

)");

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

, 'off', '')");

==========
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-LINE in Above Statement:
=====================================

) VALUES ('sub',

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

, ficon_status, ficon ) VALUES ('sub',

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

)");

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

, 'off', '')");

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

        $guestpostingnew = formOnOff('guestpostingnew');

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

        $ficon_statusnew = formOnOff('ficon_statusnew');
        $ficonnew = addslashes(formVar('ficonnew', false));

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

            guestposting='$guestpostingnew'

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

            guestposting='$guestpostingnew',
            ficon_status='$ficon_statusnew',
            ficon='$ficonnew'

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

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

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

// Forum Based Forum Icons Mod Begin
$lang['ficonstatus'] = "Forum Icon Status:";
$lang['ficoninfo'] = "Forum Icon:<br /><span class=\"smalltxt\">(Use example: imagename.gif)</span>";
$lang['ficonalt'] = "Forum Icon";
// Forum Based Forum Icons Mod End

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

=============================================
Go To Admin Panel -> Templates -> index_forum
=============================================

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

<font class="mediumtxt"><a href="./forumdisplay.php?fid=$forum[fid]"><strong>$forum[name]</strong></a></font>

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

$forum[ficon]<font class="mediumtxt"><a href="./forumdisplay.php?fid=$forum[fid]"><strong>$forum[name]</strong></a></font>

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

=======================================================
Go To Admin Panel -> Templates -> forumdisplay_subforum
=======================================================

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

<font class="mediumtxt"><a href="forumdisplay.php?fid=$forum[fid]">$forum[name]</a></font>

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

$forum[ficon]<font class="mediumtxt"><a href="forumdisplay.php?fid=$forum[fid]"><strong>$forum[name]</strong></a></font>

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

Now upload the folder named "ficons" to your forum "images" folder

Note: all forum icons must be uploaded to the folder named "ficons" for them to show.

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

I have added a few icons with the "ficons" folder but if you desire to use different images then you can visit the site below.

http://www.iconarchive.com/

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