Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Signatures Extension: More lines

TiggrTiggr
edited January 2009 in Vanilla 1.0 Help
Hi!

I would like to allow my users longer signatures, multiple lines, and having a textarea for input instead of the input field.

How can I change the extension for this?

Bye
Tiggr

Comments

  • NickENickE New
    edited October 2006
    At the moment the signatures extension allows vanilla to do all the UI/post back processing, and as such is limited to single-line inputs. Showing a textarea instead would mean you'd have to write your own account hook. Browsing themes/identity_form.php and library/Vanilla/Vanilla.Control.IdentityForm.php should give you a good idea of how to go about doing it/what delegates to use.
  • Thank you very much!

    I will have a look into this!

    Bye
    Tiggr
  • this is just what we all need' can anyone try and create an extension or a plugin for this?
  • To allow more characters change the number on line 22 in Signatures/default.php to the amount of characters you want. It is 200 by default.
    On my forums I use a customized Signatures extension and have for ages.
    I don't use a textarea but instead I allowed the [br] tag to be used for new lines.
    To do this, replace lines 78 to 86 with this:
    $Text = htmlentities($Text); $bbSearch = array( // '/\[b\](.*?)\[\/b\]/is', // '/\[i\](.*?)\[\/i\]/is', // '/\[u\](.*?)\[\/u\]/is', '/\[url\=(.*?)\](.*?)\[\/url\]/is', '/\[url\](.*?)\[\/url\]/is', '/\[img\](.*?)\[\/img\]/is', '/\[br\]/is', ); $bbReplace = array( // '<strong>$1</strong>', // '<em>$1</em>', // '<u>$1</u>', '<a href="$1">$2</a>', '<a href="$1">$1</a>', '<img src="$1" />', '<br />', ); $Text = preg_replace ($bbSearch, $bbReplace, $Text);
    If you want to allow bold, italic and/or underlined text just uncomment those lines. I choose to disallow them most times because some people go overboard and it makes the forum ugly, but up to you.
    I also changed the description to be more informative of the BBCode options for users. To do that, change line 34 to:
    $Context->Dictionary['CUSTOMIZATION_SIGNATURE_DESCRIPTION'] = 'Displays a small signature under each of your posts.<br /> The maximum amount of characters allowed is '.MAX_SIGNATURE_LEN.'.<br /> Syntax allowed is as follows:<br /> <strong>[url=http://www.website.com][img]http://www.website.com/image.jpg[/img][/url]</strong> for image links.<br /> <strong>[url=http://www.website.com]site name[/url]</strong> for links.<br /> <strong>[img]http://www.website.com/image.jpg[/img]</strong> for images.<br /> <strong>[br]</strong> for line breaks.';
  • shinseijoshinseijo New
    edited January 2009
    Thanks Sub, that's a pretty handy tip. I agree with you on keeping the signatures to a minimum - they can get ugly pretty quick...
Sign In or Register to comment.