XF 2.2 Hide image option for Users

Silmarillion

Active member
I am surprised that this function, quite obviously, does not exist with Xenforo !?
Many of our members would like to hide images in postings and avatars. Is that possible?

Best regards,
Silmarillion
 
Solution
Create a custom user field:

1614798559988.webp


Edit the PAGE_CONTAINER template:

HTML:
<xf:if is="$xf.visitor.Profile.custom_fields.hideImages">
    <xf:css>
    .bbImageWrapper
    {
        display: none;
    }
    </xf:css>
</xf:if>

1614798623852.webp


Members can then opt in to hiding images via their preferences.

1614798664635.webp
My mistake, djbaxter. I wrote that badly. I mean something different. With vBulletin it was possible (User-Account) to prevent the display of images and signatures in postings. At XF, this is unfortunately only possible with signatures. Some users would also like this option for pictures.
 
Hard to say what the issue is without seeing the site.

Perhaps the images you are trying to hide use a different class to bbImageWrapper.
 
I sent you the address of the forum and a test account, Brogan. If you should have a short moment, you can take a quick look at it. That would be great.

Could it possibly be due to an add-on?

Regards
 
I won't be able to assist if it can't be done from this site.

I get too many custom requests and it's not something I can accommodate.
 
Too bad. That would have been such a good, clean, and most importantly, simple option for our members. Many would have been very happy about it. But as it currently looks, we will have to do without it. :/
 
Oh man, how embarrassing to me, Brogan. I just had to smile myself. If I were already much more familiar with XF and the code, I would probably have realized immediately what the "problem" is.

Your code only seems to hide images uploaded through the forum!?

Attachments and graphics that were linked externally are still all displayed.

I thought the code would "eliminate" all images in the postings. ^^

My mistake.

Is it possible to add this function to the code? It would of course be perfect if you could create additional, separate custom user fields that enable members to deactivate images individually (e.g. externally integrated images, smilies, avatars, videos ...).

Thank you for looking at this in our forum. I know that this cannot be taken for granted and I have great appreciation for it.

This professional support reminds me of my wonderful early days with vBulletin3 in 2004/05. It's a good and nice feeling. Thank you my friend.
 
Attachments and graphics that were linked externally are still all displayed.

As I said in my previous post ...
Perhaps the images you are trying to hide use a different class to bbImageWrapper.

You will need to add all the classes you want to hide to the code, in this format:
HTML:
.bbImageWrapper,
.anotherClass,
somethingElse
{
display: none;
}

Use the browser inspector (F12) to determine the classes.

If you want members to have individual control over each type, create a custom user field and the corresponding if check for each one.
 
Very good! So I learned something again. I will try exactly as you suggested to me. If necessary, I have to report again on the subject. In the hope that someone will be found who can help me again. Ideally, of course, you, Brogan. 😉

Thank you very much again.👍
 
Top Bottom