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 06-27-2011, 04:17 PM
snowname snowname is offline
 
Join Date: Oct 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default How to include HTML file

In 3.x version, I can add a plugin. $test=implode (file, dir).

Then add $test in a template.

How to do this in 4.x version?
Reply With Quote
  #2  
Old 06-27-2011, 04:29 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can pre-register the variable in the template where you will use it, like this:

Code:
vB_Template::preRegister('template_name', array('test' => $test));

and then of course you'd use one of

HTML Code:
{vb:raw test} or 
{vb:var test}
in the template.
Reply With Quote
  #3  
Old 06-28-2011, 12:40 AM
snowname snowname is offline
 
Join Date: Oct 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I pre-registered:

Code:
$include_defaultpage = implode('', file('/bbs/CCED/float/default.html'));

vB_Template::preRegister('footer',array('include_defaultpage' => $include_defaultpage));
and hooked it at global start


I put {vb:raw include_defaultpage} into the footer template.

However, it does not work.
Reply With Quote
  #4  
Old 06-28-2011, 01:10 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried what you posted above, except that I just used $include_defaultpage = "Foo"; as a test, and it showed up in my footer. Are you sure you're looking at the style with the edited footer? Otherwise, maybe it's not finding your html file?

Edit: also, are you sure you set the plugin to active? I've been known to forget that occasionally.
Reply With Quote
  #5  
Old 06-28-2011, 01:51 AM
snowname snowname is offline
 
Join Date: Oct 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I also tried $include_defaultpage = "Foo";, It still does not show up.

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

Here is how I write:

Code:
Plugin PHP Code
$include_defaultpage = implode('', file('/bbs/CCED/float/default.html')); 
$include_defaultpage = "test"; 
vB_Template::preRegister('FOOTER',array('include_defaultpage' => $include_defaultpage));
Reply With Quote
  #6  
Old 06-28-2011, 01:58 AM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

'footer' needs to be lower case. You had it that way before so I guess you probably were trying things.
Reply With Quote
  #7  
Old 06-28-2011, 01:59 AM
snowname snowname is offline
 
Join Date: Oct 2008
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just did a test. If I put this plugin in header template. It works.

vB_Template:reRegister('header',array('include_d efaultpage' => $include_defaultpage));

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

it works now.

I changed /bbs/CCED/float/default.html to CCED/float/default.html

You are right. It did not find the file.

Thanks.
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:46 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.03752 seconds
  • Memory Usage 2,215KB
  • 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_html
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (7)post_thanks_box
  • (7)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (7)post_thanks_postbit_info
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)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