vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   External header issue (https://vborg.vbsupport.ru/showthread.php?t=165699)

zorag 12-20-2007 01:15 PM

External header issue
 
Hello Everyone

I'm having a problem pulling in a PHP file into the VB header, I'm using the instructions as set out in the VB manual for external PHP files, but it's giving this error in the header:

Quote:

Warning: include(home3/ventscom/public_html/index.php?t=index_menu) [function.include]: failed to open stream: No such file or directory in /global.php(360) : eval()'d code on line 2
The plugin code entered in the plugin manager is:

PHP Code:

ob_start();
include(
'home3/ventscom/public_html/index.php?t=index_menu');
$includedphp ob_get_contents();
ob_end_clean(); 

The index.php file is definitely located in the public_html directory and I've double checked the path in PHP info, I've tried various path permutations without luck.

Any suggestions?

Thanks in advance.

zorag 12-26-2007 08:51 PM

Still can't get this to work but I'm thinking that it may be because it's an executable PHP with an action "index.php?t=index_menu", rather than the VB ob_start call above just pulling in the content of the index.php file?

Any suggestions?

Thanks

Opserty 12-26-2007 10:18 PM

From php.net:
PHP Code:

// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';

// Works.
include 'http://www.example.com/file.php?foo=1&bar=2'

So in your case it would be:
PHP Code:

ob_start();
include(
'http://www.yourdomain.com/index.php?t=index_menu');
$includedphp ob_get_contents();
ob_end_clean(); 

(Where obviously www.yourdomain.com is the actual domain name of your site.)

Its a bit of a guess but it's worth a try.

zorag 12-30-2007 01:35 PM

Thanks Opserty

Still no luck, I'm getting this error when using a URL:

Quote:

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /global.php(360) : eval()'d code on line 2
"no suitable wrapper could be found"

I think I may have found the issue here, the index.php file I'm calling has an action "index.php?t=index_menu" and so it's not an actual "correct" path name. It's also overriding VB, this is a Smarty PHP call using Jamroom.net software which will not mix well within the VB framework.

Do you know of any another way I can pull in this call into the header section of VB, or do I have to manually design one?

Thanks

Dismounted 12-31-2007 02:32 AM

The issue here is that your server has blocked accessing URLs, so your include won't work if it accesses a URL.


All times are GMT. The time now is 09:19 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.01045 seconds
  • Memory Usage 1,724KB
  • 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
  • (3)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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