Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • asit Friend
    #131013

    In JA_NEWS, when the last character in a word before it is “chopped” with “…” and it is any of the Swedish characters å,ä or ö the Swedish character is displayed as a box, see the attached screenshot. As you can see Swedish characters is displayed correctly as long as it is not the last character displayed. Any ideas on if I can fix this easily?


    1. janews
    asit Friend
    #261108

    UPDATE: The problem is not just with the start page but also with the section blog layout. I am suspecting the function <?php echo $this->maxchar?$this->item->introtext1:$this->item->introtext; ?> of /html/com_content/section/blog_item.php to be the problem!?

    mjjjc556 Friend
    #262043

    I have same problem. Please advise about this thread.

    bossep Friend
    Sherlock Friend
    #263824

    Hi all !
    I’m checking the problem , asit , Please send me url of your site and admin account via pm , i want to look into your site to detect the problem.

    bossep Friend
    #263906

    Hello hainn,
    You can take a look at
    http://www.guatemala-times.com/jomtest2/
    This is a vanilla JA quickstart installation but with the second article in _FP changed to include
    some ä åö chars.
    I will pm you the login.

    Bosse

    Sherlock Friend
    #264043

    Hi bossep !
    I have detect the problem , i;m working with it.

    Sherlock Friend
    #264047

    Hi bossep !
    this is problem in smart trim of teline ii.now, ja News and JA news FP trim text following max number of character. it count number of character from 1-> max chars and trim at that position. if in that position there are character in “èééèäåöèééèäåö” it will appear error, because “èééèäåöèééèäåö” are characters with special symbol. each characters with special symbol includes 2 normal characters. example : “è” includes “e” and “f” ( ` ) . when trim those position causes missing special symbol so it will display error .

    asit Friend
    #264048

    Great news, do you have a solution for the problem? 🙂

    Sherlock Friend
    #264049

    JA developer is studying to solve the problem , but there is manual way for solve it , please change max chars of ja news and ja news Fp to it doesn’t trim to those position where has haracters with special symbol.

    bossep Friend
    #264118

    hello hainn and others,
    First of all thank you for the effort!
    I hope this will be solved soon. What I dont get is that it seems to have been solved in News_fp but not in
    News in version 1.4 and above.
    I have to little knowledge of php but I suspect that the trimmed sting gets returned in somthing else than utf-8.
    Could you also try the strip_tags() function together with trim? I do think it might help you to get a clean string.

    Bosse.

    bossep Friend
    #264337

    asit, hainn and others,
    I think I found the solution and sent it to hainn for review. But here it goes in short so it is documented.

    As hainn so correctly mentioned the “strange characters” are a pair so when cut the last gets garbeld.

    Solution 1. Find out if the string is odd or even in length if odd ad one character. This works fine on a plain string but if the string contain tags it doesent for some reason. Probably the closing tags with / is the problem here.
    I also noticed that the charcount get carbeled as well we get less characters as well if using the extended char set.

    A far better solution is to use mb_substr funktion instead of the substr funktion
    like this:
    <blockquote>
    //This dosent work
    $row->introtext1 = substr ($row->introtext1, 0, $maxchars) . “…”;
    //This does
    $row->introtext1 = mb_substr ($row->introtext1, 0, $maxchars) . “…”;
    </blockquote>

    The problem is that the mb_ library is not standard in PHP for some reason. So
    when using utf-8, as we should, most string funktions gets unpredictable.

    So this is NOT a JA bug it is PHP that is inconsitant. BUT there is solutions for it!

    Bosse

    bossep Friend
    #264367

    At least for me.
    I modifyed the modules=>mod_janews=>helper.php
    line 55 – 59 like this:


    if ($maxchars && strlen ($row->introtext) > $maxchars) {
    $row->introtext1 = mb_substr ($row->introtext1, 0, $maxchars,"utf-8") . "...";
    //$row->introtext1 = SmartTrim::trim($row->introtext, 0, $maxchars, $hiddenClasses);
    $row->introtext1 = str_replace('!@#!@#','<br />',$row->introtext1);
    }

    A varning the mdstring lib MUST be installed you could check this with a simple phpinfo test.
    The problem seems to be the SmartTrim that is not so smart after all…
    I dont want any formating on my front page but if you like that you shouls probably try to // out line
    53 like this //$row->introtext1 = strip_tags($row->introtext); (dident try that)

    All the best

    Bosse

    asit Friend
    #264369

    Great news Bosse, many thanks!

    Sherlock Friend
    #264432

    <em>@bossep 72259 wrote:</em><blockquote>At least for me.
    I modifyed the modules=>mod_janews=>helper.php
    line 55 – 59 like this:


    if ($maxchars && strlen ($row->introtext) > $maxchars) {
    $row->introtext1 = mb_substr ($row->introtext1, 0, $maxchars,"utf-8") . "...";
    //$row->introtext1 = SmartTrim::trim($row->introtext, 0, $maxchars, $hiddenClasses);
    $row->introtext1 = str_replace('!@#!@#','<br />',$row->introtext1);
    }

    A varning the mdstring lib MUST be installed you could check this with a simple phpinfo test.
    The problem seems to be the SmartTrim that is not so smart after all…
    I dont want any formating on my front page but if you like that you shouls probably try to // out line
    53 like this //$row->introtext1 = strip_tags($row->introtext); (dident try that)

    All the best

    Bosse</blockquote>

    Hi bossep !
    you are the best. but i think we must edit a small error . change red text to “$row->introtext”

Viewing 15 posts - 1 through 15 (of 19 total)

This topic contains 19 replies, has 5 voices, and was last updated by  migors 15 years, 8 months ago.

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