test
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • 321fly Friend
    #179614

    Hi I faced wrong symbols displaying from the beginning. I have that symbol — � in several modules as I guess. Because changing Ja Slidecontnent.ini to UTF-8 could help with ������ change to cyrilllic “Подробнее” which is “Read more” in Russian.
    Here is the code, probably its.ini file I have to change to UTF-8. How can I retrieve the .ini?
    Maybe you can give another idea how to display cyrillic script correctly. That happens ONLY to titles and subtitles when displayed SHORTENED on main page and ONLY in some modules like JA-slidecontent. Usually after you go to the article it is ok. As I guess I wiil have to change title and subtitle display options for JA-slidecontent. Correct me if I miss something.

    Regards,
    Here is an example of code displayed:

    <a class="ja-title" href="/index.php/heartland/item/238-name-of-the-article-in-cyrillic">text-in-cyrillic-Да-это-текст-and-wrong-symbol�...</a>

    <a class="ja-title" href="/index.php/epigrammatrix">text-in-cyrillic-Да-это-текст-and-wrong-symbol�...</a>

    321fly Friend
    #463032

    Also there’s no module Ja-title, it’s a class:laugh:. If so could you also tell which module is responsible for showing heading and subtitles?

    Ninja Lead Moderator
    #463148

    Please send back to me exactly what module name was missing? I will give solutions to you about cut string on title.

    321fly Friend
    #463220

    Hi again, still have same problem with � symbols in shortened titles. As you can see in attachment
    It happens to ACCORDION and does not appear in UPCOMING RELEASES. Also it comes with WHY PICK US.


    1. wrong_symbols_in_titles
    Ninja Lead Moderator
    #463269

    WHY PICK US is JA Side News module
    Open modules/mod_jasidenews/helper.php
    Find trimString function

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

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

    change to

    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 ='';
    }
    }

    321fly Friend
    #463326

    Thnx Ninja Lead, I changed lines for trimString function in file modules/mod_jasidenews/helper.php
    Problem almost solved:
    that was before<
    that is after, it helped and there are no more � except one on the right. See attachment.
    accordion is ok now.

    In case there is code from helper.php from side
    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 ='';
    }
    }

    And BTW — I tried to save helper.php in UTF-8 hoping it would help. In fact will it work?(!)
    P.S.> JAT3 Cache has been cleaned


    1. before
    2. after
    3. accordion
    321fly Friend
    #463338

    <em>@321fly 333232 wrote:</em><blockquote>
    that is after, it helped and there are no more � except one on the right. See attachment. </blockquote>
    The item which still had the odd symbol in JA Side News, had had a dash in its title.
    I renamed it using underscore (_) instead of the dash and same result. Then I removed the dash at all keeping only letters in title.
    Reconfigured Ja Side News for “Why Pick Us” setting title max length: 40, description: 70
    And it works even with dashes etc! Thanks for decision Ninja Lead!

    Ninja Lead Moderator
    #463352

    Ok, great job

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

This topic contains 8 replies, has 2 voices, and was last updated by  Ninja Lead 12 years, 4 months ago.

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