By Sebastian on Sunday, 09 June 2013
Posted in General Issues
Replies 6
Likes 0
Views 1.1K
Votes 0
Hello,

we are using one part of EasyDiscuss for restricted private discussions. But the JomSocial-Integration don't care for the categories ACL-rectrictions.

How can I change the plugin, so that any kind of activity (new thread, new like, new reply, etc) to a specified category (in my case number 8) will not be added to the stream?
Hello Sebastian,

What you can do is to do something like this,


$category = DiscussHelper::getTable( 'Category' );
$category->load( $post->category_id );

if( $category->private != DISCUSS_PRIVACY_PUBLIC )
{
return false;
}


By the way, please do take note that your subscription has already expired. In order for you to continue receiving support, please consider renewing your subscription
·
Sunday, 17 November 2013 21:14
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey,
have you a solution for the problem already?

Would be great to be able to activate EasyDiscuss for the JomSocial-Stream again. But this will only work if I can exclude specific EasyDiscuss-Categories from being posted in the stream ...
·
Sunday, 17 November 2013 02:24
·
0 Likes
·
0 Votes
·
0 Comments
·
I am sorry but unfortunately we have not added this yet.
·
Sunday, 17 November 2013 03:09
·
0 Likes
·
0 Votes
·
0 Comments
·
But it can't be so difficult doing this manually I guess? I don't need a fancy frontend checkbox, only a workaround.

If I look at the helper.php I get:


if(! empty($posts) > 0)
{
$model = JModel::getInstance( 'Posts' , 'EasyDiscussModel' );

for($i = 0; $i < count($posts); $i++)
{
$row =& $posts[$i];

// Set post owner
$owner = DiscussHelper::getTable( 'Profile' );
$owner->load($row->user_id);

if ( $row->user_id == 0 )
{
$owner->id = 0;
$owner->name = 'Guest';
}
else
{
$owner->id = $row->user_id;
$owner->name = $owner->getName();
}
[...]


I guess I only need a second if for checking if the new post has the right category id? But how can I include a category-check into the helper.php?
·
Sunday, 17 November 2013 03:19
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Sebastian,

Not too sure which version of EasyDiscuss are you currently at but you should be adding the private category checks in /components/com_easydiscuss/helpers/jomsocial.php

The main reason that we don't include it is not that it's difficult to do but it eventually will lead up to more support queries as to why their stream items are not being generated on JomSocial
·
Sunday, 17 November 2013 04:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Ah, thanks. I looked at /plugins/community/easydiscuss/easydiscuss/helpers.php


Hmm, would be great if I had any idea how .php works

I will try things like

if( $post->category_id == 1 )
{
return false;
}

at random positions in the code, maybe it will do something or even prevent category_id 1 from being displayed. ^^

If anyone has a better plan or even an idea how to change it - I'm looking forward to it
·
Sunday, 17 November 2013 04:43
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post