============================================================================================================================
Modification Title: Forum Based Forum Icons

Version: 1.0

Author: John Briggs

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

Copyright:  2010 John Briggs. All Rights Reserved.

Compatability: XMB 1.9.5 SP1

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 v3. 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: functions.php
==================
==========
Find Code:
==========

    global $altbg1, $altbg2, $imgdir, $THEME, $SETTINGS;

===============
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;
        } elseif ($forum['private'] == 3) {
            $type33 = $selHTML;
        } elseif ($forum['private'] == 4) {
            $type34 = $selHTML;
        } elseif ($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($forum['description'])?></textarea></td>
        </tr>

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

        <!-- Forum Based Forum Icons Mod Begin -->
        <?php
        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 $table_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 $table_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 $table_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 = (isset($guestpostingnew) && $guestpostingnew == 'on') ? 'on' : 'off';

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

            // Forum Based Forum Icons Mod Begin
            $ficon_statusnew = (isset($ficon_statusnew) && $ficon_statusnew == 'on') ? 'on' : 'off';
            // Forum Based Forum Icons Mod End

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

            $descnew = addslashes($descnew);

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

            // Forum Based Forum Icons Mod Begin
            $ficonnew = addslashes($ficonnew);
            // Forum Based Forum Icons 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:
==================

, ficon_status='$ficon_statusnew', ficon='$ficonnew' WHERE fid='$fdetails'");

============================================================================================================================
=======
Step 4:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End 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 Administration Panel --> Templates
===============================
=====================
Edit Template: 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 Administration Panel --> Templates
===============================
============================
Edit Template: 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 or any other site you may know where to get icons.

http://www.iconarchive.com/

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