cut word

Hello, thanks for sharing this nice module! I have a problem when a word is cut, probably with specific characters.
Any suggestion, please? Thank you!
10 years 1 month ago #1 by Fouli

Please Log in or Create an account to join the conversation.

  • Posted by TemplatePlazza (5310) Offline
Hi, can you try to open file /modules/mod_minifrontpage/helper.php with your favorite PHP editor , arround line 372 you will see this code :
$html = mb_substr($html, strlen($matches[0]));
change that to
$html = mb_substr($html, strlen(utf8_decode($matches[0])));
10 years 1 month ago #2 by TemplatePlazza

Please Log in or Create an account to join the conversation.

Thanks for the quick reply. This is already in helper.php!

$result .= $matches[1];
//$html = mb_substr($html, strlen($matches[0]));
$html = mb_substr($html, strlen(utf8_decode($matches[0])));
10 years 1 month ago #3 by Fouli

Please Log in or Create an account to join the conversation.

  • Posted by TemplatePlazza (5310) Offline
what about to change this code (at line 445):
$strip = mb_substr($strip, 0, $limit);
with this one
$strip = mb_substr($strip, 1, $limit, 'UTF-8');
can you try it?
10 years 1 month ago #4 by TemplatePlazza

Please Log in or Create an account to join the conversation.

I tried, but nothing.
While I have $strip = mb_substr($strip, 1, $limit, 'UTF-8'); ,
If I remove the slashes from the $html = mb_substr($html, strlen($matches[0]));
and put in $html = mb_substr($html, strlen(utf8_decode($matches[0])));
then everything works fine with greek characters but I lose the [...]
10 years 1 month ago #5 by Fouli

Please Log in or Create an account to join the conversation.

Hi,

I have the same problem.

This is already in helper.php [ $html = mb_substr($html, strlen(utf8_decode($matches[0]))); ]

If I change this code:
$strip = mb_substr($strip, 0, $limit);

with this one
$strip = mb_substr($strip, 1, $limit, 'UTF-8');

The problem now appears in another item.


Can you help me?

Regards
9 years 4 months ago #6 by VC

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum