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

Max character limit for thread titles

Discussion in 'XenForo Questions and Support' started by Luxus, Nov 3, 2012.

  1. Luxus

    Luxus Well-Known Member

    There is an option for the max character limit in posts in the ACP, but I can't seem to find an option in the ACP that lets you specify the amount of allowed characters in thread titles. I know that it isn't unlimited, so where is the setting? Is it hardcoded?
  2. CyclingTribe

    CyclingTribe Well-Known Member

    AFAIK it's hard-coded.
  3. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member


    	protected function _getCommonFields()
    		$structure = $this->_discussionDefinition->getDiscussionStructure();
    		return array(
    			$structure['table'] => array(
    				$structure['key']        => array('type' => self::TYPE_UINT, 'autoIncrement' => true),
    				$structure['container']  => array('type' => self::TYPE_UINT, 'required' => true),
    				'title'                  => array('type' => self::TYPE_STRING, 'required' => true, 'maxLength' => 100,
    					'verification' => array('$this', '_verifyTitle'), 'requiredError' => 'please_enter_valid_title'
    				'reply_count'            => array('type' => self::TYPE_UINT_FORCED, 'default' => 0),
    				'view_count'             => array('type' => self::TYPE_UINT_FORCED, 'default' => 0),
    And you also need to change the table definition for xf_thread in the database. You need to extend the length of the title column.
    Jarod and Luxus like this.
  4. Luxus

    Luxus Well-Known Member

    Thanks Jake. Ever since I moved away from myBB I decided I wouldn't touch any core files in forum software anymore. I'm going to stick with the hardcoded limit for now.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Well it can be made into an addon by extending the datawriter.
  6. pankaj2345

    pankaj2345 Member

    thank you very much for this help :)
  7. pankaj2345

    pankaj2345 Member

    Apocalypse likes this.

Share This Page