MyBB Community Forums

Full Version: Preventing guests from seeing certain pages?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I know this can be done using php, but can you make a hack because of which all guests have to signup/login in order to view certain files in the site? Not forums mind you.
I have the forums as the top level. Not like http://mysite.com/forums. It is like if you type http://mysite.com you go to the forums. So I cannot control people going to certain files. And I don't know php coding either.:neautral: So, can a hack like this be made?
The pages you want to restrict access too, are they MyBB pages or your own pages?
My own pages. Pages which I create using basic HTML - the only thing I knowSad
This would have to be done using php, simply by adding something like this to the top of your pages...

<?php
require './global.php';
if($mybb['uid'] == 0)
{
	nopermission();
}
?>

It's not really something I can write a mod for as it would have to be different for every individual site. Undecided

Note, the code above basically checks to see if the user is a guest (has an id of 0), and if so, outputs the MyBB "No Permissions" page.