it would be fuck easy to do...infact wait a tick
Code: Select all
// function to limit a string length...
function wordLimit($string, $length = 50, $ellipsis = '...') {
return count($words = preg_split('/\s+/', ltrim($string), $length + 1)) > $length ?
rtrim(substr($string, 0, strlen($string) - strlen(end($words)))) . $ellipsis :
$string;
}
// that needs to go in the page you are displaying the links...just put it in a file and then...
include("wordlimit.php");
/* you will need a var for the first post of the thread (i bet one is already set).
then when you are pulling all the threads from the db its a simple matter of...*/
<a href="threads.php" title="<?php echo wordLimit($firstPost, 20); ?>">title of thread</a>
EDIT: its kinda like the alt tag for an image and how that displays using IE (even tho thats not what they are designed to do but anyway). it wont change the way anything looks. just if you hover your mouse over a link it will display the text. should work in all decent browsers.