Announcement

Collapse
No announcement yet.

Show pictures in post only to members

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Wayne Luke
    replied
    Originally posted by josueinaki View Post
    Hello, I tried some time ago make some thing like that but for links, I will share here the info I got in that time, this could be usefull for this too
    https://www.vbulletin.com/docs/html/...e_conditionals < vbulletin manual showing how to use to set conditionals for some group

    <vb:if condition="$bbuserinfo['userid'] == 0">//you need one more conditional here to filter only images
    <p>Register for view links
    <br />
    </p>
    <vb:else />CODE LINK OR CODE BB CODE HERE
    </vb:if>
    Use php hooks to make this work, good luck
    That page isn't a vBulletin 5.X document page and incorrect information for this version of the software. You can tell it isn't a page in the version of manual selected because the breadcrumb and left navigation menu are broken.

    Leave a comment:


  • josueinaki
    replied
    Hello, I tried some time ago make some thing like that but for links, I will share here the info I got in that time, this could be usefull for this too
    https://www.vbulletin.com/docs/html/...e_conditionals < vbulletin manual showing how to use to set conditionals for some group

    <vb:if condition="$bbuserinfo['userid'] == 0">//you need one more conditional here to filter only images
    <p>Register for view links
    <br />
    </p>
    <vb:else />CODE LINK OR CODE BB CODE HERE
    </vb:if>
    Use php hooks to make this work, good luck

    Leave a comment:


  • Mark.B
    replied
    As mentioned by Wayne, this is outside the scope of the support we can provide.

    Leave a comment:


  • Oore
    replied
    Hello,

    Is there anybody with some information on that?

    The issue still persists.

    Thanks in advance!

    Oore

    Leave a comment:


  • Oore
    replied
    Sounds great, Wayne!

    I have tried modifying the returned values of this function, but it isn't showing any change. Do I have to do something to see the modifications (e.g. wiping a cache, etc.)?

    Only to be sure, I was referring to modifying this piece of code a user is getting displayed when being not logged in. I would like to added a <div> around the <a...> tags.

    Click image for larger version

Name:	picture.jpg
Views:	97
Size:	39.5 KB
ID:	4386549

    Leave a comment:


  • Wayne Luke
    replied
    Originally posted by Oore View Post
    Thanks Mark! This piece of code is working fine for attachments and galleries.

    Unfortunately it isn't for images embedded in the post ([ATTACH=JSON]...[/ATTACH]), because they are rendered to "<a href=''><img...></a>" when not being logged in.

    Is there a way to modify the rendering and add an outer <div> or <span>? Then it would be easy to use the CSS code you provided.
    You would need to modify or override the handle_bbcode_img2() method in class vbCodeParser. This is in the class_bbcode.php file in /core/includes/. This is outside the scope of support.

    Leave a comment:


  • Oore
    replied
    Thanks Mark! This piece of code is working fine for attachments and galleries.

    Unfortunately it isn't for images embedded in the post ([ATTACH=JSON]...[/ATTACH]), because they are rendered to "<a href=''><img...></a>" when not being logged in.

    Is there a way to modify the rendering and add an outer <div> or <span>? Then it would be easy to use the CSS code you provided.

    Leave a comment:


  • Mark.B
    replied
    Try this additional css:

    Code:
    /* Hide Images From Guests */
    
    [data-usergroupid="1"] .photo-preview {
      display:none;
    }
    
    [data-usergroupid="1"] .gallery-details::before {
      content: "This post contains images - please register or log in to view them"
    }
    
    [data-usergroupid="1"] .gallery-details .b-photo-count {
      display:none;
    }
    
    [data-usergroupid="1"] .b-post-attachments ul::before {
      content: "This post contains images - please register or log in to view them"
    }
    
    [data-usergroupid="1"] .b-post-attachments .b-post-attachments__item {
      display:none;
    }
    
    /* End Hide Images From Guests */

    Leave a comment:


  • Oore
    replied
    The CSS code would only affect the image, but when the user is logged in no image is shown. Instead a link to the image is displayed.

    Is there a way to modify the internal BB code [ATTACH=JSON] ? Then I could add a div around and make the <a href> via CSS disappear completely.

    Leave a comment:


  • Glenn Vergara
    replied
    Self-closing HTML tags such as <img>, <input>, etc cannot have pseudo elements :before and :after.
    ​​​​​​

    Leave a comment:


  • Wayne Luke
    replied
    The IMG BBCode? It should be possible with similar CSS. Try this:
    Code:
    [data-usergroup-id='1'] .js-post__content-text > img::before {
      content: "Please Register to View Images."
    }
    
    [data-usergroupid="1"] .js-post__content-text > img::before {
      display:none;
    }
    Caveats: The image will still be in the code so if they go digging for it, they can still find it. Plus this will hide the Smileys (Emoticons).

    A more comprehensive solution would require custom coding.

    Leave a comment:


  • Oore
    started a topic Show pictures in post only to members

    Show pictures in post only to members

    Hello,

    Is it possible to replace the picture in a post by a message like "Pictures are only shown to registered and logged in members"?

    Currently instead of the picture a link is shown when not being logged in.

    For attachments I have found the CSS code posted here to achieve that.

    Thanks in advance!

    Oore
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X