1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HTML in Custom Titles 1.5

Allow HTML tags in Custom User Titles

  1. Chris D

    Chris D XenForo Developer Staff Member

    [​IMG]
    [​IMG] [​IMG] [​IMG]
    Thank you so much for donating. It is always appreciated!

    This add-on will allow people who may edit their Custom User Title to use some HTML tags in their Custom User Title.

    The tags that are allowed to be used can be configured in the Admin CP > Options > User Registration.

    [​IMG]

    The end result can look like this:

    [​IMG]

    HOW TO INSTALL
    The easiest way to install this add-on is if you use the Add-On Installer.

    Alternatively:
    1. Download the zip file.
    2. Extract its contents to your hard drive.
    3. Upload the contents of the upload folder to the root of your XenForo installation.
    4. Complete install via the Admin CP using the provided XML file.
     
  2. ineedhelp

    ineedhelp Well-Known Member

    Can you also add the option which allows members or admins, to colour code usernames ? It will be good if members would pick and choose the colour of their username.
     
  3. Chris D

    Chris D XenForo Developer Staff Member

    This is for custom titles only :)
     
  4. ineedhelp

    ineedhelp Well-Known Member

    I know, but if you could add the option I suggested in this addon or maybe make a new add-on for it.
     
  5. James

    James Well-Known Member

    Nice add-on Chris, however, strip_tags doesn't remove attributes.

    It creates the potential to have this add-on do unwanted things, such as <b style="background:red;width:600px"> or even worse, <b onclick="window.location('mrmaliciouswebsite.com')">.

    For the next version, perhaps you can incorporate some regex to strip anything after the initial tag :)
     
    Shelley likes this.
  6. Chris D

    Chris D XenForo Developer Staff Member

    Thanks James. Good suggestion.

    The main reason I created this is for my site and only staff have the ability to edit their titles. So not a huge problem for me but I will definitely get that sorted.

    Thank you.
     
    jauburn, ArnyVee, James and 1 other person like this.
  7. VXL

    VXL Member

    Nice addon Chris. May I recommend that you include the following features:

    1. Enable/disable open links in new window
    2. Enable/disable nofollow tag for all links
     
  8. TrevC

    TrevC Well-Known Member

    Excellent work (as usual).

    Small suggestion: have the add-on increase the limit from 50 chars to something higher (varchar custom_title needs to be upped, and the Xenforo User datawriter PHP). 50 seems way too low when hrefs etc are involved.

    Thank you Chris :D
     
  9. sonnb

    sonnb Well-Known Member

    It is better to also include an function to check unclosed html tag to not break our layout.
     
    Chris D likes this.
  10. taylor_smith

    taylor_smith Well-Known Member

    If I give someone a custom user title who cannot edit their own titles, may I add HTML?
     
  11. Slavik

    Slavik XenForo Moderator Staff Member

    My appologies to Chris, but I need to lock this thread to prevent any posts being edited.

    This has been forwarded to Ashley for his attention, and the user engaged in piracy has had his account banned.
     
    0ptima, oman, tajhay and 10 others like this.
  12. Slavik

    Slavik XenForo Moderator Staff Member

    Thread re-opened.
     
    Chris D likes this.
  13. Chris D

    Chris D XenForo Developer Staff Member

    Yes :)
     
    CarpCharacin likes this.
  14. taylor_smith

    taylor_smith Well-Known Member

    Awesome! Tyvm. :)
     
  15. Pope Viper

    Pope Viper Well-Known Member

    I'm wanting to put <img> tags in, however, I need to somehow expand the max characters beyond 50. Is that possible?
     
  16. Chris D

    Chris D XenForo Developer Staff Member

    Only with changes to the database tables. There's a maximum limit on that field in the database of 50 characters.
     
  17. Pope Viper

    Pope Viper Well-Known Member

    Hmmm. This feature is something I'd really like to do. Any guidance on how to do so, or would it totally hose things up?
     
  18. James

    James Well-Known Member

    You should be able to just edit the maximum length in the database using your favourite software (i.e. phpmyadmin).
     
  19. Chris D

    Chris D XenForo Developer Staff Member

    And the max length value in the data writer.

    I haven't got time to get into this right now, but if you make a post elsewhere on the forum or if someone else has more time to help they will talk you through it.

    Ideally you should request it as an add-on, though, or you'll have a core file edit that you would need to edit each time you do a XenForo upgrade.
     
  20. Pope Viper

    Pope Viper Well-Known Member

    I found the entry in the database for that particular field (Xf_user, custom_title), I'm going to mess around there, and see how that works out.

    Thanks Chris!
     

Share This Page