vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Executing php code in templates from non-vb page (https://vborg.vbsupport.ru/showthread.php?t=72947)

SkyCatcher 12-15-2004 11:35 PM

Executing php code in templates from non-vb page
 
I'm sorry to have to ask for help but I've been searching the forums for an hour and haven't found my answer yet. I know this is really simply to do but yet I can't do it...I feel sad :disappointed:


EVERYONE here tells you how to make an external file integrateable with vb and use a template to show the info... this is good but not what I need.

THIS is what I need:

I have an external file, lets say test.php
I have added a template called test
The page displays with all vb functions enabled and I can edit the template and add new code.

HOW do I execute php code from that file in the template? Obviously I can't use php code in the template itself.... so how do I make a $runtestfile call from the template to execute a block of php code in the test.php file?



Here is the code:
PHP Code:

$dir "upload";
$fd opendir($dir); 
while(
$cover readdir($fd)) { 
   if(
eregi("\.(jpg|gif|png|zip|rar|pdf)$",$cover)) { 
      echo 
"<a href=\"$dir/$cover\">"
      echo 
"<img src=\"$dir/$cover\" align=middle border=0 height=150 width=150>"
      echo 
"</a> $cover<br>\n"
   } 

closedir($fd); 




I just want to be able to add a simply $somthing in the template to execute that specific code in the test.php file.

I've tried the phpinclude_start template but then the vb functions are gone and so is all the formatting and the page ends after the $header is called in the test.php file...


I'm so confused and frustrated - please help me get some sleep :o


All times are GMT. The time now is 05:00 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.01096 seconds
  • Memory Usage 1,714KB
  • 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
  • (1)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