Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: elkaintmoose on April 22, 2006, 06:50:55 PM

Title: Truncating Text?
Post by: elkaintmoose on April 22, 2006, 06:50:55 PM
Is there any kind of built-in truncate function I could get my hands on, to automatically shorten things like post titles to a certain length, maybe followed by a '...' or something?

I'm thinking about things like the stats page, for instance, where long titles spill over to two lines and mess up the bar display a little...

Is there a quick php snippet I could wrap around a $variable['call'] somehow to cut things down to, say 25 characters and a '...'? (My php skills are, um, 'developing'... ;D) Is there a more elegant solution?

Thanks for any ideas,
jeff.