Post by maxxpaul » Wed Aug 31, 2016 7:31 pm

Hello,
This would me my 2nd post (if it does appear). I've posted a couple of hours ago a nice (IMHO) solution to an older thread (for 1.5.6.4) but it did not show. That would have been my first post. How long it takes for new users to have their 1st post approved?
Thanks
Paul

Newbie

Posts

Joined
Wed Aug 31, 2016 5:53 pm

Post by villagedefrance » Wed Aug 31, 2016 8:45 pm

As soon as a forum moderator approves it.

This is required because we do get a lot of rubbish posts and nobody wants to see junk in the forums.

Now, we all (moderators) do this in our free time, so sometimes, sadly, it can be days before a post gets approved, especially if it is in a language we are not familiar with.

OpenCart custom solutions @ https://villagedefrance.net


User avatar
Active Member

Posts

Joined
Wed Oct 13, 2010 10:35 pm
Location - UK

Post by maxxpaul » Wed Aug 31, 2016 8:54 pm

Thank you villagedefrance.

Maybe the section I've posted to has a different moderator with a different time schedule. It's no problem.

Or maybe it was considered necro-posting? But there are still a lot of people using OC 1.5.6.4 (for example in may case, OC 2.x would not install on my hosting).

The thread I was posting to was: http://forum.opencart.com/viewtopic.php?t=43484

Essentially, my post was about replacing:

'description' => utf8_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 350) . '..',

with:
'description' => (strlen(utf8_decode(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))))> 350 ? mb_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, mb_strrpos(mb_substr(strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8')), 0, 350, 'UTF-8'), ' ', 0, 'UTF-8'), 'UTF-8') : strip_tags(html_entity_decode($result['description'], ENT_QUOTES, 'UTF-8'))) . '...',

So that the shortened (snipped) product descriptions in product list view would be truncated only to whole words...
I was so glad it worked for me, that I wanted to share this with the community.

Regards,
Paul

Newbie

Posts

Joined
Wed Aug 31, 2016 5:53 pm
Who is online

Users browsing this forum: No registered users and 17 guests