Vizionz
04-19-2007, 07:55 PM
First off i set this up on my forum heres the quote of what i set up
Ok ive seen that alot of people have been asking how to create new pages with the vbulletin style on them like i have used on forum.imaedia.com for the link/games etc pages, so ive decided to write this to tell everyone how to do it
Ok i usualy start by creating a basic template in the admin cp that i will use for all the pages that im going to add.
log into your admin cp go to styles and templates then go to the style manager and expand the style that you are currently using on the right of the page you will see a drop down menu, select add new template from it and then you need to name it
for this example im naming mine : "test"
now we need to create a very basic html template to go in this template:
ok so put the following into your temoplate and change the parts that say page name and page content to suit your needs :)
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
$headinclude </head> <body> $header $navbar
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="$stylevar[cellspacing]" class="all">
<thead>
<tr align="center">
<td align="left" valign="top" class="thead">
<div align="left"></div>
<div align="left">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="tcat">**********Test Page**********</td>
</tr>
<tr>
<td>********Page Content would go here :)**********</td>
</tr>
</table>
<font size="2"><font face="Verdana, Arial, Helvetica, sans-serif"></font></font></div></td>
<if condition="$vboptions[showmoderatorcolumn]"> </if> </tr>
</thead>
$forumbits
<tbody>
</tbody>
</table>
$footer
</body>
</html>
save the template.
The next step is to create the php file that will call the template,
Here is the code i used, to incldue the naviation and header/footer
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'yourscript');
// ################### 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(
'TEMPLATENAME'
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEMPLATENAME') . '");');
?>
rite now save that as a .php file, and upload it into your vbulletin root directory
then go to yourforumurl/pagename.php and you got yourself a non vb page with vb template on it
hope that helps post any questions, i prolli missed something or done something totaly wrong but hehe just trying to help :P
now that you understand where i am now i want to know how i could ad my own pho script to lie within that.
<?
require("config2.php");
$db->AddInt($songid);
$db->open("SELECT * FROM songlist WHERE ID = :songid");
$song = $db->row();
PrepareSong($song);
?>
<html>
<head>
<? require("req/request.java.php"); ?>
</head>
<table border=0 width="100%">
<tr><td align="center" valign="top" width="100%">
<div align="center"><center>
<table border="0" width="98%" cellspacing="1" cellpadding="2">
<? if(!empty($song["info"])){?>
<tr>
<td colspan="5"><img src="images/spacer.gif" width="15" height="13"></td>
</tr>
<tr>
<td align="center" colspan="5">
<p align="center"><b>Information</font></b></font>
</td>
</tr>
<tr>
<td align="center" colspan="5">
<p align="center"><b><? echo $song["info"]; ?></b></font>
</td>
</tr>
<?}?>
</table>
how could i add that script to my own page ? so when i call that custum page its actually reading the script i just posted
also need to call the membername outside vb how can i call the membername externally
Ok ive seen that alot of people have been asking how to create new pages with the vbulletin style on them like i have used on forum.imaedia.com for the link/games etc pages, so ive decided to write this to tell everyone how to do it
Ok i usualy start by creating a basic template in the admin cp that i will use for all the pages that im going to add.
log into your admin cp go to styles and templates then go to the style manager and expand the style that you are currently using on the right of the page you will see a drop down menu, select add new template from it and then you need to name it
for this example im naming mine : "test"
now we need to create a very basic html template to go in this template:
ok so put the following into your temoplate and change the parts that say page name and page content to suit your needs :)
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Cache-Control" content="no-cache" />
<!-- end no cache headers -->
<title><phrase 1="$vboptions[bbtitle]">$vbphrase[x_powered_by_vbulletin]</phrase></title>
$headinclude </head> <body> $header $navbar
<table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="$stylevar[cellspacing]" class="all">
<thead>
<tr align="center">
<td align="left" valign="top" class="thead">
<div align="left"></div>
<div align="left">
<table width="100%" border="0" cellpadding="3" cellspacing="0">
<tr>
<td class="tcat">**********Test Page**********</td>
</tr>
<tr>
<td>********Page Content would go here :)**********</td>
</tr>
</table>
<font size="2"><font face="Verdana, Arial, Helvetica, sans-serif"></font></font></div></td>
<if condition="$vboptions[showmoderatorcolumn]"> </if> </tr>
</thead>
$forumbits
<tbody>
</tbody>
</table>
$footer
</body>
</html>
save the template.
The next step is to create the php file that will call the template,
Here is the code i used, to incldue the naviation and header/footer
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'yourscript');
// ################### 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(
'TEMPLATENAME'
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
// ### ALL DONE! SPIT OUT THE HTML AND LET'S GET OUTA HERE... ###
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('TEMPLATENAME') . '");');
?>
rite now save that as a .php file, and upload it into your vbulletin root directory
then go to yourforumurl/pagename.php and you got yourself a non vb page with vb template on it
hope that helps post any questions, i prolli missed something or done something totaly wrong but hehe just trying to help :P
now that you understand where i am now i want to know how i could ad my own pho script to lie within that.
<?
require("config2.php");
$db->AddInt($songid);
$db->open("SELECT * FROM songlist WHERE ID = :songid");
$song = $db->row();
PrepareSong($song);
?>
<html>
<head>
<? require("req/request.java.php"); ?>
</head>
<table border=0 width="100%">
<tr><td align="center" valign="top" width="100%">
<div align="center"><center>
<table border="0" width="98%" cellspacing="1" cellpadding="2">
<? if(!empty($song["info"])){?>
<tr>
<td colspan="5"><img src="images/spacer.gif" width="15" height="13"></td>
</tr>
<tr>
<td align="center" colspan="5">
<p align="center"><b>Information</font></b></font>
</td>
</tr>
<tr>
<td align="center" colspan="5">
<p align="center"><b><? echo $song["info"]; ?></b></font>
</td>
</tr>
<?}?>
</table>
how could i add that script to my own page ? so when i call that custum page its actually reading the script i just posted
also need to call the membername outside vb how can i call the membername externally