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

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2011, 07:35 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Including External HTML File in Template

Hi everyone,
I'm running into a weird issue that I am not able to debug. I am trying to include an external HTML file in my header template. I've read the following posts that describe how to do this: http://www.vbulletin.com/docs/html/t..._externalfiles and https://vborg.vbsupport.ru/showthread.php?t=242454

The problem is that this doesn't seem to be working for me. Here is what I've done.

Created the new Plugin
The new plugin hook location is global_init_start, and the execution order is 5. The code I am using is:
Code:
$newHeader = implode('', file('../ssi/forums/defaultHeader2.shtml'));
vB_Template::preRegister('header',array('newHeader ' => $newHeader));
I've verified that this file exists. The forums live in http://www.kirupa.com/forum, and the file I am trying to include lives in: http://www.kirupa.com/ssi/forums/defaultHeader2.shtml

Referencing it in the Template
The next thing I do is go to the Styles Manager and make a reference to this plug-in:
Code:
<div class="above_body"> <!-- closing tag is in template navbar -->
{vb:raw newHeader}
<p>hello, world!</p>
<div id="header" class="floatcontainer doc_header">
When I save everything and test how this works on my board, nothing shows up.

Can someone please tell me what I am doing that may be wrong?

Thanks,
Kirupa
Reply With Quote
  #2  
Old 05-22-2011, 07:52 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As part of debugging to see where the issue lies, try this:
PHP Code:
$newHeader implode(''file('../ssi/forums/defaultHeader2.shtml'));
$newHeader "Hello World";
vB_Template::preRegister('header',array('newHeader ' => $newHeader)); 
Do you get any output now?
Reply With Quote
  #3  
Old 05-22-2011, 08:11 PM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Lynne,
Unfortunately, no - no output is displayed. I have ensured that Plugins are enabled.

Thanks,
Kirupa
Reply With Quote
  #4  
Old 05-23-2011, 01:56 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, I just tried this myself. I assume you meant global_bootstrap_init_start instead of just global_init_start.

You're gonna kick yourself over this... you have an extra space in your call here - see yours, with what should be underneath:
Code:
array('newHeader ' => $newHeader)
array('newHeader' => $newHeader)
Reply With Quote
  #5  
Old 05-23-2011, 06:18 AM
kirupa kirupa is offline
 
Join Date: Dec 2002
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne - you were right! The extra space was what did me in. I am kicking myself as we speak :P
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 02:26 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.05042 seconds
  • Memory Usage 2,199KB
  • 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
  • (3)bbcode_code
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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