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)

masterross 03-03-2010 09:45 PM

Quote:

Originally Posted by TalkVirginia (Post 1996431)
I'm trying to append some text to the end of the footer.. in a plugin.. but I'm totally lost.

How do I get the footer out of the cache to append some text to it?

Why dont you use ad_footer_end hook?

TalkVirginia 03-04-2010 09:44 AM

Quote:

Originally Posted by testebr (Post 1916821)
I figure out how to solve it:

hook: process_templates_complete

code: $footer .= 'text added to footer';

No idea if was the best solution, but that worked very well.

Quote:

Originally Posted by cellarius (Post 1916832)
Indeed, you can manipulate the already rendered template doing this. Also possible is str_replace:
PHP Code:

$search "Terms of Service";
$replace "Terms of Cooking Noodles";
$footer str_replace($search,$replace,$footer); 

Although this is a somewhat bad example, since "Terms of Service" is a phrase, of course, and will vary by language. Always make sure you use strings for replacement that are always present.

Attachment 106372

Using str_replace, you can also add stuff in the middle of the template like so:
PHP Code:

$search "Terms of Service";
$replace " and Terms of Cooking Noodles";
$footer str_replace($search,$search.$replace,$footer); 

Attachment 106374

Testbr and Cellarius - Thank you so much! I finally found your post which solved my issue. After seeing it, it's so simple I felt like smacking myself.. LOL :eek: :facepalm:

abomohammad 03-06-2010 05:21 PM

Hi , I need for help

I created a template called: my_template
and write "Hi" inside it.

I want to get "Hi" in my FORUMHOME template
so i made a plugin on global_start and put:

PHP Code:

$templater vB_Template::create('my_template');
  
$templater->register('my_var'$my_var);
$templater->render(); 

then i post {vb:raw my_var} in FORUMHOME
but nothing apper to me

How to get my_template content in FORUMHOME or other template ???

masterross 03-06-2010 07:10 PM

Quote:

Originally Posted by abomohammad (Post 1998597)
Hi , I need for help

I created a template called: my_template
and write "Hi" inside it.

I want to get "Hi" in my FORUMHOME template
so i made a plugin on global_start and put:

PHP Code:

$templater vB_Template::create('my_template');
  
$templater->register('my_var'$my_var);
$templater->render(); 

then i post {vb:raw my_var} in FORUMHOME
but nothing apper to me

How to get my_template content in FORUMHOME or other template ???

Did you read the fist post in the thread?

PHP Code:

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


abomohammad 03-06-2010 10:51 PM

Quote:

Originally Posted by masterross (Post 1998671)
Did you read the fist post in the thread?

PHP Code:

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


Yes, I read it, but do not work :confused:

Joseph Witchard 03-07-2010 02:43 AM

I apologize for sounding so helpless, but what exactly do you do with templates, and where do you even go to put in the PHP code for them? I opened this article thinking it was about skins. I'll continue to look for a thread about skins, but all this sounds like it's also important on modifying vBulletin to suit your needs, so that's why I'm posting here.

masterross 03-07-2010 06:29 AM

Quote:

Originally Posted by abomohammad (Post 1998766)
Yes, I read it, but do not work :confused:

you also need to use right hook location!
For FORUMNOME probably will be forumhome_start or forumhome_complete


Regards!

TalkVirginia 03-07-2010 11:53 AM

Is it possible to use a custom template and render it into a variable then use that variable in sending HTML email?

I'm trying to use the following PHP code:

PHP Code:


$templater 
vB_Template::create('mycustom_template');
$templater->register('username'$username);
$templater->register('bbtitle'$bbtitle);
$templater->register('homeurl'$homeurl);
$templater->register('forumurl'$forumurl);
$templater->register('hometitle'$hometitle);
$message $templater->render(); 

I have the following variables defined in my template:

Code:


{vb:raw username}
{vb:raw bbtitle}
{vb:raw homeurl}
{vb:raw forumurl}
{vb:raw hometitle}


princeedward 03-12-2010 08:47 PM

thanks for this and hope that someday i can do this too alone and well enough of my own without error...but it's not quite easy at all to understand...just to be honest....:p

well i was about experimenting to show the Current Activity of the Currently Active Members above inside WGO BOX (by mouse hover to the username)....by adding the red code below

Code:

<li> {vb:stylevar dirmark}<a class="username" href="{vb:link member, {vb:raw loggedin}}" title="{vb:rawphrase current_activity} {vb:raw loggedin.action} {vb:raw loggedin.where}
">{vb:raw loggedin.musername}</a>{vb:raw loggedin.invisiblemark}{vb:raw loggedin.buddymark}</li>

...to the vbdefault template of forumhome_loggedinuser but it didn't quite well and good even i tried to preregistered those variables....well i'm not sure too if i did it right or not...


PHP Code:

vB_Template::preRegister('FORUMHOME',array(
'loggedin.action ' => $loggedin.action));  
'loggedin.where ' => $loggedin.where)); 

can anyone guide me on this please...
thanks and best regards to all

:o

cellarius 03-12-2010 09:38 PM

$loggedin.action or $loggedin.where are not valid PHP variables. I do not think that this is just a registering problem. You should probably open your own thread in the forums and explain exactly what and how you are trying to do.

grecostimpy 03-13-2010 12:48 AM

This is a great thread and I know I'm on the right track.

I am trying to add a custom profile field to the memberaction_dropdown template.

{vb:raw post.field5}

How would I register this to work in the memberaction_dropdown? It works on postbit (because I'm assuming it is registered)

Thanks again for a great write-up!

princeedward 03-13-2010 05:24 AM

Quote:

Originally Posted by cellarius (Post 2002436)
$loggedin.action or $loggedin.where are not valid PHP variables. I do not think that this is just a registering problem. You should probably open your own thread in the forums and explain exactly what and how you are trying to do.

hmmm...if you dont mind mate lookin on this THREAD please...it might give you slight idea what i'm trying to do...and hope you can throw me some hint and help...

thanks anyway for your time mate to reply on this...

best regards...

:p

gkaradagan 03-13-2010 04:13 PM

i want to do that some codes work in navbar template but same code dont work in header or navbar . for example how can i run vb:raw forum.title} in forumhome.lastpostinfo template ?

testbot 03-18-2010 01:16 AM

i'm a little confused on how to get my loops into the templates.

how would i get mypage.php:
Code:

while ($result = $db->fetch_array($results)){
        $something .= $result['field1'];
        $something2 .= $result['field2'];
}
$templater->register('something ', $something );

to show all looped values in mytemplate:
Code:

<ul>
START TO DISPLAY LOOPED DATA
<li>
{vb:raw something}
</li>
END TO DISPLAY LOOPED DATA
</ul>


LaCN 03-29-2010 04:42 PM

I've been trying like crazy... We need more turorials...
  1. How do I get my variable $my_own_var in an existing template, like footer ?
  2. How do I get an existing variable from an existing template (like $navbits from the navbar template) in an existing template like footer ?



@ vB staff: RTFM should be WTFM

masterross 03-29-2010 09:19 PM

Quote:

Originally Posted by LaCN (Post 2012352)
I've been trying like crazy... We need more turorials...
  1. How do I get my variable $my_own_var in an existing template, like footer ?

use vB_Template::preRegister

Quote:

Originally Posted by LaCN (Post 2012352)
  1. How do I get an existing variable from an existing template (like $navbits from the navbar template) in an existing template like footer ?


@ vB staff: RTFM should be WTFM

you should register again existing vars:

$templater->register('navbits', $navbits);

LaCN 03-31-2010 12:08 PM

Thanks a bunch for the reply :) :)

Quote:

Originally Posted by masterross (Post 2012498)
use vB_Template::preRegister

Would this be needed to be doing in the hook location where it starts creating the footer ?
And in the case of the footer template, which has no hook-location, which hook location is best used ?

Quote:

Originally Posted by masterross (Post 2012498)
you should register again existing vars:

$templater->register('navbits', $navbits);

If the creating of the template navbar was done before the footer, would I pre-register the $navbits using the the hook-location in the "navbits_complete" ?

And if the navbar template was built after the footer, in which hook-location would I need to pre-register the $navbits ?

Thanks !

derfelix 03-31-2010 01:12 PM

as far as I have seen, footer template is created at the moment any other template is done...

example:
if at the top of a file.. before you did any template stuff...
you do
PHP Code:

echo $footer; exit; 

you will get a blank page...
but if you do:
PHP Code:

$templater vB_Template::create('anytemplate')->render();
echo 
$footer; exit; 

the footer template will show...
--> so just find a place before the first template is created...

Felix

pneo 03-31-2010 07:49 PM

Please can somebody help, I just can't figure out what I'm doing wrong.

I'm trying to add to FORUMHOME and I can't get the basic example working.

I've created a new plugin (hook: forumhome_start) with the following PHP code:

PHP Code:

$my_var 'abc';
$templater vB_Template::create('mytemplate');
$templater->register('my_var'$my_var);
$templatevalues['my_insertvar'] = $templater->render();
vB_Template::preRegister('FORUMHOME'$templatevalues); 

I've then added the following to the FORUMHOME template:

PHP Code:

<p>{vb:raw my_insertvar}</p


Am I right in expecting <p>abc</p> to appear in my forum home page source? Because I just get empty <p></p>, i.e. the variable doesn't exist.

I've tried different hook locations. I also tested the forumhome_start location by adding an "echo 'abc'; in the plugin php, and as expected "abc" appears right at the top of my forum home source.

What am I doing wrong? :S



EDIT!:: Apologies, missed this post: https://vborg.vbsupport.ru/showpost....1&postcount=72

masterross 03-31-2010 09:04 PM

As you wrote it you should use my_var first in template mytemplate.
Then when you use
<p>{vb:raw my_insertvar}</p> in FORUMHOME all content from mytemplate will be appear.

Sadikb 04-07-2010 10:34 AM

Just wanted to thank Cellarius for this very useful article. Thanks Mate...

caciocode 05-02-2010 02:47 PM

Where exactly do I write this content? This part is quite complicated

ckgreenman 05-03-2010 05:56 PM

Hello, I hope someone can point in the right direction. I'm trying to port a mod to vb4 which has a number of templates. The php file contains a whole bunch of
Code:

eval('$template .= "' . fetch_template('templatename') . '";');
lines. The mod uses a main template which then calls the other templates from within the main template using $template references to the other templates.

I've tried a number of different iterations form the first post but I can't get anything but the main template to render. How does one go about making something like this work?


thanks.

ckgreenman 05-04-2010 06:32 PM

nevermind. Turns out I had numerous typos.


Now I'm running into a different problem. I'm editing a (sub)template which is rendered in a variable in the php file and called using:
Code:

{vb:raw display_map}
The display_map template references a number of variables which are defined in the php script and populated with data pulled from the database. When I try to edit the template and use the {vb:raw variable} I'm unable to save the template due to the following error:
Code:

Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3332

vBulletin Message
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Any suggestions where the problem might be? It doesn't seem to matter where I put the variable reference. If there is {vb:raw variable} in the template it won't save.

GameExploiters 05-07-2010 08:22 PM

Quote:

Originally Posted by cellarius (Post 1915072)
Introduction

Starting with vB4, templates no longer get output using eval:
PHP Code:

eval('$mytemplate = "' fetch_template('mytemplate') . '";'); 

is outdated.
What's more: Variables and arrays from plugins that are executed on a page no longer can automatically be accessed in the templates of that page. They need to be registered first.
.
Basic functionality to render templates and register all variables/arrays you want to use inside

PHP Code:

/* Some Code, setting variables, (multidimensional) array */
$my_var "abc";
$my_array = array(
        
'key1' => 'value1',
        
'key2' => array(
                '
key21' => 'value21',
                '
key22' => 'value22'
        '
)
    );

/* render template and register variables */
$templater vB_Template::create('mytemplate');
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
$templater->render(); 

  • The first line provides the template that is to be rendered, using the new vB_Template class (vB_Template::create). The method gets passed the name of the template as an argument.
  • The following two lines register a variable and an array that we want to use in our template. Arguments passed are 1. the name you want to use to access the variable, and 2. the variable from the code you want to register. You can register as many variables/arrays as you want. Just remember you have to register every variable and array that you want to use in your custom template in this way. If you don't register them, they will not be available.
  • The fourth line renders the template ($templater->render()).
In the template you know will be able to use the registered variables/arrays in this way:
HTML Code:

{vb:raw my_var}
{vb:raw my_array.key1}
{vb:raw my_array.key2.key21}

Note the last one: multidimensional arrays are perfectly possible.
.
.
.
Now, with the result of the rendering we can do several things:
.
Output template directly - custom pages


PHP Code:

$templater vB_Template::create('mytemplate');
    
$templater->register_page_templates(); 
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
print_output($templater->render()); 

This immediatly outputs the template. Use this if you have created your own page, for example.
Note the second line, which is special for this type of use:
PHP Code:

$templater->register_page_templates(); 

This auto-registers the page level templates header, footer and headinclude that you will use in the template of your custom page.
.
Use a template hook


PHP Code:

$templater vB_Template::create('mytemplate');
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
$template_hook[forumhome_wgo_pos2] .= $templater->render(); 

The template will be shown using the choosen template hook (for example: $template_hook[forumhome_wgo_pos2]). See the dot before the = in the last line? The hook may be used by other modifications, too, so we don't want to overwrite it, but rather append our code to it, conserving everything that might already be there.
.
Save into a variable for later use in custom template
PHP Code:

$templater vB_Template::create('mytemplate');
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
$mytemplate_rendered $templater->render(); 

Now we have saved the rendered template into a variable. This variable in turn we can later on register in another template, if we want:
PHP Code:

$templater vB_Template::create('my_other_template');
     
$templater->register('my_template_rendered'$my_template_rendered);
 
print_output($templater->render()); 

Again, inside my_other_template we now could call
HTML Code:

{vb:raw my_template_rendered}
If you're running the first template call inside a loop, you may want to use .= instead of = in the last line, so that the results of every loop get added instead of overwriting the existing. But that depends, of course.
.
Save into an array and preregister to use in an existing/stock template

PHP Code:

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

  • This is another, more flexible method to save the rendered template into a variable for future use in an already existing template. In this example, we want to show our own rendered template on forumhome.
  • Problem is: We have no direct way to register variables for already existing templates like FORUMHOME. It's created and rendered in the files, and we don't want to mess there.
  • To help with this, a new method was created for vB_Template class, called preRegister. Using this, we can pass our data to FORUMHOME before it is rendered. Note that the data needs to be saved into an array ($templatevalues['my_insertvar']), a simple variable will throw an error. In the last line the array is preregistered; you need to pass as arguments 1. the name of the existing template and 2. the array that contains the data. Again, this can be done for as many arrays as needed.
  • Of course, the preRegister functionality can be used for any kind of variables or arrays, no matter whether you have saved a rendered template (like in our example) into it or it contains just a simple boolean true/false statement.
To access the data inside the template it was preregistered for use:
HTML Code:

{vb:raw my_insertvar}
Note: it is not {vb:raw templatevalues.my_insertvar}!

Essentially the same as what I put for preRegister would be the following two lines. They could replace the last two lines in the above php codebox:
PHP Code:

$my_insertvar $templater->render();
vB_Template::preRegister('FORUMHOME',array('my_insertvar ' => $my_insertvar)); 

Of course you could add further pairs to that array if you need to preregister more than one variable.
.
.
Bonus track: ...whatever you do, cache your templates!

Now you know how to get your templates on screen - once you succeeded in doing that, make sure to do it in a fast and ressource saving manner: make use of vB's template cache. To see whether your templates are cached or not, activate debug mode by adding $config['Misc']['debug'] = true;to your config.php (don't ever use that on your live site!). Among the debug info is a list of all templates called, and non-cached templates will show up in red.

To cache your templates, add a plugin at hook cache_templates with the following code:
PHP Code:

// for a single template
$cache[] = 'mytemplate'

// for more than one templates in one step
$cache array_merge((array)$cache,array(
    
'mytemplate',
    
'myothertemplate',
    
'mythirdtemplate'
)); 

.
.
Hope this helps!
-cel

----
Addendum - There are now two blog posts on vb.com related to this topic:
http://www.vbulletin.com/forum/entry...in-4-templates
http://www.vbulletin.com/forum/entry...-4-based-files

I'm trying to render my Navbar template so i can add it to my custom templates and be able to change the navbar how would i go about doing this with this tutorial. I don't understand what I'm suppose to do exactly.

Dark_Wizard 06-25-2010 05:13 PM

Quote:

Originally Posted by ckgreenman (Post 2031749)
nevermind. Turns out I had numerous typos.


Now I'm running into a different problem. I'm editing a (sub)template which is rendered in a variable in the php file and called using:
Code:

{vb:raw display_map}
The display_map template references a number of variables which are defined in the php script and populated with data pulled from the database. When I try to edit the template and use the {vb:raw variable} I'm unable to save the template due to the following error:
Code:

Warning: Invalid argument supplied for foreach() in [path]/includes/functions.php on line 3332

vBulletin Message
The following error occurred when attempting to evaluate this template:
%1$s
This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.


Any suggestions where the problem might be? It doesn't seem to matter where I put the variable reference. If there is {vb:raw variable} in the template it won't save.

Chris...sent you a PM...

Bob

Frank T 07-01-2010 07:06 PM

I'm working to insert my own VAR into an existing template. I've seen the examples saying to use vb_Template::preRegister. However I have a catch...I'm using a cloned copy of an existing template. For example, I cloned the default style -- and created newStyle. Then within newStyle, I modified postbit_legacy and would like to display my own $var within the cloned copy of postbit_legacy.

Questions:
1. How to register/preRegister into a cloned template (newStyle->postbit_legacy).
2. How to properly use preRegister -- if that's what's needed. My data isn't an array, and preRegister only works with arrays.

cellarius 07-03-2010 07:40 AM

If you're creating a new style based on another one (in this case the default style), the template name is still postbit_legacy and the template itself still is template legacy. Doesn't matter at all.
If you're variable is not an array, make it an array. $templatevalues['myvariable'] = $myvariable.

SpeedyHire 07-20-2010 07:23 AM

Could you please point me in the right direction as to how I might add an extra field in newthread template, I was trying to do it automatically with the product install and I read here about using process_template hook and str_replace but Im still a little confused by it any help on this greatly appreciated.

cellarius 07-20-2010 07:25 AM

Please open your own thread for questions not directly related to this article.

SpeedyHire 07-20-2010 02:14 PM

It is related to this article? I'm asking how using what I found in this article i can do what others have clearly done since they said so in this thread. If you don't want to help me that's fine but since you helped others with there question to do with the footer I thought you might help me too silly me what was I thinking.

gopherhockey 07-26-2010 12:24 PM

oops, fixed it.

mustangcoupe69 08-29-2010 10:42 PM

I've tried following this example, but am having issues.

I am trying to get a custom template that was installed via an addon to show up in the header template.

My plugin (uses the global_start hook):
PHP Code:

$templater vB_Template::Create('vsa_paypal_donbar');
$templater->register('vsapaypal_donlist_cansee'$vsapaypal_donlist_cansee);
$templater->register('admincpdir'$admincpdir);
$templater->register('vsapp_donbar_goal'$vsapp_donbar_goal);
$templater->register('vsapp_donbar_total'$vsapp_donbar_total);
$templater->register('vsapp_donbar_done'$vsapp_donbar_done);
$templater->register('vsapp_donbar_left'$vsapp_donbar_left);
$templater->register('header'$header);
                
$vsapaypal_donbar $templater->render();
vB_Template::preRegister('header',array('vsapaypal_donbar' => $vsapaypal_donbar)); 

Then my header template starts with:
PHP Code:

{vb:raw vsapaypal_donbar

What am I missing?

vicmx 09-02-2010 05:08 AM

To add a template in another with $template_hook add this plugin:
PHP Code:

global $template_hook;
$newTemplate vB_Template::create('YOUR_CUSTOM_TEMPLATE');
$template_hook['your_var'] .= $newTemplate->render(); 

Now just print in another template:
PHP Code:

{vb:raw template_hook.your_var

For print in all pages, you can set {vb:raw template_hook.your_var} in navbar template for example.

valdet 09-07-2010 08:35 AM

Cellarius, this is an excellent article so I hope you may help me on my little issue. I read many threads and this article and I still cannot get aroudn to fix it.


In vB3 I had a simple plugin to display random banners on navbar template or parse_templates hook

Code:

$random_number = mt_rand(1, 5);

$random_banner[1] = '<img src="path/to/banner1.gif" alt="" border="0" />';
$random_banner[2] = '<img src="path/to/banner2.gif" alt="" border="0" />';
$random_banner[3] = '<img src="path/to/banner3.gif" alt="" border="0" />';
$random_banner[4] = '<img src="path/to/banner4.gif" alt="" border="0" />';
$random_banner[5] = '<img src="path/to/banner5.gif" alt="" border="0" />';

I just placed $random_banner[$random_number] anywhere in navbar and the banners would rotate on random basis.It was very simple and I would like to know how to make it work for vB4 as well.

I posted my problem in this thread too.
https://vborg.vbsupport.ru/showthread.php?t=249848

I hope you can help and thanks for your time.

Lynne 09-07-2010 01:58 PM

You need to then preregister the array $random_banner for use in the navbar. Something like:
vB_Template::preRegister('navbar', array('random_banner' => $random_banner));

valdet 09-08-2010 06:53 AM

Thank you very much Lynne,

I had to add a little bit more and actually change the plugin code to a simpler version.
Inside the plugin I had to create a third variable $new_banners and only pre-registered that variable within template and ran it through parse_templates hook

Quote:

$random_number = mt_rand(1, 5);

$random_banner[1] = '<img src="path/to/banner1.gif" alt="" border="0" />';
$random_banner[2] = '<img src="path/to/banner2.gif" alt="" border="0" />';
$random_banner[3] = '<img src="path/to/banner3.gif" alt="" border="0" />';
$random_banner[4] = '<img src="path/to/banner4.gif" alt="" border="0" />';
$random_banner[5] = '<img src="path/to/banner5.gif" alt="" border="0" />';

$new_banners = $random_banner[$random_number];

vB_Template::preRegister('navbar',array('new_banne rs' => $new_banners));
To make it work, I just dropped this code {vb:raw new_banners} on the template and now it works just as before under vB3.x.

For some (unknown) reason, {vb:raw random.banner.random_number} wasn't working as you suggested, although the arrays were set correctly.

I appreciate your help and borbole for helping me through this.

I hope other users find this little experience useful in their sites.

borbole 09-08-2010 08:46 PM

Quote:

Originally Posted by valdet (Post 2095330)
Thank you very much Lynne,

I had to add a little bit more and actually change the plugin code to a simpler version.
Inside the plugin I had to create a third variable $new_banners and only pre-registered that variable within template and ran it through parse_templates hook

To make it work, I just dropped this code {vb:raw new_banners} on the template and now it works just as before under vB3.x.

For some (unknown) reason, {vb:raw random.banner.random_number} wasn't working as you suggested, although the arrays were set correctly.

I appreciate your help and borbole for helping me through this.

I hope other users find this little experience useful in their sites.

Glad to see that you got it solved :)

owning_y0u 10-01-2010 08:14 PM

Just a small question,

i want to create a template that is showing above the header template..
do i need to register this template ? and how do i call this template above the header? its for a suite version of vB4.X

Vikingant 10-08-2010 10:09 PM

I asked this question over at the other VB forum and was directed to this article. Being completely new to all of this stuff and am still learning my way around, can someone please spell this out to me...

Quote:

Is there a way to easily move the style chooser from the footer to the navbar? I have copied the following from the footer and pasted it into various places but for some reason I only get the chooser box, but it isnt populated with the styles.

Code:

  <form action="{vb:raw vboptions.forumhome}.php" method="get" id="footer_select" class="footer_select">
 
 
  <vb:if condition="$show['quickchooser']">
  <select name="styleid" onchange="switch_id(this, 'style')">
  <optgroup label="{vb:rawphrase quick_style_chooser}">
  {vb:raw quickchooserbits}
  </optgroup>
  </select>       
  </vb:if>
 
  <vb:if condition="$show['languagechooser']">
  <select name="langid" onchange="switch_id(this, 'lang')">
  <optgroup label="{vb:rawphrase quick_language_chooser}">
  {vb:raw languagechooserbits}
  </optgroup>
  </select>
  </vb:if>
  </form>




All times are GMT. The time now is 11:27 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.02720 seconds
  • Memory Usage 1,987KB
  • 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
  • (11)bbcode_code_printable
  • (3)bbcode_html_printable
  • (26)bbcode_php_printable
  • (16)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