MyBB Community Forums

Full Version: Change the character limit of the titles of last posts on the home page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
On the home page, there are four columns, "Forums," "Threads," "Posts," and "Last Post."

If a post title is over ~25 characters the title gets cut off with a ...

How do I change this limit?
In ./inc/functions_forumlist.php, from line 232:

if(my_strlen($lastpost_subject) > 25)
{
	$lastpost_subject = my_substr($lastpost_subject, 0, 25)."...";
}

Change both instances of 25.
Thanks for the quick response. Just out of curiosity, wouldn't it make more sense to check if it's > 27 because otherwise the ... will take up more room than the characters normally would?
no, by the looks of things, it gets the first 25 characters, then appends "..." Smile

EG:
"abcdefghijklmnopqrstuvwxy..." (>25)
"abcdefghijklmnopqrstuvwxyza..." (>27)
if(my_strlen($lastpost_subject) > 25)

should be 27, eg:

abcdefghijklmnopqrstuvwxyz

is 26 characters, now that would be converted to

abcdefghijklmnopqrstuvwxy...

when instead of the ... you could have just had the full thing with less characters
I see what you mean, it may end up making it longer than it was originally. Could be considered a bug really, I mean if you cut of one character off the end and then add ... on the end, that's not ideal.
Yeah that actually happened on my forum, I suggest you (MyBB) change the first number to 27.

Or even better, make it a setting and then do setting + 2.