how to make attachments visible to guests ?

erich37

Well-known member
when visiting the Forum as a guest, then images attached into Forum-posts are only visible as small icons.

Is there a way to make images visible in full size also to guests ?

Many thanks!
 
Then either they have permission to view attachments (the Unregistered group) or you are editing the wrong style.

Also note that even with this template edit, thunbnail images are not actually protected by the permission system, so users can still load direct URLs to view thumbs even though they are not shown on the page.

I made the change in both templates. The original one which comes with XF and my own one. Settings in the usergroup are correct.

What else could I try?

P.S.: maybe you could separete my questions from this thread and move it into a new thread, since I want to have the opposite from what the title of the threads sais... I missed that at the beginning...
 
I made the change in both templates. The original one which comes with XF and my own one. Settings in the usergroup are correct.

What else could I try?

P.S.: maybe you could separete my questions from this thread and move it into a new thread, since I want to have the opposite from what the title of the threads sais... I missed that at the beginning...

Which thumbnails are you trying to affect? Where? The template edit I posted will affect thumbnails attached to the bottom of posts.
 
Most thumnails are the import of vb forums. With vbwe never used the attachemnt at the buttum because it is looking so ugly. We used the papperclip icon to be able to insert images in the middle of the tex.

See here:

thumbnail_example.webp
 
You probably need to edit this template:

Admin CP -> Appearance -> Templates -> bb_code_tag_attach

Edit the last condition:

Code:
<xen:else />

	<a href="{xen:link attachments, $attachment}" target="_blank"><img src="{$attachment.thumbnailUrl}" alt="{$attachment.filename}" class="bbCodeImage" /></a>
	
</xen:if>

Replace the img tag, like so:

Code:
<xen:else />

	<a href="{xen:link attachments, $attachment}" target="_blank">{xen:phrase view_attachment_x, 'name={$attachment.filename}'}</a>
	
</xen:if>
 
no, all the code suggestions do not work so far for fullsize thumbnails. Neither for the imported images from vb, nor for thumbnails of new uploads.

usergroup permissions for non logged in users are:

guests_shall_not_see_attachments.webp

in template "attached files" I replaced the code as suggested by this:

Code:
<xen:require css="attached_files.css" />
 
<div class="attachedFiles">
    <h4 class="attachedFilesHeader">{xen:phrase attached_files}:</h4>
    <ul class="attachmentList SquareThumbs"
        data-thumb-height="{xen:calc '{$xenOptions.attachmentThumbnailDimensions} / 2'}"
        data-thumb-selector="div.thumbnail > a">
        <xen:foreach loop="$post.attachments" value="$attachment">
            <li class="attachment{xen:if {$attachment.thumbnailUrl}, ' image'}" title="{$attachment.filename}">
                <div class="boxModelFixer primaryContent">
               
                    <div class="thumbnail">
                        <xen:if is="{$attachment.thumbnailUrl} AND {$canViewAttachments}">
                            <a href="{xen:link attachments, $attachment}" target="_blank" class="LbTrigger"
                                data-href="{xen:link misc/lightbox}"><img
                                src="{$attachment.thumbnailUrl}" alt="{$attachment.filename}" class="LbImage" /></a>
                        <xen:elseif is="{$attachment.thumbnailUrl} AND 0" />
                            <a href="{xen:link attachments, $attachment}" target="_blank"><img
                                src="{$attachment.thumbnailUrl}" alt="{$attachment.filename}" /></a>
                        <xen:else />
                            <a href="{xen:link attachments, $attachment}" target="_blank" class="genericAttachment"></a>
                        </xen:if>
                    </div>
               
                    <div class="attachmentInfo pairsJustified">
                        <h6 class="filename"><a href="{xen:link attachments, $attachment}" target="_blank">{$attachment.filename}</a></h6>
                        <dl><dt>{xen:phrase file_size}:</dt> <dd>{xen:number $attachment.file_size, size}</dd></dl>
                        <dl><dt>{xen:phrase views}:</dt> <dd>{xen:number $attachment.view_count}</dd></dl>
                    </div>
                </div>
            </li>
        </xen:foreach>
    </ul>
</div>
 
<xen:comment><xen:require css="xenforo.css" /></xen:comment>


The suggestion in your posting above does not work neither.

So what else can I try?

This is a serious issue because of privacy protection. We are not allowed to give google images via thumbnails, which users do upload in the thinking that they can not be indexed.
 
Make sure you are editing the same style you are viewing. These template edits should work. Otherwise I need to take a look for myself. Send me a PM with a URL and admin login, and an example of a thumbnail you want to hide for guests.
 
Top Bottom