MyBB Community Forums

Full Version: CSS text-overflow instead of PHP str_replace
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi friends,
today I was styling up a bit my board's Control panels and I asked myself why MyBB doesn't come with text-overflow CSS property applied to long text by default.

For example, at line 1590 of usercp.php the thread subject is capped to 25 words:

$lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";

This correctly prevents extremely long subjects to go out of its container. But the title maximum length is quite static. You can't change it unless you modify the core, but there's a pretty CSS trick we can use to automatically cap long text inside a container: text-overflow.

Its ellipsis value should be a valid replacement for unuseful PHP replacing functions and it can be used to make the text cap limit more dynamic in my opinion. Do you think it's worth to include this in MyBB 1.8 default theme?
I hope MyBB adopts some of these "new" properties and ideas with the 1.8 theme. They make things much easier to modify and it's a lot more responsive.