By Steve on Tuesday, 28 October 2014
Posted in General Issues
Likes 0
Views 579
Votes 0
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;
}
Looks like we have already applied a patch internally. Download the attached file and upload it into /media/com_easysocial/apps/user/groups/
·
Tuesday, 28 October 2014 00:58
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark, thanks for your quick reply.

This wont work, its truncated in groups view but doesn't in dashboard. Same as before.
·
Tuesday, 28 October 2014 01:03
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Steve,

This will actually truncate stream items for group discussions that appears on the dashboard.
·
Tuesday, 28 October 2014 01:35
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark, yes that is excatly what i want. But your attachment groups.php wont fix that.
·
Tuesday, 28 October 2014 02:03
·
0 Likes
·
0 Votes
·
0 Comments
·
hello Steve,

Sorry for late reply to this,
I have tested in my locally with the latest version of EasySocial, it should get truncate from the dashboard. Check my screenshot below.

May i know did you have any customization in your Easysocial site? If yes, can you do the backup so that we can perform an installation in your site and make sure every file is original?

And because you have APC on your site, we cannot proceed to debug on your site as any modification from FTP won't take effect. Is it possible for you to temporarily disable APC?
·
Wednesday, 29 October 2014 17:07
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Arlex

No, i don't have any customizations only in css to get quote from forums as this is a test site where i testing ES updates and other stuff before implement them to the main site. I have disabled APC now you can do there whatever you like!

Also all files there are original, lately updated to ES 1.3.10, only few files replaced with ES support fixes.
·
Wednesday, 29 October 2014 19:55
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Steve,

The reason it is not truncating is simply because you did not enable truncation for this in the User - Groups application as you can see here, http://screen.stackideas.com/2014-10-30_0032.png

I have set this to 250 characters now and it is truncating correctly.
·
Thursday, 30 October 2014 00:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Mark, thank you,

I did not noticed that setting before.

Now everything works like a charm.
·
Thursday, 30 October 2014 01:00
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Steve,

You're welcome.
·
Thursday, 30 October 2014 02:33
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post