Title: Topic Attachment Icon v2.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Based on original version by: JDaniels

Description:
This hack will add an icon to the thread title in the forum display to indicate that there is at
least one attachment in the thread

Supported Version: XMB 1.9.5 Final

This hack is released under the GPL. You should have recieved a copy of it with this hack.

Please backup your files before installing this hack. Neither XMBGarage nor the author can be held
responsible if your board stops functioning properly due to you installing this hack.

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

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

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

$p_extension = get_extension($lang['pollprefix']);
switch($p_extension) {
    case 'gif':
    case 'jpg':
    case 'jpeg':
    case 'png':
        $lang['pollprefix'] = '<img src="'.$imgdir.'/'.$lang['pollprefix'].'" alt="'.$lang['postpoll'].'" border="0" />';
        break;
}

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

// Topic Attachment Icon Mod Begin
$a_extension = get_extension($lang['attachprefix']);
switch($a_extension) {
    case 'gif':
    case 'jpg':
    case 'jpeg':
    case 'png':
        $lang['attachprefix'] = '<img src="'.$imgdir.'/'.$lang['attachprefix'].'" alt="'.$lang['postattach'].'" border="0" />';
        break;
}
// Topic Attachment Icon Mod End

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

    if ($thread['topped'] == 1) {
        $prefix = $lang['toppedprefix'].' ';
    }

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

    // Topic Attachment Icon Mod Begin
    if ($thread['attachnum'] != 0) {
        $prefix .= $lang['attachprefix'].' ';
    }
    // Topic Attachment Icon Mod End

=====
Find:
=====

$querytop = $db->query("SELECT t.* FROM $table_threads t WHERE t.fid='$fid' $cusdate ORDER BY topped $ascdesc,lastpost $ascdesc LIMIT $start_limit, $tpp");

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

$querytop = $db->query("SELECT t.*, COUNT(a.aid) AS attachnum FROM $table_threads t LEFT JOIN $table_attachments a ON a.tid=t.tid WHERE t.fid='$fid' $cusdate GROUP BY tid ORDER BY topped $ascdesc,lastpost $ascdesc LIMIT $start_limit, $tpp");

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

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

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


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

?>

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

// Topic Attachment Icon Mod Begin
$lang['attachprefix'] = "attach.gif";
$lang['postattach'] = "Contains attachment(s)";
// Topic Attachment Icon Mod End

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

Upload attach.gif to your theme directories

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