MyBB Community Forums

Full Version: Making a plugin hidden from guests.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For instace, guests cant see my member list.

How would i apply the same to say the youtube video gallery plugin?

Any help greatful!
NO WORRIES!

I added :

if($mybb->usergroup['canviewmemberlist'] == 0)
{
	error_no_permission();
}

to the top of vgallery.php all sorted!
That, or you could use this:
if($mybb->user['uid'] == 0)
{
  error_no_permission();
}
(2009-01-22, 02:43 AM)RenegadeFan Wrote: [ -> ]That, or you could use this:
if($mybb->user['uid'] == 0)
{
  error_no_permission();
}

Where exactly would i put this,as i would also like to hide video-tube from guests, which line will it go in at, thanks in advance for any help
(2009-01-30, 06:14 AM)Adelaidebear Wrote: [ -> ]Where exactly would i put this...

This works...
General answer not tested on video-tube:
After:

require_once "./global.php";

Then you get the page inviting people to login or register.

#########

EDIT: ((( mistake fixed )))
FYI: To limit access to only one usergroup (ie. custom usergroup 10), this code seems to work well:

if($mybb->user['usergroup'] != 10)
{
  error_no_permission();
} 
You mean

if($mybb->user['usergroup'] != 10)
{
  error_no_permission();
}

to limit usergroups. 'uid' would only allow the user with UID 10 in.
(2009-01-30, 09:30 AM)MattR Wrote: [ -> ]You mean

if($mybb->user['usergroup'] != 10)
{
  error_no_permission();
}

to limit usergroups. 'uid' would only allow the user with UID 10 in.

Oops...
Thanks, Matt Blush

My attention to detail still needs to improve. Big Grin
Cheers all , now fixed and running. thanks for your help