Hey guys. This is a question that seems to get asked a lot. The older versions of SMF you could change the display,template.php file quite easily however I've not been able to do it in the current version since the code to replace doesn't seem to be the same.
Any help would be highly appreciated as having to keep scrolling down to see all the thumbnails is quite annoying. Thanks!
Welcome to SMF :).
Could you please confirm which version of the software are you using? Stating current is too vague.
Quote from: Irisado on July 22, 2016, 02:23:44 PM
Welcome to SMF :).
Could you please confirm which version of the software are you using? Stating current is too vague.
Hi. Thank you! :)
Certainly. I am using SMF 2.0.11 right now.
there is a mod for 2.0.x to allow inline attachments
Quote from: Kindred on July 22, 2016, 05:30:51 PM
there is a mod for 2.0.x to allow inline attachments
Any idea to the name of that? The ones I found were all for older versions of SMF and didn't work.
https://github.com/Spuds/SMF-ILA
There is also this mod- http://custom.simplemachines.org/mods/index.php?mod=3770
Unfortunately neither of those do what I need.
the SMF mod only works on new attachments and you need to insert an attachment code for every single one as it's not default. I'd have to inform all my users to also do that every time to which is a big hassle.
And the github one only works on the default theme unless you edit the custom theme too which brings me back to square one.
Is there really no simple "edit the template.display" method like there was before?
No
Quote from: Kindred on July 25, 2016, 09:39:52 PM
No
Well that's disappointing. It's such a vastly asked for feature as the vertical placements of attachments looks so bad. That's a shame.
Quote from: smartdaz9682 on July 26, 2016, 01:06:10 PM
Well that's disappointing. It's such a vastly asked for feature as the vertical placements of attachments looks so bad. That's a shame.
I was just curious about which theme you use?
// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<div id="msg_', $message['id'], '_footer" class="attachments smalltext">
<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">';
$last_approved_state = 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state = 0;
echo '
<fieldset>
<legend>', $txt['attach_awaiting_approve'];
if ($context['can_approve'])
echo ' [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
echo '</legend>';
}
if ($attachment['is_image'])
{
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/><br />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" /> ' . $attachment['name'] . '</a> ';
if (!$attachment['is_approved'] && $context['can_approve'])
echo '
[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
echo '
(', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' - ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.)<br />';
}
// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>';
echo '
</div>
</div>';
}
// Assuming there are attachments...
if (!empty($message['attachment']))
{
echo '
<div id="msg_', $message['id'], '_footer" class="attachments smalltext">
<div style="overflow: ', $context['browser']['is_firefox'] ? 'visible' : 'auto', ';">';
echo '<ul class="inline-attachments">';
$last_approved_state = 1;
foreach ($message['attachment'] as $attachment)
{
// Show a special box for unapproved attachments...
if ($attachment['is_approved'] != $last_approved_state)
{
$last_approved_state = 0;
echo '
<fieldset>
<legend>', $txt['attach_awaiting_approve'];
if ($context['can_approve'])
echo ' [<a href="', $scripturl, '?action=attachapprove;sa=all;mid=', $message['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve_all'], '</a>]';
echo '</legend>';
}
if ($attachment['is_image'])
{
echo '<li class="inline-attachment" id="attachment_', $attachment['id'], '">';
if ($attachment['thumbnail']['has_thumb'])
echo '
<a href="', $attachment['href'], ';image" id="link_', $attachment['id'], '" onclick="', $attachment['thumbnail']['javascript'], '"><img src="', $attachment['thumbnail']['href'], '" alt="" id="thumb_', $attachment['id'], '" /></a><br />';
else
echo '
<img src="' . $attachment['href'] . ';image" alt="" width="' . $attachment['width'] . '" height="' . $attachment['height'] . '"/><br />';
}
echo '
<a href="' . $attachment['href'] . '"><img src="' . $settings['images_url'] . '/icons/clip.gif" align="middle" alt="*" /> ' . $attachment['name'] . '</a> ';
if (!$attachment['is_approved'] && $context['can_approve'])
echo '
[<a href="', $scripturl, '?action=attachapprove;sa=approve;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['approve'], '</a>] | [<a href="', $scripturl, '?action=attachapprove;sa=reject;aid=', $attachment['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $txt['delete'], '</a>] ';
echo '
<br />- ', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ' <br />- ' . $txt['attach_viewed'] : ' - ' . $txt['attach_downloaded']) . ' ' . $attachment['downloads'] . ' ' . $txt['attach_times'] . '.</li>';
}
// If we had unapproved attachments clean up.
if ($last_approved_state == 0)
echo '
</fieldset>';
echo '</ul>';
echo '
</div>
</div>';
}
.inline-attachment {
display: inline-block;
width: 150px;
}
.inline-attachments {
list-style-type: none;
}
displays like this...
http://test.turtleshellprod.com/index.php?topic=61.0
Quote from: Kindred on July 26, 2016, 02:22:02 PM
displays like this...
http://test.turtleshellprod.com/index.php?topic=61.0
Don't think guests can see attachments on there in your example, or at least I can't.
fixed that -- thanks
Kindred
Which files are being edited? it this the display template?
yes and index.css