vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [vBulletin 4] Simple way of including an external PHP file (https://vborg.vbsupport.ru/showthread.php?t=242454)

zero477 07-23-2012 03:11 PM

check your php.ini and server configurarion ... I think you cannot require_once an URL ....

hqlman 07-23-2012 04:14 PM

Ive set allow_url_include=1 in php.ini now that gets rid of the first error, still the other two errors:


Code:

Warning: require_once(http://al-hussain.co.uk/wp- content/themes/Karma/header.php) [function.require-once]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in [path]/includes/class_bootstrap.php(106) : eval()'d code on line 3

Fatal error: require_once() [function.require]: Failed opening required 'http://al-hussain.co.uk/wp- content/themes/Karma/header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/alhussai/public_html/forum/includes/class_bootstrap.php(106) : eval()'d code on line 3


Any ideas guys?

zero477 07-23-2012 05:50 PM

Sorry, i have no idea... but i think it has to do with the streams or paths ...

BirdOPrey5 07-24-2012 12:34 AM

You can't do a require_once on an http:// URL... you can only require (or include) on a local file on your server and it has to be by a local path.

hqlman 07-24-2012 12:00 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2350914)
You can't do a require_once on an http:// URL... you can only require (or include) on a local file on your server and it has to be by a local path.

Even with that as below im getting the exact same error messages:

Code:

ob_start();
  require_once('/home/alhussai/public_html/wp-
content/themes/Karma/header.php');
  $php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('Test',array('php_include' => $php_include));

I just dont want to have to copy the html and css manually into vbulletin :(

kh99 07-24-2012 12:34 PM

I noticed in the error message above and in the one you posted on vbulletin.com that there's a space between wp- and content. It should be all one word, so maybe try taking out whatever character that is (so it reads require_once('/home/alhussai/public_html/wp-content/themes/Karma/header.php', all on one line).

hqlman 07-26-2012 01:39 PM

Thanks for the reply the error seem to have gone and now its giving just this:

Code:

Fatal error: Call to undefined function language_attributes() in /home/alhussai/public_html/wp-content/themes/Karma/header.php on line 2
--------------- Added [DATE]1343317885[/DATE] at [TIME]1343317885[/TIME] ---------------

Removed language_attributes() from header.php now just a blank page now errors :/

kh99 07-26-2012 05:43 PM

I think the header.php is depending on some Wordpress functions that you aren't including.

cultd3ad 12-29-2012 10:22 AM

Hello,
am a new Owner of vb4.2 and would like to add an echo Script.
Unfortunately, this does not in the Templates, the Output will always appear at the top left.
What can I do? I use the Standart Style! Please help me..

I have add a Plugin:
PHP Code:

ob_start();
include(
'/var/www/virtual/htdocs/echo.php');
return 
$back;
ob_end_clean(); 

and add this in a Template

HTML Code:

{vb:raw back}
still not Work, all other Sample here in Forum not Work.

The same Script tested in the Customer Sidebar, thats Works fine ;)

kh99 12-29-2012 02:05 PM

Try this:

Code:

ob_start();
include('/var/www/virtual/htdocs/echo.php');
echo $back;
$output = ob_get_contents();
ob_end_clean(); 
vB_Template::preRegister('template',array('back' => $output));

but change 'template' to the name of the template where you want to include the output.


(you may not need the ob_get_contents(), but I'm not sure if the echo script creates any output other than the $back value).


All times are GMT. The time now is 10:41 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.02539 seconds
  • Memory Usage 1,740KB
  • 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_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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