By Troy Tolley on Monday, 23 June 2014
Posted in Groups
Replies 9
Likes 0
Views 1K
Votes 0
Is there a way to truncate Group Discussions as they show in both the Group Activity Stream and the main Activity Stream?

And can they show up as having some kind of formatting instead of as a jumble of words?

Thanks!
Hello Troy,

You can actually configure their truncation behavior by editing the apps at the back end of EasySocial under Applications. However, when truncation is in effect, we had to strip off the html codes to avoid any unclosed html tags (There's no proper way of truncating a html content because it's pretty tricky and often lead to unclosed html tags ).
·
Monday, 23 June 2014 09:49
·
0 Likes
·
0 Votes
·
0 Comments
·
Oh okay, I can understand the html stripping. I see the options under Groups - Discussions, then Stream already have it truncated to 250, but recent posts to the stream are far more than that, as you will see in the screencast
http://screencast.com/t/qGuKw5bhNp
·
Monday, 23 June 2014 19:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Troy,

I have temporarily added a hack for your site so that the discussions are truncated at 250 characters as we don't actually have a settings for this for the dashboard view now.
·
Monday, 23 June 2014 23:27
·
0 Likes
·
0 Votes
·
0 Comments
·
Oh, I see. Dashboard doesn't have its own settings for this, yet? That explains it. Thank you so much!! You guys rock. (I'm signing up for Flattr, by the way! I'm a giver, not just a taker! lol I appreciate you guys a lot.)
·
Tuesday, 24 June 2014 00:05
·
0 Likes
·
0 Votes
·
0 Comments
·
You are most welcome Troy
·
Tuesday, 24 June 2014 00:14
·
0 Likes
·
0 Votes
·
0 Comments
·
I lost this hack in the recent upgrade. May I have the instructions for how to affect this again for the main activity stream? A 50 word truncate would be excellent. Thanks!
·
Monday, 30 June 2014 12:01
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Troy,

Can you please try to replace the attached file here: ../media/com_easysocial/apps/user/discuss/discuss.php. If it doesn't helps, can you provide us your FTP so we add the hack for you? Please advise.
·
Monday, 30 June 2014 13:02
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi, Nik, thanks for doing this. There is no "discuss" folder in that path, though (not that I can see). I'm including ftp details here.

And just so I know, how many times do we have to add my FTP/Site Details? I've added them over and over again to the sidebar. Does our information not save for you guys to access? I've added it to this thread now, too. I just want to understand how that works.
·
Monday, 30 June 2014 20:48
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Troy,

I have updated the file /media/com_easysocial/apps/user/groups.php and at line 560 I have replaced the codes below,


private function formatContent( $discussion )
{
$content = $content = Foundry::string()->parseBBCode( $discussion->content , array( 'code' => true , 'escape' => false ) );

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

return $content;
}


With,


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;
}
·
Monday, 30 June 2014 23:43
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post