I write pretty long posts and I don't want every single post to show up at the home page.
Here's my site so you can see why I need this option for my blog.
My Blog
Thank you
Posted 19 April 2009 - 06:06 PM
Posted 01 May 2009 - 08:55 AM
papuccino1, on 19 Apr, 2009 - 05:06 PM, said:
<a href="http://www.domain.com/index.html>Link</a>
This post has been edited by SixOfEleven: 01 May 2009 - 09:04 AM
Posted 01 May 2009 - 09:20 AM
/*
** Function for truncating text and adding trailing characters
** default characters is the ellipse (...) but can be whatever the
** user chooses. The default length is 75 characters but the
** user can change that as well. The function has 3 parameters:
**
** $textToTruncate - The text we wish to truncate
** $truncLen - Maximum length we want the text to be
** $truncateChars - characters to append to end of truncated text
(default is the ellipse)
*/
function truncateText($textToTruncate, $maxLength = 75, $trailingChars='...')
{
$maxLength -= mb_strlen($trailingChars);
if (mb_strlen($textToTruncate)> $maxLength)
{
//Since we're here then the text is longer than
//the maximum length we wish to allow so we need
//to truncate the text and add the truncate characters
return mb_substr($textToTruncate,0,$maxLength).$trailingChars;
}
else
{
// string was already short enough, return the string
$truncatedText = $textToTruncate;
}
//return the truncated text
return $truncatedText;
}
|
|
Query failed: connection to localhost:3312 failed (errno=111, msg=Connection refused).
|
