View Full Version : PHP page with my VB forum style
MadKad
07-21-2006, 09:42 AM
I want to add some pages to my forum for my VIP members, these pages need to be in php and I want to add the nav and footer etc etc from my forum style so it looks the same as the forum.
Please could some one help me in telling me what I would need to add to the php file page to do this :confused:
I have tried but just got confused :(
Thank you
Okay,
create a new php file (i named it mp3.php) contain the following:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'MP3'); // 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(
'mp3',
);
// pre-cache templates used by specific actions
$actiontemplates = array(
);
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
$navbits = array();
$navbits[$parent] = 'MP3 Home Page';
$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('mp3') . '");');
?>
change in the above code the $navbits[$parent] and also the name of the template which named above "mp3".
upload the file to the forum folder.
create a new template in any style and place in it :
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
WRITE YOUR HTML CODE HEAR !!!
$footer
</body>
</html>
call the php file www.yoursite.com/fourm/mp3.php
and enjoy :cool:
MadKad
07-21-2006, 12:59 PM
wow thanks, and thanks for your time I will give this a go now :D
peterska2
07-21-2006, 01:53 PM
You can also add to your file after // ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################
// Check for permission
if (!is_member_of($vbulletin->userinfo[usergroupid], array(5,6,7))
{
print_no_permission();
}to check if they have access to the page. Just add the usergroup ID's to the array of numbers for the groups that you want to have access to the page
MadKad
07-21-2006, 04:12 PM
wow thanks I was going to add that to the template but this seems better, thank you :D
ooops sorry I need to add a include in php to the page this is why I wanted to do the page in php, but as we are using this template
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
I need script here
$footer
</body>
</html>
Is there no way I could do the template withing the php script that way I can add the <?php include('file.php'); ?>
:confused: sorry
peterska2
07-22-2006, 10:08 PM
You can use the output of the php in the template. From example, in the index.php file which controls forumhome there are php variables defined for $onlineusersthis is then used in the forumhome template to display the output of this variable. As you do all your other stuff in the php file (as seen in post #2) before the templates part ie between// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## ##################### and$navbits = array(); then all the output can be used in the template.
MadKad
07-22-2006, 10:52 PM
:( I am lost, I amnot that great at php, all I know how to do is place html in php and include lol sorry
is there no way that i can add all this in the php code some how, so that it doesnt use a template but styles etc etc
like:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle]</title>
$headinclude
</head>
<body>
$header
$navbar
include('filename.php');
$footer
</body>
</html>
I cant do all the vars in php and stuff I have never been any good at them bits :(
peterska2
07-22-2006, 11:07 PM
in that case, you best bet is probably to create a modification request giving details of exactly what you want it to do and see if someone can make it for you.
MadKad
07-24-2006, 01:19 PM
ok thank you for your time :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.