vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)

BirdOPrey5 07-06-2011 01:45 AM

Quote:

Originally Posted by Boofo (Post 2217258)
Well, yes and no. Since I did it in the forumhome_start hook, it needed those pre-registered for my new template. As long as the variables are good at that hook, then it will work the way I did it.

The forumhome doesn't care about the old template as long as I pre-register everything for my new template. Doing it in the parse_templates hook might be why it didn't work for you with your code. You would have to check whether whatever variables you are pre-registering have already been validated at whatever hook you are using.

Now I'm getting confused. And it hurts! LOL

Don't be confused- the important thing is it works and all is well. :up:

EquinoxWorld 07-08-2011 04:38 PM

Hello everyone, I have been reading this article over and over again trying to figure out what I am doing wrong. Basically I am trying to put the contents of one template into another using a plug in. The template in question are:

-OFTW
-COFTW_FAQ

I want to be able to put the contents of template COFTW_FAQ into a variable that I can then use in OFTW template. I am using a script (oftw.php) which uses the OFTW template; I need to be able to insert the contents of COFTW_FAQ into that template using a plug-in. So this is what I have so far:

Plug-in 1: Hook: Global Start

PHP Code:

$templater vB_Template::create('COFTW_FAQ'); 
    
$templater->register('oftw_faq'$oftw_faq); 
$mytemplate_rendered $templater->render(); 

Plug-in 2: Hook: Global Start

PHP Code:

$templater vB_Template::create('OFTW'); 
    
$templater->register('COFTW_FAQ'$mytemplate_rendered); 
$mytemplate2_rendered $templater->render(); 

And I am using the following variable to call the contents of COFTW_FAQ into OFTW template:

Code:

{vb:raw COFTW_FAQ}
With no avail; I get a blank where the content of the variable should be. Any ideas what I am doing wrong anyone??

Please Help I have been hitting myself in the head for the last 4 hours! :(

--------------- Added [DATE]1310166367[/DATE] at [TIME]1310166367[/TIME] ---------------

UPDATE!!!

After more thinking... I can see that I was a bit off, I am now using only plug in to try and accomplish what I want but still just blank...

Hook Location: Process Templates Complete
PHP Code:

$templater vB_Template::create('OFTW_FAQ');
$oftw_faq $templater->render();
vB_Template::preRegister('OFTW',array('oftw_faq ' => $oftw_faq)); 

Using: {vb:raw oftw_faq} in the OFTW template but still nothing... Am I getting closer??? :(

--------------- Added [DATE]1310224935[/DATE] at [TIME]1310224935[/TIME] ---------------

GOT IT!!! FINALLLLY!!!!! xD

I had to just register my variable in the actual oftw.php file . Since it was a custom page the script did not have the variable registered so I added
PHP Code:

$templater->register('oftw_faq'$oftw_faq); 

to the oftw.php file and added the last plug-in above and voila! Perfect!! This opens up a whole new world for me. :) Anywho, just thought i'd share my conquering :)

cellarius 07-11-2011 05:34 AM

Congrats - good to see you got it working :D

BirdOPrey5 07-11-2011 12:19 PM

Quote:

Originally Posted by EquinoxWorld (Post 2218222)
Hello everyone, I have been reading this article over and over again trying to figure out what I am doing wrong. Basically I am trying to put the contents of one template into another using a plug in. The template in question are:

-OFTW
-COFTW_FAQ

I want to be able to put the contents of template COFTW_FAQ into a variable that I can then use in OFTW template. I am using a script (oftw.php) which uses the OFTW template; I need to be able to insert the contents of COFTW_FAQ into that template using a plug-in. So this is what I have so far:

Plug-in 1: Hook: Global Start
...

As has been mentioned here before global_start is a bad hook to use in VB4. It was included for compatibility with older mods and is expected to be removed at some point- you can't count on it existing in non-forum parts of the site.

global_bootstrap_init_start should be used instead of global_start in most circumstances.

EquinoxWorld 07-11-2011 07:17 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2219273)
As has been mentioned here before global_start is a bad hook to use in VB4. It was included for compatibility with older mods and is expected to be removed at some point- you can't count on it existing in non-forum parts of the site.

global_bootstrap_init_start should be used instead of global_start in most circumstances.

For rendering template and such which is the most recommended then? I'm assuming "process_template_complete" ? Or does it depend on each case?

Adrian Schneider 07-11-2011 07:23 PM

If you are going to assign several variables in a row, you may want to use the quickRegister function, as it is a lot more readable and clear what is happening (IMO).

PHP Code:

$page vB_Template::create('xxx_newpost');
$page->quickRegister(array(
    
'newpost'        => $newpost,
    
'messagearea'    => $messagearea,
    
'editorid'       => $editorid,
    
'prefix_options' => fetch_prefix_html($foruminfo['forumid'], $newpost['prefixid'], true),
    
'tagcloud'       => prepare_tagcloudlinks(prepare_tagcloud('usage')),
    
'faqs'           => xxx_fetch_faqs('vb3_board_usage'),
    
'topics'         => xxx_fetch_topics(),
    
'strategies'     => xxx_fetch_strategies($parentId),
    
'moderators'     => xxx_fetch_moderators(),    
)); 


BirdOPrey5 07-11-2011 08:32 PM

Quote:

Originally Posted by EquinoxWorld (Post 2219417)
For rendering template and such which is the most recommended then? I'm assuming "process_template_complete" ? Or does it depend on each case?

it depends where the template will be needed, if it will only be on showthread than one of the showthread hooks... but if it might be called anywhere than process_templates_complete or parse_templates seem to work. I don't know if one is better than the other.

cellarius 07-12-2011 04:01 AM

As a general rule: Use a hook that is only called where you need the variable. Normally, you execute code before registering to get the values, and you want to run that only if it's needed. Of course, using stuff like if THIS_SCRIPT will do the job, too.

Murtific 07-20-2011 01:44 AM

i learned how to make custom templates like this. I have a variable that i want to be able to use on the header on every page in vbulletin. I cant get it to save my variable globaly tho. I'm only able to use this var within the template. I read the part where it talked about Save into an array and preregister to use in an existing/stock template. but could not get it to work. by the way, I have no idea how to show code on here

Code:

$eventlist = mysql_query("SELECT * FROM thread WHERE forumid = 8 ORDER BY dateline DESC", $connection);
if (!$eventlist) {
die("Database selection failedquery:SEEPASSWORD: " . mysql_error());
}
while ($row = mysql_fetch_array($eventlist)) {
$zthreadid .= $row["threadid"];
$zdateline .= $row["dateline"]."<br />";
$zlink .= "<a href='showthread.php?{$row["threadid"]}'>" . $row["title"]."</a>" . "<br />";
}

$templater = vB_Template::create('threads');
$templater->register('zthreadid', $zthreadid);
$templater->register('zlink', $zlink);
$templater->register('zdateline', $zdateline);
$zlink2['$zlink'] = $templater->render();
vB_Template::preRegister('header',array('zlink2' => $zlink2));

In the stock header template I put {vb:raw zlink2} but its not showing up. Although in the template I created it displays fine due to the fact that I copied the entire header template and stuck it in my template instead of calling {vb:raw header} in my custom template. Any ideas???

HMBeaty 07-20-2011 01:49 AM

Quote:

Originally Posted by Murtific (Post 2222691)
by the way, I have no idea how to show code on here

Just paste your code you're using inside code/html/php tags. For example:

[code.]your code here[./code]
Would be
Code:

your code here
[php.]your code here[./php]
Would be
PHP Code:

your code here 

[html.]your code here[./html]
Would be
HTML Code:

your code here
Obviously without the "." in the tags though :)

Murtific 07-20-2011 02:53 AM

Quote:

Originally Posted by HMBeaty (Post 2222694)
Just paste your code you're using inside code/html/php tags. For example:

[code.]your code here[./code]
Would be
Code:

your code here
[php.]your code here[./php]
Would be
PHP Code:

your code here 

[html.]your code here[./html]
Would be
HTML Code:

your code here
Obviously without the "." in the tags though :)

Thanks, got it. Now back to my previous post, anybody have any ideas?

BirdOPrey5 07-20-2011 11:34 AM

What hook is your code on?

Murtific 07-20-2011 02:32 PM

what's a hook? I dont have a hook. I ended up just doing this. I basically just added my database code to the forum.php file and got it to work, but i have to modify every template like I mentioned in this thread, i'd rather use this thread https://vborg.vbsupport.ru/showthread.php?t=267120

kh99 07-20-2011 03:20 PM

Quote:

Originally Posted by Murtific (Post 2222873)
what's a hook? I dont have a hook. I ended up just doing this. I basically just added my database code to the forum.php file and got it to work,

[S]That's probably the issue - if you put it in after global.php, it's too late to affect the header[/S]. (Edit: actually that's wrong, I think you have until another template is rendered, so what you did could have worked, but try it with a plugin anyway.)

See my post in the other thread.

Dave-ahfb 07-23-2011 04:36 PM

First let me say that I am not PHP literate, but can find my way around 9 times out of 10.

I am creating custom templates to include my non vb scripts but am having troubles when trying to include a variable(?) from this script in any template outside the main body.

I will try to be as detailed as possible, hopefully any responses will include the information I give as a real life example so that I can get an understanding of what was done.


Goal: to take $companyname from the below script and add it to my page title, navbits etc. (currently I only get echos of $companyname or {vb:raw companyname}, depending on where I am in my efforts.
PHP Code:

if (isset($_GET['company']))
    
$company $_GET['company'];
   else
    
$company '100megs';
$result mysql_query("select * from hostwebhost where companyname = '$company'");
if (!
$result) {
$numrows 0;
} else {
$numrows mysql_num_rows($result);
}
for(
$x=0;$x<$numrows;$x++){
while (
$row mysql_fetch_array($result)){
$host_id $row[0];
$companyname $row[1];
$emailaddress $row[2]; 
$URL $row[3]; 
$track $row[4]; 
$imgtop $row[5]; 
$imgright $row[6]; 
$imgbody $row[7]; 
$joined $row[8]; 
$password $row[9]; 
$isvalid $row[10]; 
$supportlist $row[11]; 
$street1 $row[12]; 
$street2 $row[13]; 
$city $row[14]; 
$state $row[15]; 
$zip $row[16]; 
$country $row[17]; 
$contactname $row[18]; 
$contactphone $row[19]; 
$contactfax $row[20]; 
$suggested $row[21]; 
$comdescrip $row[22]; 
$registered $row[23]; 

plugin info:
PHP Code:

locationglobal_bootstrap_init_start
title
Webhost-php Include
execution order5
code
:
ob_start();
ob_start();
include(
'/srv/www/findnewhosting.com/public_html/webhost1.php');
$webhost ob_get_contents();
ob_end_clean(); 
vB_Template::preRegister('webhost-php', array('webhost' => $webhost)); 

As you can see the script is webhost1.phpwhich includes the first set of code above. Please note that the custom page is webhost.php which contains the following:
PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''webhosting');
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('webhost-php',);

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

// ######################### REQUIRE BACK-END ############################
chdir ('/srv/www/findnewhosting.com/public_html');

require_once(
'/srv/www/findnewhosting.com/public_html/global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits construct_navbits(array('' => '&nbsp;</span></li><li class="navbit"><span><a href="/">Home</a></span></li><li class="navbit"><span><a href="../hostindex.php">Web Hosting</a></span></li><li class="navbit lastnavbit"><span>{vb:raw companyname} 

'
));
$navbar render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle '$companyname';
$templater vB_Template::create('headerincludea');
$headerincludea $templater->render();
$templater vB_Template::create('webhost-php');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$pagetitle);
$templater->register('sidebarext'$sidebarext);
$templater->register('sidebaropen'$sidebaropen);
$templater->register('headerincludea'$headerincludea);


print_output($templater->render());
?>

webhost-php(template):
PHP Code:

{vb:stylevar htmldoctype}
<
html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<
head>
<
title>{vb:raw companyname}</title>
{
vb:raw headerincludea}
{
vb:raw headinclude_bottom}
</
head>
<
body>
{
vb:raw header}
{
vb:raw navbar}
{
vb:raw sidebaropen}
<
br />
<
div id="pagetitle">
<
h1>&nbsp;&nbsp;{vb:raw pagetitle}</h1><br />
</
div>
<
div class="blockbody">
<
div class="blockrow">
<
div align="center">

{
vb:raw webhost}

</
div>
</
div>
</
div>
    {
vb:raw sidebarext}


    {
vb:raw footer}
  </
body>
</
html

If there is any other info I can give to make it easier to solve just let me know.

Dave

BirdOPrey5 07-23-2011 05:30 PM

I don't know if it's your only problem but you didn't register $companynanme in your webhost1.php file, so it won't show in your template.

Dave-ahfb 07-23-2011 05:48 PM

Could you dumb that down please?

BirdOPrey5 07-24-2011 12:50 PM

Quote:

Originally Posted by Dave-ahfb (Post 2224002)
Could you dumb that down please?

At the end of webhost1.php you have this code:

Code:

$templater = vB_Template::create('webhost-php');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('sidebarext', $sidebarext);
$templater->register('sidebaropen', $sidebaropen);
$templater->register('headerincludea', $headerincludea);


print_output($templater->render());

You need to add this line:

Code:

$templater = vB_Template::create('webhost-php');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('sidebarext', $sidebarext);
$templater->register('sidebaropen', $sidebaropen);
$templater->register('headerincludea', $headerincludea);
$templater->register('companynanme', $companynanme);

print_output($templater->render());

ALL variables you need to use in a template MUST be registered to a template before you use it. If you use any other variables you must register them also.

Dave-ahfb 07-24-2011 02:26 PM

Thank you so much. As soon as I can put this paint brush down I will give it a shot.

Dave

heugabel 07-26-2011 05:19 PM

Code:

        $search_text = '<!-- end logged-in users -->';
        $vbulletin->templatecache['FORUMHOME'] = str_replace($search_text, $search_text . fetch_template('forumhome_xyz'), $vbulletin->templatecache['FORUMHOME']);

how i can rewrite this for vb4?

thank you

cellarius 07-26-2011 05:30 PM

This has been described around the forum several times; either search or open your own thread, this is not related to the topic of this tutorial.

EquinoxWorld 08-04-2011 03:50 AM

Hello everyone, is there any way to include for example this php:

cotw_func_contest_num.php?do=sotw

As a variable in a plugin, then use it in a template?

I also created this thread but am also posting here to see if anyone had any further ideas we could try. Any info would be very much appreciated. Thanks for your time everyone.

MikeF 08-04-2011 04:14 AM

I've been driven nuts. All I want to do is output $random_number using rand(1,99999) and I'm stuck.. why have they made this insanely difficult?

kh99 08-05-2011 08:12 PM

Quote:

Originally Posted by MikeF (Post 2229100)
I've been driven nuts. All I want to do is output $random_number using rand(1,99999) and I'm stuck.. why have they made this insanely difficult?

It actually does make sense, although I'll admit it's not obvious why. What have you tried? You should be able to do something like in a plugin:

Code:

$random_number = rand(1,99999);
vB_Template::preRegister('template_name',array('random_number' => $random_number));

hook location parse_templates is probably a good choice. Of course you need to change template_name to the actual name of the template you want to use the random number in.

Then in the template put
HTML Code:

{vb:raw random_number}

RobDog888 08-14-2011 11:40 PM

Ok been banging my head on this for quite some time now and completely ready to throw in the towel. I dont know why vB had to make things so damn difficult! It used to be really easy and straight forward to extend vB but not so much now.

I just want to pull in my custom template for adding a value to the postbit userifo part using the template hook "postbit_userinfo_right_after_posts"

The variable $post[field5] is already pulled in as I can do the eval like so to test it in the plugin...

Code:

if ($post['field5'])
{
    $templater = vB_Template::Create('postbit_name');
    $template_hook['postbit_userinfo_right_after_posts'] .= $templater->render();
}

My templates phrases are eval'd and outputted in the hook location but $post[field5'] is blank yet how did it evaluate as true if its empty?
If I hard code the template instead of creating it it works fine but I want it to be properly developed and not hacked.

Thanks

cellarius 08-15-2011 06:59 AM

Because it's filled in your PHP script, but you never registered it for use in your template, and that's why it's empty there.

The tutorial does state (in bold red ;)) that you have to register every variable and array you want to use in your custom template. Try:
Code:

if ($post['field5'])
{     
    $templater = vB_Template::Create('postbit_name');
    $templater->register('post', $post)
    $template_hook['postbit_userinfo_right_after_posts'] .= $templater->render(); 
}

Then you should be able to use {vb:raw post.field5} in your template.

RobDog888 08-16-2011 03:30 AM

Thank You for the reply but I guess I will have to start over at square 1 to get a better understanding of the new vB4 architechure

Ok now I made that change and it work! So even though the variable/array is a standard vB one because I made a custom template I have to register the standard variables too it seems. I thought it was just our custom variables

demo7up 08-17-2011 01:40 PM

Quote:

Originally Posted by moonray (Post 1990021)
FINAL WORKING CODE:

Product: vBulletin
Title: Insert Simple PHP
Execution order: 5
Hook Location: global_start
PHP code:
Code:

ob_start();
include('simple.php');
$simple_php = ob_get_contents();
ob_end_clean();

vB_Template::preRegister('navbar',array('simple_php' => $simple_php));

Plugin is active: Yes

Now, go to the NAVBAR template and insert
Code:

{vb:raw insert_simple_php}
just under the code
Code:

{vb:raw ad_location.global_below_navbar}

Im trying to use this code to include a php file in my custom page this is what im using

Code:

ob_start();
include('../www/gearstore/jdmgear.php');
$templatevalues['insert_simple_php'] = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('JDMGEAR', $templatevalues);

In my template i have

Code:

{vb:raw insert_simple_php}
It seems it wants to work but im just getting a gray box as such.

actual page http://nycjdm.com/jdmgear.php any ideas?

--------------- Added [DATE]1313595423[/DATE] at [TIME]1313595423[/TIME] ---------------

Quote:

Originally Posted by demo7up@gmail.c (Post 2234527)
Im trying to use this code to include a php file in my custom page this is what im using

Code:

ob_start();
include('../www/gearstore/index.php');
$templatevalues['insert_simple_php'] = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('JDMGEAR', $templatevalues);

In my template i have

Code:

{vb:raw insert_simple_php}
It seems it wants to work but im just getting a gray box as such.

actual page http://nycjdm.com/jdmgear.php any ideas?

i figured it out, it was the action script in the swf.. i changed some paths and it is now working ..

I have everything working now i just need to figure out how to intergrate it's login with vb4 if anyone could point me in the right direction that would be great.

HMBeaty 08-18-2011 11:38 PM

Ok, I'm probably overlooking something, or didn't do something right, or something lol, but this is my first time trying to include a custom template within another custom template on vB 4 (it was SO much easier on vB 3 :()

Anyway, this is where I'm at so far:
Plugin
Hook location: process_templates_complete
PHP Code:

$templater vB_Template::create('usml_military_ranks_sidebar');
$usml_military_ranks_sidebar $templater->render();
vB_Template::preRegister('usml_military_ranks',array('usml_military_ranks_sidebar' => $usml_military_ranks_sidebar)); 

Template
I'm calling my sidebar template in my template usml_military_ranks (and many others) by using:
Code:

{vb:raw usml_military_ranks_sidebar}
PHP file
In the PHP file for usml_military_ranks I have:
PHP Code:

    $templater vB_Template::create('usml_military_ranks');
        
$templater->register_page_templates();
        
$templater->register('navbar'$navbar);
        
$templater->register('usml_military_ranks_sidebar'$usml_military_ranks_sidebar);
        
$templater->register('mainpagetitle'$mainpagetitle);
        
$templater->register('imp_vars'$imp_vars);
        
$templater->register('pages'$pages);
    
print_output($templater->render()); 

So what am I missing? lol :confused:

kh99 08-19-2011 12:07 AM

You might try taking this line out of the php file:

PHP Code:

$templater->register('usml_military_ranks_sidebar'$usml_military_ranks_sidebar); 


you don't need this and the PreRegister, and this line might actually be registering an undefined variable.

HMBeaty 08-19-2011 12:12 AM

Quote:

Originally Posted by kh99 (Post 2235142)
You might try taking this line out of the php file:

PHP Code:

$templater->register('usml_military_ranks_sidebar'$usml_military_ranks_sidebar); 

you don't need this and the PreRegister, and this line might actually be registering a null value.

LOL! That did it! It's always something simple I end up overlooking :o Thanks!

Raeven 08-28-2011 07:05 PM

Hi, I kinda only have a short question (before I waste another few days of my life, because I didn't wanted to ask for help lol).

My Problem is, that I would like to hook a template on {vb:raw header} (so I don't need any Template edits anymore).
But all I get to work is, when I add in for example Forumhome Template {vb:raw header2} (then my template gets shown, but not if I try to use the real one).

So the Question is:
Is it actual possible or not (to use {vb:raw header})?

The Plugin Code I am using:

PHP Code:

$templater vB_Template::create('dev3_main');
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
$templatevalues['header'] = $templater->render();
vB_Template::preRegister('FORUMHOME'$templatevalues); 

hook: process_template_complete (tried also a few others).

And sorry for asking stupid Questions ;).

kh99 08-30-2011 08:22 PM

Quote:

Originally Posted by Raeven (Post 2239220)
Is it actual possible or not (to use {vb:raw header})?

Sorry, you were trying to save a few days but it took a few days to get an answer. :o

But the answer is that it probably won't work because I think if 'header' gets registered somewhere else (which it probably is, just before the template is rendered), it will override what you pre-registered.

Raeven 08-31-2011 04:48 AM

That's what I almost feared. So back to thinking how to get rid of the last template edit.

And thanks for the answer.

cellarius 08-31-2011 07:25 AM

It may not be wise to use additional templates etc. just to get rid of a template edit. It adds considerable overhead.

Raeven 09-05-2011 10:41 PM

There is always 2 things to consider:

- the right way
- the way people / customers and such prefer it (and thats usually no template edits :P)

zhai 11-28-2011 08:34 AM

1 Attachment(s)
I have been trying to do this for days, but ended up failing all the times. I have read this entire thread twice, from page 1-14 but still couldn't figure this out.

So I'm trying to change this part of showthread:
https://vborg.vbsupport.ru/attachmen...1&d=1322471332

I want to change it into my own moderation action instead of just closing the thread. I want to change the template with plug-in, but I couldn't get the right variable in which the informations about showthread quickreply are stored. On the early page of this thread, someone tried to change the footer just by accessing $footer .= "things to add"; on process_template_complete. So what variable should I be focusing on with my problem? I have already prepared a new template to replace that "checkbox", I just don't know how to access the existing template by using a plugin.

Any help is appreciated..

HMBeaty 01-08-2012 08:44 AM

Ok, I'm obviously missing something, but not sure what. I'm trying to display a variable in the header template, and what I have works just fine in the navbar. Here's what I have to display my mod in the navbar (this works):
PHP Code:

$templater vB_Template::create('usml_navnet_navbar');
$template_hook[navtab_end] .= $templater->render(); 

And this is what I was trying for the header (this doesn't work):
PHP Code:

$templater vB_Template::create('usml_navnet_header');
$templatevalues['navnet'] = $templater->render();
vB_Template::preRegister('header'$templatevalues); 

And, I believe, according to the 1st post, I would just add {vb.raw navnet} in the header template. However, it's not working, so I'm obviously overlooking something...

BirdOPrey5 01-08-2012 04:45 PM

What hook are you using? Header is rendered early, you may need a hook that is executed earlier.

HMBeaty 01-08-2012 05:57 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2285272)
What hook are you using? Header is rendered early, you may need a hook that is executed earlier.

parse_templates


All times are GMT. The time now is 11:40 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.02278 seconds
  • Memory Usage 1,980KB
  • 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
  • (18)bbcode_code_printable
  • (3)bbcode_html_printable
  • (18)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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