1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. 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

Discussion in 'Tips and Guides [Archive]' started by Shelley, Mar 21, 2011.

  1. Shelley

    Shelley Well-Known Member

    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;
    }
    
     
  2. Kier

    Kier XenForo Developer Staff Member

    Quick correction here, as the code above will block images and code blocks in post content, as well as signatures.
    Code:
    .signature .bbCodeBlock,
    .signature .bbCodeImage
    {
    	display: none !important;
    }
     
    Adam Howard, bubbl3, araj1971 and 2 others like this.
  3. Shelley

    Shelley Well-Known Member

    Corrected and updated first post.
     
  4. Ryan Kent

    Ryan Kent Well-Known Member

  5. Shelley

    Shelley Well-Known Member

    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.
     
    estranged likes this.
  6. ExpertPixels.com

    ExpertPixels.com Well-Known Member

    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:
     
    Brandon Sheley likes this.
  7. Ryan Kent

    Ryan Kent Well-Known Member

    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.
     
  8. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  9. Ryan Kent

    Ryan Kent Well-Known Member

    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;
    }
     
    boatswife likes this.
  10. Ryan Kent

    Ryan Kent Well-Known Member

    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?
     
  11. Ryan Kent

    Ryan Kent Well-Known Member

    example of the issue:

    ConvoSig.JPG
     
  12. Brogan

    Brogan XenForo Moderator Staff Member

    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.
     
  13. Rudy

    Rudy Well-Known Member

    Perfect!! Thanks! Installed on both of our XF forums.
     
  14. estranged

    estranged Well-Known Member

    I wish same code was used here on xenforo.com. I hate seeing them!
     
  15. Rudy

    Rudy Well-Known Member

    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.
     
  16. Ryan Kent

    Ryan Kent Well-Known Member

    I use that add-on + Shelley's suggestion from this thread.
     
  17. trilogy33

    trilogy33 Well-Known Member

    Sigs: Is there a way to halt animated GIFs in their stride? i.e. lock to 1st frame?
     
  18. Brendon Meynell

    Brendon Meynell Active Member

    Great suggestion Shelley, Good Work :)
     

Share This Page