-
AuthorPosts
-
asit Friend
asit
- Join date:
- May 2008
- Posts:
- 16
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
July 18, 2008 at 7:07 am #131013In 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?
asit Friendasit
- Join date:
- May 2008
- Posts:
- 16
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
July 21, 2008 at 8:30 am #261108UPDATE: 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!?
July 24, 2008 at 4:05 pm #262043I have same problem. Please advise about this thread.
bossep Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
July 24, 2008 at 8:54 pm #262094This is also posted in:
http://www.joomlart.com/forums/topic/ja-elastica-modules-in-position7-under-content-with-sobipro/#post-262083Bosse
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 5, 2008 at 3:01 am #263824Hi 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 Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
August 5, 2008 at 3:36 pm #263906Hello 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 FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 6, 2008 at 7:36 am #264043Hi bossep !
I have detect the problem , i;m working with it.Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 6, 2008 at 8:09 am #264047Hi 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 Friendasit
- Join date:
- May 2008
- Posts:
- 16
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
August 6, 2008 at 8:11 am #264048Great news, do you have a solution for the problem? 🙂
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 6, 2008 at 8:13 am #264049JA 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.
1 user says Thank You to Sherlock for this useful post
bossep Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
August 6, 2008 at 3:11 pm #264118hello 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 Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
August 7, 2008 at 3:28 pm #264337asit, 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 Friendbossep
- Join date:
- April 2008
- Posts:
- 262
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 50
- Thanked:
- 15 times in 3 posts
August 7, 2008 at 7:50 pm #264367At 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 Friendasit
- Join date:
- May 2008
- Posts:
- 16
- Downloads:
- 0
- Uploads:
- 2
- Thanks:
- 3
- Thanked:
- 1 times in 1 posts
Sherlock FriendSherlock
- Join date:
- September 2014
- Posts:
- 11453
- Downloads:
- 0
- Uploads:
- 88
- Thanks:
- 221
- Thanked:
- 2478 times in 2162 posts
August 8, 2008 at 4:12 am #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”1 user says Thank You to Sherlock for this useful post
AuthorPostsThis topic contains 19 replies, has 5 voices, and was last updated by migors 16 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum