MyBB Community Forums

Full Version: Can I Do This
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello all is their away for me to make a page visible to staff and admins only??
which page ? is it a regular thread on the forum or is it a custom php page ?
If you mean a custom php page you can use this script in your_custom_page.php file
("your_custom_page" is an example for template or page name)

<?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("You do not have permissions to enter this page!");
}
?>
(2015-01-01, 02:45 AM).m. Wrote: [ -> ]which page ? is it a regular thread on the forum or is it a custom php page ?

Custom

(2015-01-01, 03:12 AM)SvePu Wrote: [ -> ]If you mean a custom php page you can use this script in your_custom_page.php file
("your_custom_page" is an example for template or page name)


<?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("You do not have permissions to enter this page!");
}
?>

Thanks