Poll: Was this article helpful for you?
You do not have permission to vote in this poll.
Yes
100.00%
1 100.00%
No
0%
0 0%
Total 1 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to increase the max thread subject length
#1
By default a thread subject can have a maximum of 85 characters.
In some cases a thread subject might be longer than 85 characters so you might want to raise the limit.

1. Editing the database
First you will have to edit the database so it can store more than 85 characters.
In order to do that you should open the website where you've hosted your copy of MyBB, in my case it's lima-city.de
From there you have to open PHPMyAdmin.
In MyBB 1.8.24 the thread subject is stored in the table mybb_threads and the column is called subject.
If you click on this column you will see more details about it in PHPMyAdmin.
We can leave "Name" - "subject" unchanged.
We can leave "Type" - "VARCHAR" unchanged, too.
But we have to change "Length/Values" from 85 to i.e. 120.
Now we can save that and close PHPMyAdmin.

2. Editing the PHP script that evaluates if the max length of characters has been exceeded or not
The script we need is in the path MyBB1824/Upload/inc/datahandlers/post.php
From line 226 to 231 we will see the following code:

if($subject_length > 85)
{
// Subject is too long
$this->set_error('subject_too_long', my_strlen($subject));
return false;
}


We have to change it to i.e. 120 and then re-upload this file via FTP.

3. Editing the PHP script that evaluates if the subject of a reply is too long or not.
The script we need is in the path MyBB1824/Upload/showthread.php
From line 89 to line 92 we will see the following code:

if(my_strlen($reply_subject) > 85)
{
$reply_subject = my_substr($reply_subject, 0, 82).'...';
}


We have to chnge that to 120, too.

4. Making the textbox itself bigger so it doesn't seem to be cut off when having more than 85 characters:
To do so we need to go to the Admin CP.
From there we will go to Templates.
Then we will select "Default Templates".
Now click on "New Thread Templates".
Go to the submenu "newthread".
On line 22 is the code we need:

<td class="trow2">{$prefixselect}<input type="text" class="textbox" name="subject" size="120" maxlength="120" value="{$subject}" tabindex="1" /></td>

In your case it will say 85. Change it to 120.
Now don't forget to save your changes and go back to your forum.
Also follow me on Youtube for videos about video games:
https://www.youtube.com/channel/UCxfkGVU...2mQ/videos
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)