2015-01-05, 05:23 PM
//Guests are not allowed to view the page
if ($mybb->user['usergroup'] == 1)
{
error_no_permission();
}
You can use this to block the page from guests (need to login)
//Guests are not allowed to view the page
if ($mybb->user['usergroup'] == 1)
{
error_no_permission();
}
(2015-01-05, 03:48 PM)ShadowOne Wrote: [ -> ](2015-01-05, 03:44 PM).m. Wrote: [ -> ]^ fine. I don't want to argue. BUT tested it once again on MyBB 1.8.3
<?php define("IN_MYBB", 1); require_once "global.php"; if (in_array($mybb->user['usergroup'] , array(1,7))) error_no_permission(); // Rest of code echo 'MyBB'; ?>
this time it worked
(2015-01-05, 05:23 PM)PhantomD Wrote: [ -> ]//Guests are not allowed to view the page if ($mybb->user['usergroup'] == 1) { error_no_permission(); }
You can use this to block the page from guests (need to login)
<?php
define("IN_MYBB", 1);
require("global.php");
if (is_member("1,7")){ //Insert usergroup IDs to deny them permissions to enter page
error_no_permission();
} else {
add_breadcrumb("YourCustomPage");
eval("\$your_custom_page = \"".$templates->get("your_custom_page")."\";");
output_page($your_custom_page);
}
?>
(2015-01-05, 07:45 PM)SvePu Wrote: [ -> ]If you are use a MyBB 1.8.x version you could try this:
<?php define("IN_MYBB", 1); require("global.php"); if (is_member("3,4,6")){ //Insert usergroup IDs to give them permissions to enter page add_breadcrumb("YourCustomPage"); eval("\$your_custom_page = \"".$templates->get("your_custom_page")."\";"); output_page($your_custom_page); } else { error_no_permission(); } ?>
(2015-01-05, 07:58 PM)SvePu Wrote: [ -> ]I have edited code ... pls try again
=> http://community.mybb.com/thread-165195-...pid1129878
<?php
define("IN_MYBB", 1);
require("global.php");
if (is_member("1,7")){ //Insert usergroup IDs to deny them permissions to enter page
error_no_permission();
} else {
add_breadcrumb("YourCustomPage");
eval("\$your_custom_page = \"".$templates->get("your_custom_page")."\";");
output_page($your_custom_page);
}
?>
(2015-01-05, 08:05 PM)SvePu Wrote: [ -> ]With this custom page code guests and banned users have no permissions to view the page. All other usergroups can enter page.
<?php define("IN_MYBB", 1); require("global.php"); if (is_member("1,7")){ //Insert usergroup IDs to deny them permissions to enter page error_no_permission(); } else { add_breadcrumb("YourCustomPage"); eval("\$your_custom_page = \"".$templates->get("your_custom_page")."\";"); output_page($your_custom_page); } ?>
(2015-01-05, 08:19 PM)SvePu Wrote: [ -> ]do you have the default mybb usergroup settings ( guest = gid1 ... etc)