Welcome Guest, Not a member yet? Register   Sign In
Display Excerpt
#1

[eluser]HSKrustofsky[/eluser]
I was wondering if there was a way to display an excerpt of a blog topic and/or video description? I saw in the user guide that you could use the Trackback Class. I noticed that it said that the lowest it goes is 500 characters. Is there was something to where less was shown?
#2

[eluser]Medikal[/eluser]
I used a custom function on mine to be honest:
Code:
function excerptString($string, $desLength, $endChars = '...', $before = '1', $offChar = ' ')
{
    if (strlen($string) < $desLength)
    {
        return $string;
    }

switch($before)
{
case 0:
$partialString = substr($string, $desLength, strlen($string));
$endPosition = strpos($partialString, $offChar);
return substr($string, 0, $desLength+$endPosition).$endChars;
break;

case 1:
$string = substr($string, 0, $desLength);
$endPosition = strrpos($string, $offChar);
return $string = substr($string, 0, $endPosition).$endChars;
break;

}

}

Further explanation of how to use it is here:
http://danlamanna.com/portfolio/?p=24
#3

[eluser]InsiteFX[/eluser]
See the CodeIgniter Typography Class.

Also see this:

CodeIgniter User Guide - Text Helper

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB