MyBB Community Forums

Full Version: Hide custom pages from specific usergroups?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
How can I prevent usergroups to see my custom pages? So annoying when I see guests watching my awards or rules as I know they just leech them. So my custom pages are that they are in templates in global templates and the php file is in my forum root directory. What do I need to do in those templates to make them only hide for banned, guests and activation needed members?

Thank you.
if(!in_array($mybb->user['usergroup'], array(3,4))) //This condition would give no perms to all except group 3 and 4
{
error_no_permission();
}
Just for guests:

if($mybb->user['usergroup'] == 1)
{
error_no_permission();
}
For guests, this would be better suited:

if(!$mybb->user['uid'])
{
error_no_permission();
}
Sorry, I'm not great with PHP. I would just add that code after {$header} or where?
(2012-12-02, 10:00 AM)BccMac Wrote: [ -> ]Sorry, I'm not great with PHP. I would just add that code after {$header} or where?

You will have to add it to the php file/s for your custom page/s.
(2012-12-02, 12:43 PM)borbole Wrote: [ -> ]
(2012-12-02, 10:00 AM)BccMac Wrote: [ -> ]Sorry, I'm not great with PHP. I would just add that code after {$header} or where?

You will have to add it to the php file/s for your custom page/s.

Well that was obvious. I don't know where in that file should I place it.
(2012-12-02, 03:16 PM)BccMac Wrote: [ -> ]
(2012-12-02, 12:43 PM)borbole Wrote: [ -> ]
(2012-12-02, 10:00 AM)BccMac Wrote: [ -> ]Sorry, I'm not great with PHP. I would just add that code after {$header} or where?

You will have to add it to the php file/s for your custom page/s.

Well that was obvious. I don't know where in that file should I place it.

Well, the thing is that you didn''t post the link to the plugin or the code to your custom pages so we could tell you. We don''t read minds you know Big Grin
Anywhere after the global.php file is defined.
I try to prostats ,but not working Sad

Anybody???
Pages: 1 2