SMF Support > SMF 2.0.x Support
Attachment problem
AlenNS:
I have a problem with attachments which are not an images.
I have installed integrated Lightbox and I've changed settings for the attached images in Display.template.php in my Babylon theme.
I've attached how it looks like right now and I've attached part of Display.template.php which controls attachments.
I would like to put attachments, which are not an images in one row and to show some picture above attached file ( like zip, rar or something else ).
--- Code: --- // Now for the attachments, signature, ip logged, etc...
echo '
<tr id="msg_', $message['id'], '_footer">
<td valign="bottom" class="smalltext" width="85%">
<table width="100%" border="0" style="table-layout: fixed;"><tr>
<td colspan="2" class="smalltext" width="100%">';
echo '<table>';
$newRow = 1;
foreach ($message['attachment'] as $attachment)
{
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
{
if ($newRow == 1)
{
echo '
<tr>';
}
echo '<td class="smalltext" width="50%" style="padding: 5px;">
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" rel="lightbox[smf]"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" border="0" /></a><br />';
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" /> ' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)</td>';
}
else
{
echo '<td>
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '" border="0" /><br />';
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" /> ' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br /></td>';
}
$newRow++;
if ($newRow == 3)
{
echo '</tr>';
$newRow = 1;
}
}
if(!$attachment['is_image'])
{
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" border="0" /> ' . $attachment['name'] . '</a> (', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}
}
echo '</tr></table>
</td>
</tr><tr>
<td valign="bottom" class="smalltext" id="modified_', $message['id'], '">';
--- End code ---
AlenNS:
Here's another problem.
There are attached one rar, one zip and one jpg file.
And here's what happened.
AlenNS:
Can anyone help me with this?
PLEASE!
AlenNS:
For the 100th time
BUMP
AlenNS:
Bump, bump, bump!
Navigation
[0] Message Index
[#] Next page
Go to full version