Hi, I already run a community with IPBoard and I'm moving to Flarum.
I have this setup for members and I'm trying to replicate but I can't figure how till now.
Members Setup
Not register, permission to only access to first post
Register, only access to a specific group member, permission same as "not register"
After first post , after first post is approved member move to general "Members" , general permission.
I already search for this solution but can't figure out to put in action.
I have "Approval", "First Post Approval" and "FOF Defaut Group".
Also, have this code on extend.php.
`(new Extend\Event)
// Add a user to a specific group after number of approved posts, requires flarum/approval.
->listen(\Flarum\Post\Event\Posted::class, function (\Flarum\Post\Event\Posted $event) {
$needsApprovedPosts = 1; // number of approved posts to add group to user
$addGroup = 3; // use the Id of the group you want to add
$adminGroup = 1;
$modGroup = 4;
$user = $event->post->user;
// Skip if user is already part of group
if ($user->groups->find($addGroup) !== null) return;
if ($user->groups->find($adminGroup) !== null) return;
if ($user->groups->find($modGroup) !== null) return;
if ($user->posts()
->where('is_approved', 1)
->whereNull('hidden_at')
->count() >= $needsApprovedPosts) {
$user->groups()->attach($addGroup);
}
}), `
Images
Thanks in advance for any support.