• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

how to make attachments visible to guests ?

erich37

Well-known member
#1
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!
 

erich37

Well-known member
#3
thanks !
works fine indeed!

I guess doing so will massively increase the server load ?
Are you guys have images and attachments visible to guests or not ?

Will having attachments visible to guests increase the amount of visitors to the website?
 

James

Well-known member
#4
Increase in server load, that shouldn't necessarily be true.

Having attachments visible to guests won't increase the visitors unless your visitors have a use for the attachments (in which case they'd register to view them anyway).
 

erich37

Well-known member
#5
but when having the images (attachments) visible to guests, the images get loaded. I guess the images are actually not loaded when not visible to guests ?
isn´t this increasing server load ?

I would like to have images visible to guests, but am afraid of the server-load.......?
 

James

Well-known member
#6
The images aren't loaded until they're clicked, what's loaded is actually a thumbnail (which is loaded to guests whether the permissions are granted or not - from my testing anyway).
 

James

Well-known member
#8
Server load should be negligible. Enable attachments for guests for a few days and see how your server load pans out... it shouldn't be too bad though.
 

Dean

Well-known member
#9
Keep in mind that guest will be able to download all attachments such as attached pdf files too. That may or may not concern you.
 

Ray

Active member
#10
thanks !
works fine indeed!

I guess doing so will massively increase the server load ?
Are you guys have images and attachments visible to guests or not ?

Will having attachments visible to guests increase the amount of visitors to the website?
Google will no longer receive 403 errors and your images will now show in Google Images Search results, resulting in more traffic to your site.
 

snoopy5

Well-known member
#14
This should be what you are looking for
ACP > Users > user permissions > unregistered / unconfirmed > view attachments to posts

Hi this setting does not work. I do NOT want the attachmenst be visible to Guests/ unregistered. I mde teh settings accordingly, but they still are shown as thumbnails.How can I forbid this also for thumbnails? My users are freaking out becase they do not want the images shown with google search!

Those images are imported from a vb forum by the way, in case that matters..
 

Jake Bunce

XenForo moderator
Staff member
#18
I do NOT want guests to see images or thumbnails.
Admin CP -> Appearance -> Templates -> attached_files

Add the red code:

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>
 

Jake Bunce

XenForo moderator
Staff member
#20
Hi

I added the code in red, but still, not logged in usrs can see all thumbnails...
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.