vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Community Lounge (https://vborg.vbsupport.ru/forumdisplay.php?f=13)
-   -   Use The Template? (https://vborg.vbsupport.ru/showthread.php?t=87587)

imported_Koopa 09-17-2003 04:09 PM

Use The Template?
 
I remember seeing a post explaining how to create pages using vB templates, does anyone else know where this post is etc.?

Thanks.

Zachery 09-17-2003 05:39 PM

it can be done quit simply. where it is im not sure

but there is a simple page creater that was released here

Tony G 09-18-2003 04:33 AM

Just use this code in a new file with the desired name.php.

PHP Code:

<?php
 
include("global.php"); 
eval(
"dooutput(\"".gettemplate('NAME OF TEMPLATE HERE')."\");");
 
?>

Then create a template in your ACP with the same name as you put in the code.

All credits to Brad.loo who gave me this code some time ago. :)

Brad 09-18-2003 04:47 AM

That only works on version 2 boards, you have to add some more stuff for version 3 boards.

Tony G 09-18-2003 04:51 AM

Yeah, sorry forgot to mention that. But since there wasn't an existing mod for vB3, I only assumed it was for vB2. :)

Zachery 09-18-2003 06:08 AM

acutally you dont hafta do much, just a change in the functions

change dir will let you put the file some where eles besides in the vbulletin root folder

PHP Code:

<?php
// ## Changes the Directory so it will work with vb ##
chdir("/fullpath/toforums");
// ## Calls a template from the users selected style ##
eval('print_output("' fetch_template('reviews') . '");');
?>


N9ne 09-18-2003 03:54 PM

Don't forget to require_once global.php :).

Zachery 09-18-2003 05:01 PM

omg lol i fogot :\ i was overly tired last night

Brad 09-18-2003 09:13 PM

This would be correct, you forgot to define your template cache's etc.

PHP Code:

<?php

// # Set up php error reporting...
error_reporting(E_ALL & ~E_NOTICE);

// # Define important var's
define('NO_REGISTER_GLOBALS'1);
// name of script
define('THIS_SCRIPT''script');
// allows us to use custom templates in this script
define('GET_EDIT_TEMPLATES'true);

// # Cache templates
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array(
                
'customtemplatename1',
                                
'customtemplatename2'
                        
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// # Get backend...
require_once('./global.php');

// $template output's customtemplate1
eval('$template = "' fetch_template('customtemplatename1') . '";');

// output's custometemplate2 (main template)
eval('print_output("' fetch_template('customtemplate2') . '");');


N9ne 09-19-2003 04:14 PM

Great stuff there Brad, very useful :).


All times are GMT. The time now is 07:06 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01084 seconds
  • Memory Usage 1,737KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete