vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Howto Use PHP Include function in header template? (https://vborg.vbsupport.ru/showthread.php?t=106971)

Quarterbore 02-02-2006 12:33 PM

Howto Use PHP Include function in header template?
 
I have come to the conclusion that I can not simply add a php include function in the header of my forum pages (I tried) so I am looking for another solution or advise on how I might make this work.

What I am trying to do is make table that lives in the header of my website that I can incorporate some intellegence into. For example, I could have had it call up a script that checked the date and if it saw today was "Groundhog day" it could have pulled a "Groundhog day" based forum header.

I am guessing (I am still looking at the code) that my issue is in the way that the header is called and it may in itself be inside an "include" function so I guess there way to include an include function :ermm:

It looks to me like the header template is strictly written in html so perhaps what I am trying to do is not possible and before I spend too much time on an impossible task I figured I should ask.

I am also guessing that I could do this in Java but I have enough touble learning php and mysql to try to become a Java man too...

Wayne Luke 02-02-2006 01:01 PM

You have to use the plugins and assign the output from your file to a variable which can be placed in your header template. vBulletin has never allowed PHP in most templates.

Use something like the following in the global_start hook:
PHP Code:

ob_start();
include_once(&
#145;/path/to/file.html?);
$included_file ob_get_contents();
ob_end_clean(); 



All times are GMT. The time now is 12:59 PM.

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.01051 seconds
  • Memory Usage 1,716KB
  • 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
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete