The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Include part of headinclude codes in other template
Hi.
I have a question. I want include part of headinclude template codes in other template (custom template). Because I have many js conflicts. I create home.php Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'home'); define('CSRF_PROTECTION', true); // 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('HOME', ); // pre-cache templates used by specific actions $actiontemplates = array(); // ######################### REQUIRE BACK-END ############################ // if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line // chdir ('/path/to/your/forums'); //require_once('./global.php'); $curdir = getcwd (); chdir('/home/acquarit/public_html/forums'); require_once('/home/acquarit/public_html/forums/global.php'); chdir ($curdir); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = construct_navbits(array('' => 'Test Page')); $navbar = render_navbar_template($navbits); // ###### YOUR CUSTOM CODE GOES HERE ##### $pagetitle = 'Acquaritalia'; // ###### NOW YOUR TEMPLATE IS BEING RENDERED ###### $templater = vB_Template::create('HOME'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); // global $vbulletin, $vbphrases, $show, $stylevar; include("/home/acquarit/public_html/forums/vblinklist/widgets/widget_linklist_stats.php"); // ?> Code:
<!DOCTYPE html> <html lang="{vb:stylevar languagecode}" > <head>....... <phpcode><![CDATA[global $vbulletin, $vbphrases, $show, $stylevar; include(DIR . "/vblinklist/widgets/widget_linklist_stats.php");]]></phpcode> {vb:raw header} {vb:raw headinclude} {vb:raw headinclude_bottom}.... </head> |
#2
|
|||
|
|||
I don't understand the question - can't you just replace {vb:raw headinclude} with whatever you want?
|
#3
|
|||
|
|||
Hi kh99.
I have some problems with js files. I use a script in all forum, that in my custom page (home template) causes js errors. I want exclude this script in home template, which is integrated with variable {vb:raw headinclude}. What I do? |
#4
|
|||
|
|||
OK, maybe something like this (in the headinclude template)
Code:
<vb:if condition="THIS_SCRIPT != 'home'"> Things that go in pages except home </vb:if> |
#5
|
|||
|
|||
Ok thanks.
Solved. I was trying to solve with javascript. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|