• 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.

Signatures Control Plugin: Max Chars, Max Links, Max Lines

tenants

Well-known member
A lot of these options are probably going in to the later versions of XenForo (and they will probably be done a lot better), but for those that need these signature options now, I've created a plugin.

All my thanks goes to Lawrence and his excellent simplified tutorial
This is my fist add-on, and its an extension of the add-on described in this tutorial:
http://xenforo.com/community/threads/creating-an-addon.5416/

This add-on allows Administrators
* To limit the number of lines allowed in a signature
* To limit the number of links allowed in a signature
* To limit the number of images allowed in a signature
* To limit the number of characters allowed in a signature [Including BB]
* To limit the number of characters allowed in a signature [Excluding BB]

* [existing functionality] To prevent users adding/modifying signatures until they have reached a minimum post count

- This add-on only works when a user saves their signature (so existing signatures remain intact)

- On saving a signature, if it break the rules, this add-on also adds a message to the users signature pointing to the rules (so mods dont need to explain why the signature was updated)

- If you want additional extras for this mod, or want updates, I really recommend looking at the tutorial above created by Lawrence. Feel free to modify this add-on and make it your "own"

Installation:
  • Unzip the following file into a folder named "LimitSig"
  • Upload this folder into the library folder of your XenForo root
You should now have the following folder structure:
http://www.yourforum.com/library/LimitSig
  • Go to ACP -> Add-ons -> Install Add-on -> Install from file on server
  • Install from file on server: " library/LimitSig/addon-limitSigsTenantsMod.xml "
  • Set options in administration control panel ACP>>Home>>Options>>Signature Options
Download:
 

Attachments

Screen shots

By the way, I've been using Xenforo for 3 weeks (I had never even used this type of forum before)
... that's how quick and easy Xenforos plug-in development area is to use!
 

Attachments

  • maxchars2.webp
    maxchars2.webp
    48.4 KB · Views: 148
Nice:)

BUT wouldn't it be better to have different rules for different usergroups?
 
Nice:)
BUT wouldn't it be better to have different rules for different usergroups?

Yeah, but it works for me... for now (I only have one user group that I need to apply this to, and that's registered users)
Feel free to update it. I'm probably not going to take it much further, but I thought I would add it so others can take "ownership" or develop it for their own purposes.
 
What plugins do you currently have? I've added this to my forum, and a fresh install "Testing" forum, and it's working on both without an issue

It is a very basic plugin and should not cause any issues
There is only one call back it makes, and that is to: LimitSig_Option_Group::renderOption
(as shown in the tutorial by Lawrence, which did I mention.. is great)

Did you add all of the zipped files to the library folder?
To me, it sounds like you are missing the file:

yourforum/library/LimitSig/Option/Group.php

Make sure you have added all the files before installing
 
My guess is, its that the length is getting chopped here . (I just tried 3 links, 4 links and 5 links, anything after the defined number of links and the links get stripped out leaving the anchor text intact)

What is your "max char size"? I provided a default of 450 .

If its been set to less than 200, then the signature will be chopped in this example as above, since it's reaching the maximum character length (when you include the bbcode).

Dont forget, the maximum length will include the bbcode, so
www.test.ru www.test2.ru www.test3.ru www.test4.ru
is actually close to 200 chars and not 50 chars

Give plenty of room for bbcode in the max limit, thats if you want them to add bb code, and it will look like this (I added 5 links to my signautre, but set the link limit to 3, and max chars to about 300)

siglooklike.webp

The Max Chars is set in the ACP>>Home>>Options>>Signature Options

maxchars.webp
 
I could use this if BB Codes weren't included in max characters option. One of our users have a short signature with only 3 lines but it is 1000 chars with bb code included. Without BB code it is 470 characters. I would set a 500 char limit without BB codes included.

Would you consider adding this as an option?
 
You can set the char limit to 1000, or even 10,000... and then just limit the MAX number of lines

If the signatures are becoming very long, then its not the char limit that you want to restrict, but the line limit

The char limit is there as an "absolute limit", but to be honest, once you have a reasonable line limit set, it doesn't really serve much of a purpose (unless people are trying to paste dictionaries into a single line of the signature).
 
Since I haven't had any issues with image signatures on my board, I'm not sure what sort of restriction you would want?

Do people have too many images in their signatures (it would be possible to put a limit on this number, and strip out excess) , or are the restrictions you need related to heights / widths?

[I'm currently working on a much bigger plugin, but I can spend 10 mins updating this if you need]
 
You can set the char limit to 1000, or even 10,000... and then just limit the MAX number of lines.

It's not the same thing. If I set the limit high, users may abuse it without using new lines and bb code. A very long signature may be used that way.
 
Okay, I've just updated it to meet the requirements for
estranged and Gatses

(the update is in the first post)

This plugin will now also:

* limit the number of images allowed in a signature
* limit the number of characters allowed in a signature [Including BB]
* limit the number of characters allowed in a signature [Excluding BB]

- I havent thouroghly tested it, so let me know if you run into anything
 
Thank you for the update :) Upgrading now...

But why not prevent editing of the signature and display an error message to the user like "your signature is above the limits" etc. instead of stripping the signature?
 
Top Bottom