Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles

Reply
 
Thread Tools
How To New Pages in vb style
tomp
Join Date: Jan 2004
Posts: 78

 

England
Show Printable Version Email this Page Subscription
tomp tomp is offline 03-02-2004, 10:00 PM

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:

because im doing this quickly i just added any css i wanted to use onto this page instad of using the vbulletin css styles

ok so put the following into your temoplate and change the parts that say page name and page content to suit your needs

Code:
$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>
<style type="text/css">
<!--
.top {
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-top-color: #000000;
	border-right-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
}
.all {
	border: 1px solid #000000;
	background-color: #FFFFFF;
}
-->
</style>

$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

Code:
<?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
Reply With Quote
  #22  
Old 11-29-2004, 05:57 PM
Mokster Mokster is offline
 
Join Date: Sep 2004
Location: Toronto
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #23  
Old 11-29-2004, 06:18 PM
TheEnd's Avatar
TheEnd TheEnd is offline
 
Join Date: Mar 2003
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks a bunch.
I did EVERYTHING you said to do, but I get this

roster2.php
Code:
$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>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<!DOCTYPE html PUBLIC "-
Output in IE:
Code:
$headinclude $header $navbar **********Test Page********** 
********Page Content would go here ********** 
 
$forumbits  $footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<!DOCTYPE html PUBLIC "-
The PHP file is located in my /forums/ directory. Is that a problem? I am trying to get a page that I can use HTML on and update about once every week that is linked from my VB Index on VB 3.0.0 RC4. I want all the VB Index stuff surrounding it, but have where normally is news to be a clan roster.

I eventually want to have multipul styles so I don't want to half-*** it.
I attached an image of what i'm trying to do. There might be an easier way. And no, I don't want to have a forum for each page and post the roster in a forum and have VB Index read it. I want to fully HTML whats inside each block (eg. block= roster)

The problem:
roster2.php
Attached Images
File Type: jpg roster.jpg (45.8 KB, 0 views)
Reply With Quote
  #24  
Old 11-30-2004, 06:16 PM
TheEnd's Avatar
TheEnd TheEnd is offline
 
Join Date: Mar 2003
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, I got it working now. I copied it wrong. I edited it and it worked. Looks great!

Is there an easy way to get all the VB Index stuff on the side of the pages?
Reply With Quote
  #25  
Old 12-29-2004, 07:18 PM
GetGamer.com GetGamer.com is offline
 
Join Date: Jul 2004
Posts: 120
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to store my custom .php page in a non-forum directory?
Reply With Quote
  #26  
Old 12-30-2004, 01:25 AM
Tony G's Avatar
Tony G Tony G is offline
 
Join Date: Nov 2001
Location: Melbourne, Australia
Posts: 8,357
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't think so considering all vBulletin data is read within the main directory.
Reply With Quote
  #27  
Old 02-08-2005, 03:07 AM
Motoscene Motoscene is offline
 
Join Date: Feb 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am getting a white page as well. Not sure what I did wrong. I copyed and pasted everything you typed and changed the TEMPLATE NAME to the correct template I have added. Also I created a php file as well. Do I need to change anything else besides TEMPLATE NAME to make this work. Sorry I am very new at this. But edger to learn it. Thanks, Chain
Reply With Quote
  #28  
Old 02-08-2005, 05:34 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GetGamer.com
Is there a way to store my custom .php page in a non-forum directory?
yes.. add

chdir('/server/path/to/forum/directory');

after

define('THIS_SCRIPT', 'yourscript');


in the php file.
Reply With Quote
  #29  
Old 02-09-2005, 05:34 AM
Motoscene Motoscene is offline
 
Join Date: Feb 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well I am still having problems with this wo if anyone could help me out that would be great. I go ahead and tell you the way I uploaded it to my site.

First made the template (rules) in my styles. Also when I did that it placed it under custom templates. I sure that is right but one thing is that it is the only templete that looks tabed out????
Rules Template
Code:
$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>
<style type="text/css">
<!--
.top {
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-top-color: #000000;
	border-right-color: #000000;
	border-bottom-color: #000000;
	border-left-color: #000000;
}
.all {
	border: 1px solid #000000;
	background-color: #FFFFFF;
}
-->
</style>

$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>
And here is the php file that I made with notepad:
PHP Code:
<?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(
 
'rules'
 
);
 
 
// 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('rules') . '");');
 
 
 
?>
Reply With Quote
  #30  
Old 02-09-2005, 06:33 AM
Jolten Jolten is offline
 
Join Date: Mar 2004
Posts: 749
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

you don't mention what the problems are.
Reply With Quote
  #31  
Old 02-09-2005, 04:53 PM
Motoscene Motoscene is offline
 
Join Date: Feb 2005
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

oh sorry the problem is that I still get a white page like the others were getting. I not sure if I did all the code correctly.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04975 seconds
  • Memory Usage 2,342KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • postbit_attachment
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete