Topic: Truncate comment
mrpq

Freshman
Freshman
Posts: 19

Posted:
26.Feb 2006 - 20:26

I noticed to see words clumsy cutted in the comments.
So, I figured out a way, to make it more decent.

File: \Comments\index.php
Change row 648

Code

elseif(strlen($comment) > $commentlimit) echo substr("".pnVarPrepHTMLDisplay($comment)."", 0, $commentlimit)."<br />\n<strong><a href=\"index.php?name=Comments&amp;sid=$sid&tid=$tid&mode=$mode&order=$order&thold=$thold\">"._READREST."</a></strong>\n";

to:

Code

elseif(strlen($comment) > $commentlimit) echo substr(substr(trim($comment),0,$commentlimit),0,strlen(substr(trim($comment),0,$commentlimit))-strpos(strrev(substr(trim($comment),0,$commentlimit))," "))."... <br />\n<strong><a href=\"index.php?name=Comments&amp;sid=$sid&tid=$tid&mode=$mode&order=$order&thold=$thold\">"._READREST."</a></strong>\n";


Gr.
mrpq