Want to create your very own vBulletin powered page which includes the header, footer, and the user permissions system as well?
Well now you can
Want to know how it will look? Take a look at the attached screenshot below!
Now includes the Who's Online modification! Also, instructions included on how to create your own pages that are integrated with current vBulletin files!
I'm going to give you a generic page but you can easily modify the contents of the page by changing the template
So here we go
Instructions:
Create a new file, whatever you want to call it (let's say test.php).
Open up test.php and add the following (replace TEST with whatever template you want to show):
PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'test'); // change this depending on your filename
// ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array(
);
// get special data templates from the datastore $specialtemplates = array(
);
// pre-cache templates used by all actions $globaltemplates = array( 'TEST', );
// pre-cache templates used by specific actions $actiontemplates = array(
Be sure to change 'TEST' to the actual template name, and change 'test' to the filename. Also, change 'Test Page' to whatever you want to show in the navbar, such as 'Viewing Member Profile' (just an example).
Now create the template, called TEST with the following content:
Replace 'xxx' with whatever you want ?do= in the query string to be (for example, replace 'xxx' with 'showprofile' so then someone would type in example.php?do=showprofile to view this template.) Then of course, change TEMPLATE_XXX to your template name, it's that simple!
2) How can I limit access to this page to only users in the usergroups 7, 8 and 9 ?
3) I have a php links script which I would like integrated into my forums in terms of the way it looks and the way only certain usergroups can access it. Can i use your hack to do this? If so, how I would I make a php page appear in the content area instead of the TEST template ???
Thanks again
1) correct
2) replace $bbuserinfo[usergroupid] == 6 with $bbuserinfo[usergroupid] == 7 or $bbuserinfo[usergroupid] == 8 or $bbuserinfo[usergroupid] == 9
3) Replace eval('print_output("' . fetch_template('TEST') . '");'); with your PHP stuff.
I just want to make a correctiion to your code:
You use if($bbuserinfo[usergroupid]. On vb3, there is a new is_member_of function, that will search your primary and secondary groups for that user. Here is how the code works with it.
PHP Code:
<?php
require_once('./global.php');
if ($_REQUEST[filename])
{
if (is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 7));
{
header("Location: $_REQUEST[filename]");
}
}
?>
that makes it so usergroup 6 5 and 7 can download that file.
I just want to make a correctiion to your code:
You use if($bbuserinfo[usergroupid]. On vb3, there is a new is_member_of function, that will search your primary and secondary groups for that user. Here is how the code works with it.
PHP Code:
<?php
require_once('./global.php');
if ($_REQUEST[filename])
{
if (is_member_of($bbuserinfo, 6) OR is_member_of($bbuserinfo, 5) OR is_member_of($bbuserinfo, 7));
{
header("Location: $_REQUEST[filename]");
}
}
?>
that makes it so usergroup 6 5 and 7 can download that file.
I like the idea of this, but looking around the Mod request pages, alot of people are looking for the last posts etc also to be displayed on a non vb page. I remember using something called API over at invision which was great. All you did was put includes in the page where you wanted specific things that were pulled from your board via templates which you could modify. Anyone know if something like this is going to be made? Gary W?
That works, but I discovered that you have to have the full URL for vbulletin_global.js and vbulletin_menu.js in the headinclude template. Otherwise the drop-down menus in the navbar will not work outside of the forum directory.