How to limit text length in blocks
 
                              
                                
                                 error   232
From: -
                                 
                              
                            From: -
Notice
This topic is archived. New comments cannot be posted and votes cannot be cast.Responses to this topic
1 Re: How to limit text length in blocks
 
                        
                                                
                         Philipp Esselbach 
                        
                        
From: -
                         
                      
                   Editor
  0From: -
                    Because of:
You should change this line to this:
                  
                  
                if ( strlen( $article_seo, $article_title ) > $length)
You should change this line to this:
if ( strlen( $article_title ) > $length)
1 Re: How to limit text length in blocks
 
                        
                                                
                         error
                
                OP
   232
From: -
                         
                      
                  From: -
                    Why this doesn't work in article_latest block?
                  
                  
                
while( list( $article_seo, $article_title ) = $database -> dbrow( $results ) )
{
$length = 22;
if ( strlen( $article_seo, $article_title ) > $length)
{
$article_title = substr ( $article_title, 0, $length ) . "...";
}
$articles_latest .= "· <a href=\"" . $seo_url . "articles" . $preferences[ 'param_action' ] . "summary" . $preferences[ 'param_page' ] . $article_seo . ".html\">" . htmlspecialchars( $article_title ) . "</a><br />";
1 Re: How to limit text length in blocks
 
                        
                                                
                         error
                
                OP
   232
From: -
                         
                      
                  From: -
                    Thanks a lot.
:)
                  
                  
                :)
1 Re: How to limit text length in blocks
 
                        
                                                
                         Philipp Esselbach 
                        
                        
From: -
                         
                      
                   Editor
  0From: -
                    Open /blocks/news_latest.php in an editor and find this line:
and then add before:
                  
                  
                $news_latest .= "· <a href=\"" . $seo_url . "news" . $preferences[ 'param_action' ] . "story" . $preferences[ 'param_page' ] . $newsstory_seo . ".html\">" . htmlspecialchars( $newsstory_title ) . "</a><br />";
and then add before:
$length = 22;
if ( strlen( $newsstory_title ) > $length)
{
$newsstory_title = substr ( $newsstory_title, 0, $length ) . "...";
}
 
               
          
I want to know how to limit text length in fx. Latest News block?
Thanks