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

Please enter a message with no more than 420 characters

Discussion in 'XenForo Questions and Support' started by Andy.N, Apr 14, 2011.

  1. Andy.N

    Andy.N Well-Known Member

    Where do we adjust this 420 characters limit on profile post?
  2. Wuebit

    Wuebit Well-Known Member

    library/XenForo/DataWriter/ProfilePostComment.php (at a guess)

    protected function _preSave()
            if (
    $maxLength 420;
                if (
    utf8_strlen($this->get('message')) > $maxLength)
    $this->error(new XenForo_Phrase('please_enter_message_with_no_more_than_x_characters', array('count' => $maxLength)), 'message');
    Brogan and Andy.N like this.
  3. Brogan

    Brogan XenForo Moderator Staff Member

    I think this may be hardcoded as I've never seen a setting for it in the ACP.

    Edit: Confirmed by Vodkaholic above.
    Vodkaholic likes this.
  4. Andy.N

    Andy.N Well-Known Member

    Arghhh. Thanks Vodkaholic
    I thought (and hope) this hardcoded value is available via ACP.
    Darkimmortal and Vodkaholic like this.
  5. caoanh204

    caoanh204 Active Member

    More... open library/XenForo/DataWriter/DiscussionMessage/ProfilePost.php

    Find and fix: $maxLength = 140;
    $options[self::OPTION_MAX_MESSAGE_LENGTH] = 420;
  6. James

    James Well-Known Member

    You might also have to edit the database field if it has a max value attached to it. Also in the getFields function.
  7. Neutral Singh

    Neutral Singh Well-Known Member

    Has this option been implemented in newer XF versions... o_O
  8. Brogan

    Brogan XenForo Moderator Staff Member

    Nothing has changed.
  9. Pinn

    Pinn Active Member

  10. SneakyDave

    SneakyDave Well-Known Member

    I'll see how easy this is to put into an addon. No promises though, lol.

    I think I can easily make the 420 character limit an option.
  11. Pinn

    Pinn Active Member

  12. SneakyDave

    SneakyDave Well-Known Member

  13. Pinn

    Pinn Active Member

    Not good for money, should be free of charge.
  14. Andy.N

    Andy.N Well-Known Member

  15. SneakyDave

    SneakyDave Well-Known Member

    The page title is a different limit and beast, because it is set at VARCHAR(50) in the database schema, so in order to change that, the database structure would have to change, which may affect other nodes, such as forum and forum category name

Share This Page