MyBB Community Forums

Full Version: How to make a page member only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey,

I am making extra pages on my forum and I'd like some to be only seen by members and some by moderators or admins etc..

Does anybody know how I would go about making a page only accessible by certain groups?

Or if just registered then that's fine too

Thanks
Paste the following code just before your function's code;
if ($mybb->user['uid'] == "0")
{
   error_no_permission();
}
(2012-07-11, 06:58 PM)Yaldaram Wrote: [ -> ]Paste the following code just before your function's code;
if ($mybb->user['uid'] == "0")
{
   error_no_permission();
}

Thanks for the quick reply, however I get this error message when using that code:

Notice: Undefined variable: mybb in C:\wamp\www\Paster\members.php on line 48

Notice: Trying to get property of non-object in C:\wamp\www\Paster\members.php on line 48

Any clue how to fix?

Never mind, I have figured it out, I needed to include these lines at the top:

define("IN_MYBB", 1);
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";

Thanks for the help.
You don't need this lines:
require_once MYBB_ROOT."inc/functions_post.php";
require_once MYBB_ROOT."inc/functions_user.php";
require_once MYBB_ROOT."inc/class_parser.php";

Unless you need to use the parser and the _user/_post functions.