Title: Attachment Icons v1.0

Author: John Briggs

Description:
This modification will provide an Icon image for the specific attachment extension in threads.
This modification provides an On/Off control in admin settings panel for displaying icons.

Copyright:  2006 John Briggs. All rights reserved.

Compatability: XMB 1.9.8 SP3/SP4

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 Admin Panel -> Insert Raw SQL
==============================

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

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

        $avchecked[0] = $avchecked[1] = $avchecked[2] = false;
        if (!empty($avatarlist)) {
            $avchecked[1] = true;
        } else if (!empty($avataroff)) {
            $avchecked[2] = true;
        } else {
            $avchecked[0] = true;
        }

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

        // Attachment Icons Mod Begin
        $aiconstatuson = $aiconstatusoff = '';
        switch ($SETTINGS['aiconstatus']) {
            case 'on':
                $aiconstatuson = $selHTML;
                break;
            default:
                $aiconstatusoff = $selHTML;
                break;
        }
        // Attachment Icons Mod End

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

        printsetting1($lang['attachimginpost'], 'attachimgpostnew', $attachimgposton, $attachimgpostoff);

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

        // Attachment Icons Mod Begin
        printsetting1($lang['aiconstatus'], 'aiconstatusnew', $aiconstatuson, $aiconstatusoff);
        // Attachment Icons Mod End

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

        $onlinetoday_statusnew = formOnOff('onlinetoday_statusnew');

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

        // Attachment Icons Mod Begin
        $aiconstatusnew = formOnOff('aiconstatusnew');
        // Attachment Icons Mod End

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

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

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

        $db->query("UPDATE ".X_PREFIX."settings SET
            aiconstatus='$aiconstatusnew',

=======================================================================================================================================
=======
Step 3:
=======
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

                eval("\$post['message'] .= \"".template('viewthread_post_attachment')."\";");

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

                // Attachment Icons Mod Begin
                $aicon = $SETTINGS['aiconstatus'] = '';
                if ($SETTINGS['aiconstatus'] == 'on') {
                    include(ROOT.'include/mimetypes.inc.php');
                }
                // Attachment Icons Mod End

=======================================================================================================================================
=======
Step 4:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above ?>
============================

// Attachment Icons Mod Begin
$lang['aiconalt'] = "Attachment Icon";
$lang['aiconstatus'] = "Attachment Icon Status:";
// Attachment Icons Mod End

=======================================================================================================================================
=======
Step 5:
=======
==========================
Go To Admin Panel --> Templates
==========================
================================
Edit Template: viewthread_post_attachment
================================
==========
Find Code:
==========

$lang[attachment]

==============
Add Code After:
==============

$aicon

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

Upload the provided folder named "/mimetypes/" found in the "/Contents/" folder to your forum "/images/" directory.

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

Upload the provided file named "mimetypes.inc.php" to your forum "/include/" directory.

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