small change for josh modification
It`s show
1) images
2) images as link (open in new window ) when filewidth > $config['max_width']
3) button to attachment in body and open in new window
Open showflat.tmpl
find
<font class="small">
<a name="#{$postrow[$i]['Number']}">#{$postrow[$i]['Number']} - {$postrow[$i]['time']} <i>{$postrow[$i]['IP']}</i> {$postrow[$i]['filelink']}
</font>
change for this
<font class="small">
<a name="#{$postrow[$i]['Number']}">#{$postrow[$i]['Number']} - {$postrow[$i]['time']} <i>{$postrow[$i]['IP']}</i>
</font>
find
{$postrow[$i]['Body']}
{$postrow[$i]['Signature']}
{$postrow[$i]['PrintLastEdit']}
change for this
{$postrow[$i]['Body']}<br /><center>
{$postrow[$i]['filelink']}</center>
{$postrow[$i]['Signature']}
{$postrow[$i]['PrintLastEdit']}
Open
showflat.php find Josh code :
if ($File) {
$File = rawurlencode($File);
if (!$downloads) { $downloads = "0"; }
$postrow[$i]['filelink'] = "<a href="{$config['phpurl']}/download.php?Number=$Number">{$ubbt_lang['FILE_ATTACH']}</a> ($downloads {$ubbt_lang['DOWNLOADS']})";
if ($config['inline_anon'] == "yes") {
// -----------------------------------------------------------------------
// if it's a graphic, let's display it in the posts - hack by JoshPet
if (eregi("\.GIF|\.JPG|\.PNG", $File)) {
$filewidth = getimagesize ("$config[fileurl]/$File");
$TempBod = $Body;
if ($filewidth[0] > $config['max_width']) {
$TempBod .= "<br /><br /><IMG SRC="$config[fileurl]/$File" width="{$config['max_width']}" Border="0" alt="{$ubbt_lang['FILE_ATTACH']}">";
}
else {
$TempBod .= "<br /><br /><IMG SRC="$config[fileurl]/$File" Border="0" alt="{$ubbt_lang['FILE_ATTACH']}">";
}
$Body = $TempBod;
}
}
}
change for this :
if ($File) {
$File = rawurlencode($File);
if (!$downloads) { $downloads = "0"; }
$filewidth = getimagesize ("$config[fileurl]/$File");
if ( ($config['inline_anon'] == "yes") && (eregi("\.GIF|\.JPG|\.PNG", $File)) && ($filewidth[0] > $config['max_width']) ) {
$postrow[$i]['filelink'] ="<br /><br /><B>Attachment</b><br /><br /><a href="{$config['phpurl']}/download.php?Number=$Number" target="_new"><IMG SRC="$config[fileurl]/$File" width="{$config['max_width']}" Border="0" alt="{$ubbt_lang['FILE_ATTACH']} - ($downloads {$ubbt_lang['DOWNLOADS']})"></a>";
}
elseif ( ($config['inline_anon'] == "yes") && (eregi("\.GIF|\.JPG|\.PNG", $File)) ) {
$postrow[$i]['filelink'] ="<br /><br /><B>Attachment</b><br /><br /><IMG SRC="$config[fileurl]/$File" Border="0" alt="{$ubbt_lang['FILE_ATTACH']}">";
}
else
$postrow[$i]['filelink'] = "<br /><B>Attachment</b><br /><a href="{$config['phpurl']}/download.php?Number=$Number" target="_new"><img src="{$config['phpurl']}/images/attachment.gif" border="0"></a>
<br /> ($downloads {$ubbt_lang['DOWNLOADS']})";
}
Put attachment.gif in your images directory (on gif write DOWNLOAD )
Tested - working
