vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Include PHP file in Footer? (https://vborg.vbsupport.ru/showthread.php?t=96841)

jribz 09-24-2005 09:20 PM

Include PHP file in Footer?
 
Is there a simple way to include a php file in the footer of the forums?

Thanks

Blaine0002 09-24-2005 10:19 PM

<?php include("file.php"); ?>

jribz 09-24-2005 10:46 PM

Quote:

Originally Posted by Blaine0002
<?php include("file.php"); ?>

Sorry, I meant from a template without editing a php file. That would work in a php file but not from a template, well, at least I can't get it to work from a template.

Blaine0002 09-24-2005 11:30 PM

you want a template to load up another template?

jribz 09-25-2005 12:11 AM

Quote:

Originally Posted by Blaine0002
you want a template to load up another template?

No, I want the template to call a php file and display it, the php file basically has links which dynamically change, similar to an ad script.

Blaine0002 09-25-2005 12:29 AM

hmm the include function should work then..

jribz 09-25-2005 12:35 AM

Quote:

Originally Posted by Blaine0002
hmm the include function should work then..

Well I recall when doing something similar I had to use phpincludestart however this is no longer an option in 3.5.... :ermm:

evenmonkeys 09-25-2005 02:18 AM

I've been trying to get help on this as well and no one seems to care. =P You are not able to put php directly into the templates. You are given two options. Create a php file that calls for a template aka the footer. Or you may create a plug-in that you'd put before or after the footer. I can't go too far into detail, but maybe that'll help you a little bit. I'm trying to put php into my header, but I'm not doing so well.

Adrian Schneider 09-25-2005 02:28 AM

Try hook: global_start
PHP Code:

ob_start();
include(
'yourfile.php');
$variable ob_get_contents();
ob_end_clean(); 

Then you should be able to use $variable in your templates.

[ I'm not sure if this is the correct hook, but it should work ]

evenmonkeys 09-25-2005 08:56 PM

What exactly would I specify in the template then? How would I call for it?

I'm confused. I made a plugin with what you gave. I changed the source appropriately. Then what do I put in my header template to call for that hook? Do I need to create a new template? Please be detailed in your answer. I'd really appreciate it.


All times are GMT. The time now is 07:10 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.01079 seconds
  • Memory Usage 1,729KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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