Log in

View Full Version : What VB function is used to cut thread titles on a word boundary ?


mihai11
08-09-2007, 08:42 AM
Hi,

This function must be used when displaying the titles of the thread on the forum page. Does anybody know what function are they using ?

Regards,
Razvan

StrifeX
08-09-2007, 08:51 AM
Do you mean a character limit that replaces overflowed text with "..."?

mihai11
08-09-2007, 08:54 AM
Do you mean a character limit that replaces overflowed text with "..."?

Yes. If you have noticed, they are not just cutting text. For example a phrase like this:

"This is the thread title."

is displayed like this: (if it is too long)

"This is the thread ... "

and not like this:

"This is the thread tit ... "


I hope that you understand.

StrifeX
08-09-2007, 09:18 AM
Oh, i completely understand what you mean, but to my knowledge you could only cut text on a per-letter basis in the Admin CP.

Adrian Schneider
08-09-2007, 09:23 AM
You're looking for fetch_trimmed_title /**
* Trims a string to the specified length while keeping whole words
*
* @param string String to be trimmed
* @param integer Number of characters to aim for in the trimmed string
*
* @return string
*/
function fetch_trimmed_title($title, $chars = -1)

mihai11
08-09-2007, 10:53 AM
You're looking for fetch_trimmed_title /**
* Trims a string to the specified length while keeping whole words
*
* @param string String to be trimmed
* @param integer Number of characters to aim for in the trimmed string
*
* @return string
*/
function fetch_trimmed_title($title, $chars = -1)

Great ! Thank you very much.