vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Insert HTML or (pre-processed!) PHP file above specific forum (https://vborg.vbsupport.ru/showthread.php?t=67942)

Spinball 01-10-2005 09:31 AM

Sorry but is this relevant to the hack?

Julio 03-24-2005 02:43 PM

Also, where do I input the code to center the banners on the forum home page? Do I just use this code: <div style="text-align:center;">
<a href......>banner</a>
</div> ???

PLEASE let me know as well!

Spinball 03-24-2005 03:00 PM

Well I use the phpinclude_start template:
Code:

ob_start();
require("/home/sites/avforums/public_html/page_top.php");
$forum_heading = ob_get_contents();
ob_end_clean();

and then right at the top of the header template:
Code:

$forum_heading
And the page_top.php file I call some banner serving software.

Julio 04-21-2005 09:00 PM

After a couple of weeks of using this mod, and everything working OK, Today I logged to my forums, and I am getting the following error message at the top of FORUMHOME.

Warning: file_get_contents(): URL file-access is disabled in the server configuration in /index.php on line 59

Warning: file_get_contents(http://www.mydomain.com/forums/banners.php): failed to open stream: no suitable wrapper could be found in /index.php on line 59

Spinball 04-22-2005 09:51 AM

Sounds like there has been some kind of configuration change.
If you access the URL in your browser rather than in the file_get_contents, does it work?

Julio 04-22-2005 05:02 PM

Yes, it works.

Spinball 04-22-2005 06:34 PM

The message
Quote:

URL file-access is disabled in the server configuration
might offer you a clue.
If it worked previously, check (with your hosts) whether the configuration of the server has changed in some way.

makaiguy 04-08-2006 04:10 PM

Quote:

Originally Posted by Julio
After a couple of weeks of using this mod, and everything working OK, Today I logged to my forums, and I am getting the following error message at the top of FORUMHOME.

Warning: file_get_contents(): URL file-access is disabled in the server configuration in /index.php on line 59

Warning: file_get_contents(http://www.mydomain.com/forums/banners.php): failed to open stream: no suitable wrapper could be found in /index.php on line 59

I had this same problem when I moved a working 3.5.4 installation to a new server, which apparently was configured differently. I found it worked if I changed it to not address the file via http:
PHP Code:

$mycustomheader file_get_contents("filename.php"): 


makaiguy 04-12-2006 12:16 AM

Adding to my post, above, re URL file-access is disabled in the server configuration:

I found this is because my server has the PHP option allow_url_fopen disabled, thus preventing accessing the file via http. For importing static html, the solution in the above post was fine.

But one of my import files was a php file that generated some variable text depending on the date. When accessing this directly instead of as an http import, all I got was the static php code, not the RESULT of running the php code.

The support folks at the server suggested using their installed cURL library in place of get_file_contents(). The following modification to this hack in forumdisplay.php is now working for me:
PHP Code:

Replace:

$mycustomheader file_get_contents("http://www.mydomain.com/forums/filename.php"):

With

   
$ch curl_init();
   
$timeout 5// set to zero for no timeout
   
curl_setopt ($chCURLOPT_URL'http://www.mydomain.com/forums/filename.php');
   
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
   
curl_setopt ($chCURLOPT_CONNECTTIMEOUT$timeout);
   
$mycustomheader curl_exec($ch);
   
curl_close($ch); 

If you're having the same problem, check with your host as to whether they have the cURL library available.

Oleks 04-20-2006 07:24 PM

Quote:

Originally Posted by Spinball
The amazing thing I discovered is that if the php function used (file_get_contents) is used on a php file, the php is processed BEFORE the file contents are read into the string.

Hi,
It seams, this is not the case for my server.
I see the text of the .php file, not the results of execution.

What I should ask my host to change?


All times are GMT. The time now is 09:26 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.01280 seconds
  • Memory Usage 1,749KB
  • 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
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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