XF 2.2 unfurl and guests not allwed to see pictures/thumbs

Robert9

Well-known member
There si a forum where guests are not allowed to see any pictures. No attached, no thumbs, no nothing.
Also the unfurl cant see anything. Instead of these all users have to see the ugly x for picture not found.

Can I show a dummy picture instead?
Can I manipulate unfurl for these case not to show any picture and also not to show the x?
 
Maybe this is a really stupid idea not to show the thumbnail to guests?
Now all links to the forum everywhere have a broken image?

Is there away to allow google/links to see the small picture, but guests should not see anything in the forum? (done by add-on now)
 
This might work, you'd have to test it.

In template: bb_code_tag_url_unfurl

Replace with this:

Code:
<xf:if is="$xf.visitor.user_id">
<xf:if is="$result.isBasicLink()">
	<div>
		<a href="{$result.url}"
			class="{{ $linkInfo.class ?: '' }}"
			target="{{ $linkInfo.target ?: '' }}"
			rel="{{ $rels ? $rels|join(' ') : '' }}"
			data-proxy-href="{{ $proxyUrl ?: '' }}">
			{{ $result.title ?: $result.url }}
		</a>
	</div>
<xf:else />
	<xf:css src="bb_code.less" />

	<div class="bbCodeBlock bbCodeBlock--unfurl {{ $result.pending ? 'is-pending' : '' }} {{ $result.is_recrawl ? 'is-recrawl' : '' }} {{ $simple ? 'is-simple' : '' }} js-unfurl fauxBlockLink"
		data-unfurl="true" data-result-id="{$result.result_id}" data-url="{$result.url}" data-host="{$result.host}" data-pending="{{ $result.pending ? 'true' : 'false' }}">
		<div class="contentRow">
			<xf:if is="($result.pending OR $imageUrl) AND !$simple">
				<div class="contentRow-figure contentRow-figure--fixedSmall js-unfurl-figure">
					<xf:if is="$imageUrl">
						<img src="{$imageUrl}" alt="{$result.host}" data-onerror="hide-parent"/>
					<xf:else />
						<span class="fa-2x u-muted">
							<xf:fa icon="fa-spinner fa-pulse" />
						</span>
					</xf:if>
				</div>
			</xf:if>
			<div class="contentRow-main">
				<h3 class="contentRow-header js-unfurl-title">
					<a href="{$result.url}"
						class="{{ $linkInfo.class ?: '' }} fauxBlockLink-blockLink"
						target="{{ $linkInfo.target ?: '' }}"
						rel="{{ $rels ? $rels|join(' ') : '' }}"
						data-proxy-href="{{ $proxyUrl ?: '' }}">
						{{ $result.title ?: phrase('loading...') }}
					</a>
				</h3>

				<div class="contentRow-snippet js-unfurl-desc">{{ snippet($result.description, $simple ? 50 : 300) }}</div>

				<div class="contentRow-minor contentRow-minor--hideLinks">
					<span class="js-unfurl-favicon">
						<xf:if is="$faviconUrl">
							<img src="{$faviconUrl}" alt="{$result.host}" class="bbCodeBlockUnfurl-icon"
								data-onerror="hide-parent"/>
						</xf:if>
					</span>
					{$result.host}
				</div>
			</div>
		</div>
	</div>
</xf:if>
<xf:else />
	<div>
		<a href="{$result.url}"
			class="{{ $linkInfo.class ?: '' }}"
			target="{{ $linkInfo.target ?: '' }}"
			rel="{{ $rels ? $rels|join(' ') : '' }}"
			data-proxy-href="{{ $proxyUrl ?: '' }}">
			{{ $result.title ?: $result.url }}
		</a>
	</div>
</xf:if>
 
Top Bottom