vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How To New Pages in vb style (https://vborg.vbsupport.ru/showthread.php?t=88565)

tomp 03-02-2004 10:00 PM

How To New Pages in vb style
 
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

Ryan Ashbrook 03-03-2004 06:16 PM

Nice job, but I don't like the way you coded the PHP file, looks like you just threw it in there, un-organized so to speak.

But still good job. ^_^

MrNase 03-03-2004 07:06 PM

replace TEMPLATENAME with your template's name :) (it's 2 times on this file)

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') . '");');
 
 
 ?>


tomp 03-03-2004 08:05 PM

yea thats better hehe, alot nicer organised

MrNase 03-03-2004 09:53 PM

That's why i posted it ;)

Kier and his team made an amazing job in commenting all the functions and stuff you can find in that files so let's honor that work and use their comments :)

tomp 03-04-2004 06:09 AM

yea.....ill put that code into the first post aswell :)

Ryan Ashbrook 03-04-2004 06:20 PM

Now that is better! :) Nice job!

tomp 03-04-2004 09:47 PM

thanks, and thanks to MrNase too :)

hollyboy 05-12-2004 03:24 PM

white page seeing this



http://www.interfans.org/forum/rules.php

some of my members don't see this page. They get a white page.
Why?

JagFan 05-12-2004 03:39 PM

Thanks .. I really like this and have started using it!! :)


All times are GMT. The time now is 06:13 PM.

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.01181 seconds
  • Memory Usage 1,749KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete