MyBB Community Forums

Full Version: limit to guest on custom page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
hi guys
im creating a custom page wich contains for example radio
but i wanna show this page only to members
could anyone please tell me which codes should be added
thank you so much
If your using Page Manager to make your pages, use this code:

<?php
if (!$mybb->user['uid'])
	error_no_permission();

//Your Content Here

?>
tnx for reply
no i dont
just simple php pages in root
i think i should call some database tables but i dont know how
Ok, if your making php pages in the root, then use the same method as i posted above.
it gives some error

( ! ) Notice: Undefined variable: mybb  ....on line 2

( ! ) Notice: Trying to get property of non-object in  ....on line 2

( ! ) Fatal error: Call to undefined function error_no_permission() ...on line 3

also i made a mistake by saying files are in root

actually i created a folder and files are in there
You need learn a bit of PHP!
Check this: http://www.php.net
thanks you helped me a lot javier Dodgy
i just new with mybb and dont know how this system works
so i asking you guys help
i will figure it by myself on free time
okay, change of plan. Just use page manager.
You'll need to add this above Everett's code Smile
include "path-to-mybb-/inc-folder/global.php";
global $mybb;
Nice posting..
Pages: 1 2