Recent Topics

1 Apr 09, 2015 22:40    

Hi

I try to make it possible for Registered users to allow commenting.

I have a blog with Advanced user permissions and registered users are Misbehaving/Suspect Users. This user group is not in the members section. I want to seperate registered and members.
So registered user may see community posts, and are allowed to comment, but not allowed to view member posts.

In the 'Blog' | Features | Comments | Feedback options I allow Comment posting by: Registered users only

But it is only possible to comment if the user groep is in Members of the blog.

Is there a solution to this?
b2evolution v.5.2.2

Regards

2 Apr 10, 2015 06:57

Hi @zebulon,

I will describe how I reproduced an scenario like the one that mentioned:

  1. comments__by_group shows how two different users see comments in front-office.
  2. The default status for new comments in that collection (b2evo > Structure > Blog A > Settings > Features > Comments Manual page > Comment moderation > New feedback status) is "Community".
  3. group__permissions is how Group perms have been set for that collection (not possible by default, see note below).

By definition, what I have done in step 3 is not possible because we can't assign any permission to users/groups without making them members of the collection. So, I manually edited the database to acomplish that set shown in the screenshot (Misbehaving/Suspect allowed to comment in Community status but not added as members). Just go to the table evo_bloggroups and look for the record that match blog_ID and group_ID, so update the value of is_member to 0.

There is also an ugly hack that may work to avoid constant manual database updates (any change that you make in the perms tab will reset is_member to 1), just go to the file inc/collections/model/_blog.funcs.php and replace this line (around 172):


$ismember = 1;	// Must have this permission

by this one:


$ismember = ( $loop_ID != 5 ) ? 1 : 0;	// Must have this permission

Replace the number 5 by the ID of the group that you want to keep as no member.

I haven't done more tests about the effects of this customization, so you can tell us how it's going. Also, you should consider to make a new group instead of using "Misbehaving/User" to assign by default to your registered users, because it is also used by other b2evo features (like spam detection, etc) to automatically restrict what users can do and what happen with them according their behaviour.

Regards!

comments__by_user
group__permissions
db_update

3 Apr 10, 2015 11:04

Hi @mgsolipa

Thank you very much for this info.

I have tried the database thing and it works as expected. I also think this is good enough for me in this case since it is only a small blog where there is not so much to change in the setup over time.

Its probably better to do the occational db edit than to edit the php file.

Thanks again.
Regards,
Ralf


Form is loading...