UPDATES EasyBlog 6.0.14 Released! Joomla 5.x and PHP 8.x compatible 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 offline
It is currently off working hours and most of us aren't around

Rest assured that we will get back to you as soon as the day starts tomorrow!
  Support is offline

Group discussion not truncated in dashboard

Steve · ·
12:47 AM Tuesday, 28 October 2014
None
Hello

Is there any way to truncate group discussions for dashboard in easy way, not to hack core files?

For example, if i look to the discussion direct trought group, it is truncated but in dashbord it is not truncated. Found this hack Mark mentioned in other topic. If i set it it works very well in dashboard. This is probabbly a bug, as the content is not truncated in dashboard.

private function formatContent( $discussion )

{

// Get the app params so that we determine which stream should be appearing

$app = $this->getApp();

$params = $app->getParams();



$content = FD::string()->parseBBCode( $discussion->content , array( 'code' => true , 'escape' => false ) );



// Remove [file] from contents

$content = $discussion->removeFiles( $content );



$maxlength = $params->get('stream_discussion_maxlength', 250);

if ($maxlength) {

// lets do a simple content truncation here.

$content = strip_tags($content);

$content = strlen($content) > $maxlength ? JString::substr($content, 0, $maxlength ) . JText::_('COM_EASYSOCIAL_ELLIPSES') : $content ;

}



return $content;

}


to

private function formatContent( $discussion )
{
// Reduce length based on the settings
$params = $this->getParams();
$max = 250;
$content = $discussion->content;

if ($max != 0) {
$content = JString::substr($discussion->content, 0, $max) . JText::_('COM_EASYSOCIAL_ELLIPSES');
}

// Remove code blocks
$content = Foundry::string()->parseBBCode( $content , array( 'code' => true , 'escape' => false ) );

// Remove [file] from contents
$content = $discussion->removeFiles( $content );

return $content;
}
The replies under this section are restricted to logged in users or users with an active subscription with us