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.
to
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;
}