MyBB Hacks

Full Version: Limitting Thread Subject
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Note that the max length of thread subject is hard coded in MyBB (by default, it is 85).
We can use Custom Modify Error feature of XThreads to set a lower limit.

Create Custom Thread Fields.
  • Title: Maximum Subject
  • Key: max_subj
  • Applicable Forums: select in which forum(s) we need a lower thread subject length.
  • Hide input field on New/edit thread: check
  • Hide on Show thread: check
  • Editable by / Required Field?: Everyone. Please do not make it required.
  • Custom Modify Error

    Code:
    <if my_strlen($mybb->input['subject']) > 50 then>Your subject is too long. The maximum characters allowed is 50</if>

Modify it as your needs.

Now each time users try to post a thread with subject more than 50 characters, there is a nice error messages for them Biggrin
If we want different length for each forum, just create other similar custom thread fields.
Reference URL's