MyBB Community Forums

Full Version: use php in custom pages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i am making a custom page. by using the tutorial on how to add custom pages. not using plug in either.

straight php and template.

i am trying to figure out how to get data from database and show it in the template.

i know how to use php in templates but i don't really want to do so. i want to do it in the php file and call it in the template file.

bump
any ideas?
nevermind figured it out.

now just to figure out how to show it to certain users would be nice.
<?php
define("IN_MYBB", 1);
require_once "global.php";
$allowedusergroups = array(4,5,6);
if(in_array($mybb->user['usergroup'], $allowedusergroups))
{
// These people can view it
}
else
{
// These people can't view it.
}
thanks i figured it was that.