Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • evgen2011 Friend
    #171917

    Hello!
    Can someone please explain me how to modify Ja slidenews module so, that instead of max number of characters in introtexts there`d be possible to set maximum number of words. Introtexts look ugly with this kind of stuff at the end of words: �
    Thanks in advance for any information on my issue.

    evgen2011 Friend
    #430508

    I wish someone would help me with this. Auu! staff members where are you?

    bratis Friend
    #467968

    I have exactly the same problem. Can someone help us?

    bratis Friend
    #468070

    I found the solution!

    Edit the file helper.php in row 556 where you will see the code:

    function trimString( $title, $max=60 ){

    if( strlen($title) > $max ){
    return substr( $title, 0, $max ) . '...';
    }
    return $title;
    }

    and replace it with the following code:

    function trimString( $title, $max=60 ){

    if( strlen($title) > $max ){
    return JString::substr( $title, 0, $max ) . '...';
    }
    return $title;
    }

    I hope this helps you and all the others that have the same problem!

    MoonSailor Friend
    #468072

    Hi bratis,

    It caused the error at ending of words: � because your site is using UTF-8 strings. In this case, you can using function :
    [PHP]
    function utf8_substr($str,$start)
    {
    preg_match_all(“/./u”, $str, $ar);

    if(func_num_args() >= 3) {
    $end = func_get_arg(2);
    return join(“”,array_slice($ar[0],$start,$end));
    } else {
    return join(“”,array_slice($ar[0],$start));
    }
    }
    [/PHP]

    replaced by :
    [PHP]
    substr( $title, 0, $max )
    [/PHP]

Viewing 5 posts - 1 through 5 (of 5 total)

This topic contains 5 replies, has 3 voices, and was last updated by  MoonSailor 11 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum