vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 5.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=259)
-   -   Mini Mods - image thumbnails for the list of attachments (https://vborg.vbsupport.ru/showthread.php?t=313211)

Zachery 07-23-2014 10:00 PM

image thumbnails for the list of attachments
 
1 Attachment(s)
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

PiotrGT 12-03-2014 06:31 PM

I have applied this mod and it did make a lot of my attachments show up as images but there are many that did not show up - it seems that there is an issue with rebuilding all of the images... how can this be fixed? I went to edit posts and these images simply didnt regenerate... How can I do a force regenerate?

example:
http://granturismo.pl/vb5/forum/%C5%...ixel2525/page5

Zachery 12-03-2014 07:10 PM

Are new(er) images working as thumbnails?

PiotrGT 12-04-2014 06:35 AM

It's a random issue - here are the newer ones and some did not even convert from an attacthment link:
http://granturismo.pl/vb5/forum/%C5%...a-bullet/page2
or
http://granturismo.pl/vb5/forum/%C5%...a-bullet/page3

However it does seem like there are more older images suffering from this problem but then its not always like that - its very random....

I did a CHMOD 777 to all directories and images.

Zachery 12-04-2014 08:29 PM

You can go into the AdminCP and try to run the rebuild thumbnails function.

PiotrGT 12-05-2014 06:18 AM

Yes, I did that many time and it did not resolve the issue. There has to be another way.

jdj 12-19-2014 03:17 PM

Can this mod be used to show thumbnail previews in the blog list? Or is it doing something else?

keyla31 07-26-2018 04:36 PM

i know its old but i tried it 5.4.2 did not work.


All times are GMT. The time now is 11:12 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01086 seconds
  • Memory Usage 1,742KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete