XF 2.1 regex for chars, but not attachment

Robert9

Well-known member
I have to solve this problem:

Instead of showing the hole page from the wiki in the first post of the connected thread, i have to show only {x} chars.

text = substr(0,200)

but what if i break the text inside bbcode attachment?

How can i care for that, please? Any ideas?
 
It seems that you're trying to display only a portion of some string passed to a template, correct? This would normally be done from within said template using the templater's snippet function. For example, {{ snippet($some.data, 100) }} would display the first 100 characters of $some.data.
 
Top Bottom