Back to vBulletin 5.x Template Modifications

image thumbnails for the list of attachments
Mod Version: 1.00, by Zachery

vB Version: 5.1.x Rating: (2 votes - 5.00 average) Installs: 6
Released: 25 Jul 2014 Last Update: Never Downloads: 0
Not Supported Template Edits  

This is pretty straight forward, it will bring back your attachment thumbnails in the attachment list display.

Find the bbcode_attachment_list template, and replace the code in there, with the following code

HTML Code:
<vb:if condition="!empty($attachments)">
	<div class="b-post-attachments" style="max-width: 60%;">
		{vb:rawphrase attached_files}
		<ul>
		<vb:each from="attachments" value="attachment">
			<vb:if condition="!empty($attachment['filename'])">
				{vb:set displayName, {vb:raw attachment.filename}}
			<vb:elseif condition="!empty($attachment['caption'])" />
				{vb:set displayName, {vb:raw attachment.caption}}
			<vb:else />
				{vb:set displayName, {vb:raw attachment.nodeid}}
			</vb:if>
			<vb:if condition="in_array($attachment[extension], array(jpeg, jpg, png, gif, jpe))">
				<li class="b-post-attachments__item"  style="display:inline-flex; padding:3px;">
					<a href="{vb:raw attachurl}{vb:raw attachment.nodeid}">
					<img 
					class="thumbnail-photo" 
					src="{vb:raw baseurl}/filedata/fetch?id={vb:raw attachment.nodeid}&amp;type=thumb" 
					title="" 
					alt="" 
					/>
					</a>
				</li>
			</vb:if>
		</vb:each>
		<vb:each from="attachments" value="attachment">
			<vb:if condition="!empty($attachment['filename'])">
				{vb:set displayName, {vb:raw attachment.filename}}
			<vb:elseif condition="!empty($attachment['caption'])" />
				{vb:set displayName, {vb:raw attachment.caption}}
			<vb:else />
				{vb:set displayName, {vb:raw attachment.nodeid}}
			</vb:if>
			<vb:if condition="!in_array($attachment[extension], array(jpeg, jpg, png, gif, jpe))">
				<li class="b-post-attachments__item">
					<a href="{vb:raw attachurl}{vb:raw attachment.nodeid}">
					<span class="b-icon b-icon__doc--gray"></span>
					<span class="h-wordwrap">{vb:raw displayName}</span>
					<vb:if condition="$attachment['counter'] == 1">
						{vb:set phrase, 1_view}
					<vb:else />
						{vb:set phrase, x_views}
					</vb:if>
					<span>({vb:raw attachment.filesize}, {vb:phrase {vb:raw phrase}, {vb:raw attachment.counter}}) </span>
					</a>
				</li>
			</vb:if>
		</vb:each>
		</ul>
	</div>
</vb:if>
If you'd like to see this issue fixed properly, please make sure to voice your opinion here: http://tracker.vbulletin.com/browse/VBV-11653

Download

No files for download.

Screenshots

Click image for larger version
Name:	2014-07-24_17h43_33.jpg
Views:	545
Size:	59.0 KB
ID:	149856  


vblts.ru supports vBulletin®, 2022-2024