=======================================================================================================================================
Title: Attachment Icons

Version: 1.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:  2011 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 mod is released under the GPL License v3. A copy is provided with this software package.

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 Administration 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;
        } elseif (!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:
==========

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Attachment Icons Mod Begin
        $aiconstatusnew = ($aiconstatusnew == 'on') ? 'on' : 'off';
        // Attachment Icons Mod End

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

$db->query("UPDATE $table_settings SET langfile='$langfilenew'

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

");

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

, aiconstatus='$aiconstatusnew'");

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

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

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

                        // Attachment Icons Mod Begin
                        $aicon = '';
                        if ($SETTINGS['aiconstatus'] == 'on') {
                            include(ROOT.'include/mimetypes.inc.php');
                        }
                        eval("\$post['message'] .= \"".template('viewthread_post_attachment')."\";");
                       // 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 Administration Panel --> Templates
===============================
===============================
Edit Template: viewthread_post_attachment
===============================
==========
Find Code:
==========

<strong>$lang[attachment]</strong>

===============
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!