Since vBulletin 5 has the site builder which easily enables you to add new pages to your site, you may want to add your own custom permissions to those pages. First you will need to create a new page with the site builder. To add permissions to this page directly you will need to select the PHP module.
Place the PHP module(s) on your page and position them where you like. In this example I'll just check whether the user is logged in or not. If they are then I will echo Hello {username} and if not I'll echo a simple no permission message.
In PHP Module:
If you wanted to add multiple usergroups you could add extra conditions to the statement, for example:
Here are some screenshots...
Logged In:
Logged Out:
I hope this is helpful to someone. It may be small, but very useful.
Place the PHP module(s) on your page and position them where you like. In this example I'll just check whether the user is logged in or not. If they are then I will echo Hello {username} and if not I'll echo a simple no permission message.
In PHP Module:
PHP Code:
if (vB5_User::get('usergroupid') == 1)
{
echo 'You do not have permission to access this page.';
}
else
{
echo 'Hello, ' . vB5_User::get('username');
}
If you wanted to add multiple usergroups you could add extra conditions to the statement, for example:
PHP Code:
if (vB5_User::get('usergroupid') == 1 OR vB5_User::get('usergroupid') == 2)
{
// Do whatever...
}
else
{
// Do whatever else...
}
Here are some screenshots...
Logged In:
Logged Out:
I hope this is helpful to someone. It may be small, but very useful.