Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-20-2007, 01:15 PM
zorag zorag is offline
 
Join Date: Dec 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 12-26-2007, 08:51 PM
zorag zorag is offline
 
Join Date: Dec 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #3  
Old 12-26-2007, 10:18 PM
Opserty Opserty is offline
 
Join Date: Apr 2007
Posts: 4,103
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #4  
Old 12-30-2007, 01:35 PM
zorag zorag is offline
 
Join Date: Dec 2007
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 12-31-2007, 02:32 AM
Dismounted's Avatar
Dismounted Dismounted is offline
 
Join Date: Jun 2005
Location: Melbourne, Australia
Posts: 15,047
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:48 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04129 seconds
  • Memory Usage 2,198KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete