• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
  • This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Block Images, bbcode in signatures

Shelley

Well-known member
#1
I never allow Images in signatures at my site so I thought this tip to exclude images in signatures and exclude bbcode might appeal to some.

Originally Kier provided me with the code to block images so thanks and credit to kier for this. I extended that by blocking quotes and code boxes which I noticed some people use around here that can become irritating on other peoples sites.

Simply insert the following code into your EXTRA.css Template and your done. If your using more than 1 style you'll have to include the code into those Extra.css templates.

Code:
.signature .bbCodeBlock,
.signature .bbCodeImage
{
    display: none !important;
}
 

Shelley

Well-known member
#5
I don't personally allow images in signatures period even if they display once per page, per thread they distract from the content. Anyone that feels the same can now insert the css if they run their forums with the same mindset.
 

ExpertPixels.com

Well-known member
#6
Thanks Shelley,

Helps prevent a lot of spam and saves some bandwidth as well. I can not believe i just stared at your OP code and Kier's code for several minutes trying to find a difference between them, eventually hit me you must have edited your post lol... on that note i could have almost sworn ive seen "Lasted edited" or "edited by @" in XF before :confused:
 

Ryan Kent

Well-known member
#7
Is there a way to alter the code to allow images but restrict their size? I don't mind images but would like to keep them down to 100 height, 700 width or something in that ballpark.
 

Brogan

XenForo moderator
Staff member
#8
Try something like this:

Code:
.message .signature {
max-height: 100px;
max-width: 700px;
overflow-y: auto !important;
overflow-x: auto !important;
}
You may need to fiddle with the code to get it working properly.
It won't resize the images, it will just create a scrollable box.
 

Ryan Kent

Well-known member
#9
That worked perfect Brogan, thx!

In case anyone is interested, if you replace the "auto" value with "hidden", then you eliminate the scroll bars and the extra size is simply cut-off which is the effect I was trying to achieve. Also need to add .bbCodeImage to keep the entire signature area from being affected.

Code:
/* restrict the size of images in signatures */
.message .signature .bbCodeImage {
max-height: 125px;
max-width: 700px;
overflow-y: hidden !important;
overflow-x: hidden !important;
}
 

Ryan Kent

Well-known member
#10
this is working perfectly for signatures in forum posts, but apparently sigs contained in conversations are controlled differently? Anyone know the code which would work for conversations?
 

Brogan

XenForo moderator
Staff member
#12
The CSS class is the same for posts as it is for conversations.
I have just tested it and it works fine.

You can confirm that by checking a default style.

I suspect this is an issue related to your style.
 

Rudy

Well-known member
#15
One forum I visit has users posting their last.fm "recently played" blocks in their signatures. Since they have some fast-moving threads, I just disabled signature viewing. The forum actually reads much better without having to look past signatures. There is an add-on here that will display a user's signature only once per page (or is it once per thread?)...very helpful.