vb.org Archive

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

djohn 04-10-2004 06:11 PM

PHP in templates?
 
How can i add a php line in one of my templates? I need to include() a script, but all my attempts were unsuccessfull :(

Zachery 04-10-2004 06:23 PM

you cant do stright php in templates

you can only use php in 2 templates

phpinclude_start and end

djohn 04-10-2004 06:49 PM

Any way to use these templates to include() my script in the template called, for example, "scripttemplate" ?

Zachery 04-10-2004 06:50 PM

$var = include(file.php);

put var into your template

weezer412 04-10-2004 07:19 PM

Quote:

Originally Posted by Zachery
$var = include(file.php);


put var into your template

are you sure you dont use implode?

Zachery 04-10-2004 07:21 PM

i dont know php at all :) :D

weezer412 04-10-2004 07:23 PM

see i did this

$fav = "include('./favs/')";
$fav

in my postbit template and it shows up as this

= "include('./favs/')";

Zachery 04-10-2004 07:31 PM

Quote:

Originally Posted by weezer412
see i did this

$fav = "include('./favs/')";
$fav

in my postbit template and it shows up as this

= "include('./favs/')";

dont think you need the quotes

weezer412 04-10-2004 07:33 PM

Quote:

Originally Posted by Zachery
dont think you need the quotes

i tried both but when i wanted to include something in my footer i did this


$advertise = implode ('', file ('http://www.thecerealkiller.com/ad.php'));

and where do i find all the spots where variable are listed...

NTLDR 04-10-2004 08:29 PM

There is an example of howto include PHP files in the default phpinclude_start template.

SVTBlackLight01 04-10-2004 10:44 PM

Quote:

Originally Posted by NTLDR
There is an example of howto include PHP files in the default phpinclude_start template.

I tried using the example in the default phpinclude_start template and continued to get errors with my php file, but the implode method works. Is there anything wrong with using this method?


All times are GMT. The time now is 04:47 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.01128 seconds
  • Memory Usage 1,725KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (11)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