vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   PHP includes not working (https://vborg.vbsupport.ru/showthread.php?t=256611)

apimag 01-06-2011 04:49 AM

PHP includes not working
 
Trying to get file includes working, but without any luck. Have followed instructions here:
http://www.vbulletin.com/docs/html/t..._externalfiles

So, in short, have created a php file, "example_include.php" with the contents:
Code:

<?php
echo 'Include success!!';
?>

1. Dropped this into the forum root directory.

2. Created new plug-in:

Code:

ob_start();
include('example_include.php');
$includedphp = ob_get_contents();
ob_end_clean();

Selected "global_start"
Checked plug-in is active (and plugin feature generally is enabled).

3. Added {vb:raw includedphp} to the header under common templates.

4. Enabled debug to view that the file has in fact been included:
Quote:

Included Files (15):

* ./index.php
* ./forum.php
* ./global.php
* ./includes/class_bootstrap.php
* ./includes/init.php
* ./includes/class_core.php
* ./includes/config.php
* ./includes/functions.php
* ./includes/class_hook.php
* ./example_include.php
* ./includes/functions_bigthree.php
* ./includes/functions_forumlist.php
* ./includes/functions_calendar.php
* ./includes/functions_notice.php
* ./includes/class_friendly_url.php
But I can't see the test message in the included php file anywhere (have searched source).

Any ideas out there please?

WEBDosser 01-06-2011 05:12 AM

don't you need the path adding?..

ForumsMods 01-06-2011 09:16 AM

First, you need to pre-register the variable.

BirdOPrey5 01-06-2011 01:43 PM

Just for general info, in the future a question like this is better fit for the "VB4 Programming Discussion" Forum (Here) than the "Requests" forum it's in now.

apimag 01-06-2011 09:51 PM

Thanks ForumsMods, that's cracked it. Really had me stumped as there was nothing about this in the online manual.

Sorry BirdOPrey5 - feel free to move it to the appropriate discussion. Can vBulletin do that?


All times are GMT. The time now is 01:11 PM.

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.01031 seconds
  • Memory Usage 1,720KB
  • 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
  • (1)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