vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   How to hide all attachments (Images / Video / Links) from Guests (https://vborg.vbsupport.ru/showthread.php?t=283402)

JohnSG 05-24-2012 03:32 AM

How to hide all attachments (Images / Video / Links) from Guests
 
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 [DATE]1337835780[/DATE] at [TIME]1337835780[/TIME] ---------------

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

1 Attachment(s)
you have to use a conditional if to do that.

open postbit legacy

search for:

Code:

<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

Code:

<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:

Attachment 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

1 Attachment(s)
Have a look at he screenshot


Attachment 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?


All times are GMT. The time now is 12:57 PM.

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.01188 seconds
  • Memory Usage 1,776KB
  • 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete