Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • alexsmirnov Friend
    #183302

    Hi there,

    I’ve found discussion at http://www.joomlart.com/forums/topic/ja-content-slider-and-not-eglish-language/ very relevant to my issue but could not figure out what the solution is.

    At my joomalex.com/ru you may see exactly with the issue is: if you go to the Russian side of my site (just click the Russian flag) the JA Newsticker module outputs question marks in rombs at the end of the titles.

    Does this issue relate to my template or to the hosting configuration?

    Please advise.

    ————————————————-

    I am running JA Teline IV on Joomla 2.5.8,

    Ninja Lead Moderator
    #477064

    You can try this way
    <blockquote>Open modules/mod_janewsticker/helper.php file</blockquote>

    public static function trimString($title, $max = 60)
    {
    if (strlen($title) > $max) {
    return substr($title, 0, $max) . '...';
    }
    return $title;
    }

    change to

    public static function trimString($title, $max = 60)
    {
    if($title!=''){
    if(is_array($title)) list($string, $match_to) = $title;
    else { $string = $title; $match_to = $title{0}; }

    $match_start = stristr($string, $match_to);
    $match_compute = strlen($string) - strlen($match_start);

    if (strlen($string) > $max)
    {
    if ($match_compute < ($max - strlen($match_to)))
    {
    $pre_string = substr($string, 0, $max);
    $pos_end = strrpos($pre_string, " ");
    if($pos_end === false) $string = $pre_string."...";
    else $string = substr($pre_string, 0, $pos_end)."...";
    }
    else if ($match_compute > (strlen($string) - ($max - strlen($match_to))))
    {
    $pre_string = substr($string, (strlen($string) - ($max - strlen($match_to))));
    $pos_start = strpos($pre_string, " ");
    $string = "...".substr($pre_string, $pos_start);
    if($pos_start === false) $string = "...".$pre_string;
    else $string = "...".substr($pre_string, $pos_start);
    }
    else
    {
    $pre_string = substr($string, ($match_compute - round(($max / 3))), $max);
    $pos_start = strpos($pre_string, " "); $pos_end = strrpos($pre_string, " ");
    $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
    if($pos_start === false && $pos_end === false) $string = "...".$pre_string."...";
    else $string = "...".substr($pre_string, $pos_start, $pos_end)."...";
    }

    $match_start = stristr($string, $match_to);
    $match_compute = strlen($string) - strlen($match_start);
    }

    return $string;
    }else{
    return $string ='';
    }
    }

    Let me know if it helps

    alexsmirnov Friend
    #477439

    sorry, I didn’t have any clues you’ve answered. I’ll play with your staff.

    Cheers,

    Alex

    alexsmirnov Friend
    #477441

    Fantastic! Your code snippet did the job. I am all set now.

    Cheers,

    Alex

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

This topic contains 4 replies, has 2 voices, and was last updated by  alexsmirnov 11 years, 11 months ago.

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