cmBB - Simple Content Management for phpBB

Read more - cmBB - Simple Content Management for phpBB

Read more

by alsthom » Mon Feb 04, 2019 7:17 pm

Hi
Where can I set how many characters are shown before the "read more" ?
Is the setting in ACP "Minumum content length " , for this purpose?
If it is, It doesn't change anything. No matter what I put there, only ~60 characters are shown and then comes the "read more"
Where can I change this?
Attachments
cmbb.jpg
alsthom
Registered User
Posts: 78
Joined: Fri Oct 05, 2012 5:19 pm
Contact:

Re: Read more

by Ger » Tue Feb 05, 2019 1:18 pm

It's in ./ext/ger/cmbb/cmbb/presentation.php, function character_limiter, parameter $n

It's limited to 300 as you can see there, but that does include resulting HTML (formatting, links, images, etc), and -probably more important in your case- it uses PHP's strlen().
You seem to have Greek texts, and strlen() appears to count bytes rather than characters. For most latin texts that's close to the same amount, but as it has UTF-8 text as input, it can easily result in double or more for the return value.

Since I only write (and am able to read) English and Dutch I haven't encountered this before. You might want to search and replace in this function:

Look for all appearances of strlen() and replace it with mb_strlen(). That might just do the trick.
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:

-Don't PM me for support-
User avatar
Ger
Registered User
Posts: 2108
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact:

Re: Read more

by alsthom » Tue Feb 05, 2019 4:45 pm

I couldn't find appearance of strlen() in this file ./ext/ger/cmbb/cmbb/presentation.php
I found something similar but I don't nothing for theese codes so I left it as it is :)

Code: Select all

if (strlen($str) < $n)
		{
			return $str;
		}
But I increased the number of 300 to 1000, so I have the desired result :)

Thanx for help
alsthom
Registered User
Posts: 78
Joined: Fri Oct 05, 2012 5:19 pm
Contact:

Re: Read more

by Ger » Tue Feb 05, 2019 5:11 pm

Yeah, those is what I meant
My extensions:
Simple CMS, Feed post bot, Avatar Resize, Modbreak, Magic OGP, Live topic update, Modern Quote, Quoted Where (GDPR) and Autoresponder.
Newest: FAQ manager for 3.2

Like my work? Buy me a coffee to keep it coming. :ugeek:

-Don't PM me for support-
User avatar
Ger
Registered User
Posts: 2108
Joined: Wed Jan 02, 2008 7:35 pm
Location: 192.168.1.100
Contact: