-
AuthorPosts
-
alexsmirnov Friend
alexsmirnov
- Join date:
- July 2012
- Posts:
- 786
- Downloads:
- 1
- Uploads:
- 226
- Thanks:
- 226
- Thanked:
- 163 times in 119 posts
December 20, 2012 at 8:30 pm #183302Hi 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 ModeratorNinja Lead
- Join date:
- November 2014
- Posts:
- 16064
- Downloads:
- 310
- Uploads:
- 2864
- Thanks:
- 341
- Thanked:
- 3854 times in 3563 posts
December 21, 2012 at 9:52 am #477064You 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 Friendalexsmirnov
- Join date:
- July 2012
- Posts:
- 786
- Downloads:
- 1
- Uploads:
- 226
- Thanks:
- 226
- Thanked:
- 163 times in 119 posts
December 24, 2012 at 8:57 pm #477439sorry, I didn’t have any clues you’ve answered. I’ll play with your staff.
Cheers,
Alex
alexsmirnov Friendalexsmirnov
- Join date:
- July 2012
- Posts:
- 786
- Downloads:
- 1
- Uploads:
- 226
- Thanks:
- 226
- Thanked:
- 163 times in 119 posts
December 24, 2012 at 9:08 pm #477441Fantastic! Your code snippet did the job. I am all set now.
Cheers,
Alex
-
AuthorPosts
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