I am puzzling how to solve the following situation
When your viewing comments in thumbnails, it can mess up the layout if it contains smillies. Especially if people place commetns only containing a row of smilies.
It's easy to define the length of a pure text string using :
strlen($row['msg_body'])
But to process the smileys we would use ater this
$msg_body = process_smilies($msg_body);
There is a way to determine the size of a smiley using the standard php function getimagesize()
but how to combine these functions so you can determine the lenght of the complete string.
In my case I want comments including the smileys in thumbnail view on 1 line (maximum) for lets say 150 px width and not spread over more lines so I can cut it off at 50 and place .... after it
$msg_body = utf_strlen($msg_body) > 50 ? utf_substr($msg_body,0,50).'...': $msg_body;
But I got two different unitys (px and tekst lenght) so there must be a trick to combine these.
further more I would like to get rid of half processed emoticons (for instance :brea instead of the full emotion which would use :break: ). if it breaks the string. But I think I can program this by checking for the last word in the original string at for instance 50, by searching for a white space in front and at the end of the last word and process this individual to check if it's an emoticon or not. But still this would include another emoticon width problem.
I'm a pretty good php programmer and know my way around in coppermine almost blindly so I don't need a complete written solution (although it would be appriciated) not but more a pointing in the right direction how to tackle this problem