vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Include other PHP files in Blocks (https://vborg.vbsupport.ru/showthread.php?t=308412)

betadoor 02-15-2014 03:54 PM

Include other PHP files in Blocks
 
how can iclude other php files in forum block ?

PHP Code:

$my_output 'include('http://example.com/file.php')';  
return $my_output

^^ not work

kh99 02-15-2014 06:11 PM

Well, you *could* try this (I removed one set of quotes):
Code:

$my_output = include('http://example.com/file.php'); 
return $my_output;

but that may not do what you want. Is the php file on your server?

cellarius 02-16-2014 01:43 PM

you can't include a file into a variable like that, AFAIK. You probably could, if you would then use eval(), which won't work in the block either.

The OP either needs to rewrite the code in the input file to adapt it to the needs of the block environment OR he could try something like this:
PHP Code:

<?php
ob_start
();
include(
$file);
$result ob_get_contents();
ob_end_clean();
?>


kh99 02-16-2014 02:42 PM

Quote:

Originally Posted by cellarius (Post 2481522)
you can't include a file into a variable like that, AFAIK.


You're right of course. I think you could if it were returning a string, but that's probably not the case.


All times are GMT. The time now is 07:31 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.00996 seconds
  • Memory Usage 1,719KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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