Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 03-25-2004, 11:35 AM
Toneboy's Avatar
Toneboy Toneboy is offline
 
Join Date: Oct 2003
Location: Scotland
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Using custom templates in vBulletin 3

I've looked everywhere, posted on www.vbulletintemplates.com, found numerous solutions which appear to be relevant for vBulletin 2, and was up until 3.30am last night looking through code to get the answer without success. So I thought it might be best to come back here and hopefully then the answers can be easily found by lots of vB users (and not just me!).

After yesterday's post about site navigation I looked around a bit, and decided that putting the site navigation in a template might be the best answer. (I will be testing phpinclude_start template as well at some point, to see which gives me more flexibility.)

So I created a new template (called "site_navbar") and put what I wanted to it in, then tried to call it within the header template. Of course it isn't that simple.

So basically, $navbar brought up the navbar template, whereas $site_navbar did not bring up the site_navbar template.

I've looked around at various things. Various eval lines in files like global.php, I think I saw a "use templates" line in various files (which, unfortunately, appeared to be for vB 2).

So what exactly do you need to do so that your custom templates can be called in the same manner as the standard templates?

Thanks in advance - I hope other vB newbies find the answer to be as helpful as I will.
Reply With Quote
  #2  
Old 03-25-2004, 04:28 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you wish to create a new template assigned to the variable $site_navbar, and want it to be used inside the header template, you'll need to place the eval assignment ABOVE the $header.

So in global.php, you should have something like:

PHP Code:
eval('$site_navbar = "' fetch_template('site_navbar') . '";');
// Custom navbar

eval('$headinclude = "' fetch_template('headinclude') . '";');
eval(
'$header = "' fetch_template('header') . '";');
eval(
'$footer = "' fetch_template('footer') . '";'); 
Speaking of phpinclude, I'm not too keen on how enthused people are with it. I think all PHP should stick to the files, and not be muddled with the vBulletin template system (this doesn't include vB conditionals, which although uses PHP functions, the concept is a core component of many CMS systems out there and considered acceptable).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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.07894 seconds
  • Memory Usage 2,172KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete