MyBB Community Forums

Full Version: custom error page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have this section for premium members only how would i make it so certain user groups get redirected to my custom page? and let the premium users pass into the forum and post threads.
Dont thinks that possible without plugins
Use is_member() function in your custom PHP page - e.g.:
if (is_member('X')) // replace X with allowed group ID - separate more than one group ID with comma
{
	//content of custom page
}
else
{
	error_no_permission();
}
Perhaps there is a plugin already made for your request, if not, I think you can use IF commands, but then you will need template conditionals plugin.

I see that SvePu and I did post at the same time. He did give you the code. BUT you will need template conditionals plugin to be able to use the if command
So where do I input that code I have the plugin already Here's the php code in the custom error pageĀ 
<?php 

define('IN_MYBB', 1); require "./global.php";

add_breadcrumb("Premium only", "premiumonly.php"); 

eval("\$html = \"".$templates->get("Premium_only_error")."\";"); 

output_page($html);

?>
Like this:
<?php 

define('IN_MYBB', 1); require "./global.php";
if (is_member('X')) // replace X with allowed group ID - separate more than one group ID with comma
{
add_breadcrumb("Premium only", "premiumonly.php"); 

eval("\$html = \"".$templates->get("Premium_only_error")."\";"); 

output_page($html);
}
else
{
error_no_permission();
}

?>