Store
Community Documentation

v3 Knowledgebase

Join a page automatically upon registration

Phpfox doesn't have built in functionality to add a user to a page upon registration, but it's fairly simple to set up. This assumes that you have a single page that you want to add users to, and you don't have any other programming that would justify creating a new product.

1. Go to Extensions -> Create New Plugin
2. Leave the product as "Core" and select "Pages" for the module
3. Select "user.service_process_add_extra" from the dropdown list (maybe a third of the way through the list)
4. In the text box, put:

Phpfox::getService('like.process')->add('pages', <page ID>, $iId);

where <page ID> is the page you want users to join.

If you verify users' email before they can be active on your site, you'll want to revise the last two steps:

3. Select "user.component_verify_process_redirection" from the dropdown list (about 3/4 of the way through the list)
4. In the text box, put:

$iUserId = Phpfox::getLib('session')->get('cache_user_id');
Phpfox::getService('like.process')->add('pages', <page ID>, $iUserId);

where <page ID> is the page you want users to join.