UPDATES EasyBlog 6.0.11 Released! Update to the latest version now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is online
Our support specialists is available now. We will attend to you as soon as we can.
  Support is online

Proper formatting for Twitter

Christopher Ambler · ·
8:46 AM Friday, 21 August 2020
Normal
The tag stripping made Twitter posts look terrible, so I changed the code. I'd love to see you guys do this in the next release so I don't have to keep replacing the code ;)

In short - change paragraph and break tags to newlines BEFORE stripping tags. This makes formatting correct.


// Replace the {introtext} tag

if (EBString::stristr($content, '{introtext}') !== false) {

$search[] = '{introtext}';

// Don't strip tags, so we can put newlines in for <p> and <br> elements first
$introText = $post->getIntro();

$introText = str_ireplace("<p>", "\n\n", $introText);
$introText = str_ireplace("<br>", "\n", $introText);
$introText = str_ireplace("<br/>", "\n", $introText);
$introText = str_ireplace("<br />", "\n", $introText);

// Now we can strip the tags, which will clean up the text

$introText = EBString::substr(strip_tags($introText), 0, 230) . JText::_('COM_EASYBLOG_ELLIPSES');

$replace[] = $introText;
}
The replies under this section are restricted to logged in users or users with an active subscription with us