PDA

View Full Version : How to hide all attachments (Images / Video / Links) from Guests


JohnSG
05-24-2012, 03:32 AM
Hi

I am trying to find out the best way to hide all attachments (Images / Video / Links) from Guests.
Pretty much exactly like the plugin sections is set-up here on vBulletin.org, that you must be logged in to see them or link off them.

Cheers
John

--------------- Added 1337835780 at 1337835780 ---------------

I have tried this plugin already and it didnt do anything.

https://vborg.vbsupport.ru/showthread.php?t=256054

magnaromagna
07-30-2012, 07:20 AM
Same problem, up,

thank you

Disco_Dave
07-30-2012, 08:49 AM
Can you not just use permissions for this? in user-group Manger.

magnaromagna
07-30-2012, 09:09 AM
Do you mean disable [IMG] option in every forum? But like this instead of the image it shows the clickable link of the image.

Or you have another idea? If so, please share, thanks

peugeot405
07-30-2012, 09:10 AM
you can't hide the attachments with userpermissions. You can only disalow the downloading.

magnaromagna
07-30-2012, 09:24 AM
Ah, and how can I do this?

peugeot405
07-30-2012, 09:44 AM
you have to use a conditional if to do that.

open postbit legacy

search for:

<vb:if condition="$show['attachments']">

<div class="attachments">
<vb:if condition="$show['thumbnailattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_thumbnails}" /> {vb:rawphrase attached_thumbnails}</legend>
{vb:raw post.thumbnailattachments}
</fieldset>
</vb:if>

<vb:if condition="$show['imageattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_images}" /> {vb:rawphrase attached_images}</legend>
{vb:raw post.imageattachments}
</fieldset>
</vb:if>

<vb:if condition="$show['imageattachmentlink']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_images}" /> {vb:rawphrase attached_images}</legend>
<ul>
{vb:raw post.imageattachmentlinks}
</ul>
</fieldset>
</vb:if>

<vb:if condition="$show['otherattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_files}" /> {vb:rawphrase attached_files}</legend>
<ul>
{vb:raw post.otherattachments}
</ul>
</fieldset>
</vb:if>

<vb:if condition="$show['moderatedattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attachments_pending_approval}" /> {vb:rawphrase attachments_pending_approval}</legend>
<ul>
{vb:raw post.moderatedattachments}
</ul>
</fieldset>
</vb:if>
</div>
<!-- / attachments -->
</vb:if>


and replace it with

<vb:if condition="$show['attachments']">

<div class="attachments">
<vb:if condition="$show['guest']">
Please <a href="register.php">register</a> or login to download attachments.
<vb:else />
<vb:if condition="$show['thumbnailattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_thumbnails}" /> {vb:rawphrase attached_thumbnails}</legend>
{vb:raw post.thumbnailattachments}
</fieldset>
</vb:if>

<vb:if condition="$show['imageattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_images}" /> {vb:rawphrase attached_images}</legend>
{vb:raw post.imageattachments}
</fieldset>
</vb:if>

<vb:if condition="$show['imageattachmentlink']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_images}" /> {vb:rawphrase attached_images}</legend>
<ul>
{vb:raw post.imageattachmentlinks}
</ul>
</fieldset>
</vb:if>

<vb:if condition="$show['otherattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attached_files}" /> {vb:rawphrase attached_files}</legend>
<ul>
{vb:raw post.otherattachments}
</ul>
</fieldset>
</vb:if>

<vb:if condition="$show['moderatedattachment']">
<fieldset class="postcontent">
<legend><img src="{vb:stylevar imgdir_misc}/paperclip.png" class="inlineimg" alt="{vb:rawphrase attachments_pending_approval}" /> {vb:rawphrase attachments_pending_approval}</legend>
<ul>
{vb:raw post.moderatedattachments}
</ul>
</fieldset>
</vb:if>
</vb:if>
</div>
<!-- / attachments -->
</vb:if>


screenshot:

140191

NOTE: this does not work if you show attachments inline. In that case you have to use a hide mod.

https://vborg.vbsupport.ru/showthread.php?t=282328 or https://vborg.vbsupport.ru/showthread.php?t=266744

magnaromagna
07-30-2012, 10:25 AM
Maybe I don't understand: I use inline attachment system, and mods linked talk about hide code and html, not images.
See this for example:
www.baltazar.it/notizie/435298-le-belle-dello-sport.html#post926297
To let only registered members see this image I need a mod or just edit the postbitlegacy code?
Thank you again

peugeot405
07-30-2012, 12:04 PM
Have a look at he screenshot


140206

magnaromagna
07-30-2012, 03:51 PM
I cannot see the first example in the attached you post.
But - for what I can see - there is not a "register or login to see the attached". Is it correct?

peugeot405
07-30-2012, 08:40 PM
https://vborg.vbsupport.ru/attachment.php?attachmentid=140206


the first attachment (inline attachment that is shown directly in the post) in the screenshot is the same thing as the example you gave
www.baltazar.it/notizie/435298-le-belle-dello-sport.html#post926297 (http://www.baltazar.it/notizie/435298-le-belle-dello-sport.html#post926297)
and can only be hidden with a mod.

the second attachement is the attachment that is below the post (in the box that shows attached files) and can be hidden by editing the postbit legacy.