vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   ob_clean(); problems in custom template (https://vborg.vbsupport.ru/showthread.php?t=240662)

NickyDee 04-17-2010 04:04 PM

ob_clean(); problems in custom template
 
I have two custom pages on my site. Both call and insert a seperate php file into their <body>.

This is the first one, and this is the second one.

I'm using this plugin for the first one:
Code:

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

vB_Template::preRegister('cpage_Statsmain', array('includedphp' => $includedphp));

And this for the second one:
Code:

ob_start();
ob_clean();
include('schoolstatsinner.php');
$otherphp = ob_get_contents();
ob_end_clean();

vB_Template::preRegister('cpage_Stats', array('otherphp' => $otherphp));

Then I reference the called PHP files in their respective templates using {vb:raw includedphp} and {vb:raw otherphp}.

I can't figure out why, but I can only get one of the two pages working at a time. If I enable both plugins, the second page doesn't work (see the error). If i disable the first plugin, the second page works. If I disable the second plugin, just the first page works. :S

I think this might be related to clearing the object buffer. Can anyone suggest what the problem is and possibly the solution might be?

NickyDee 04-21-2010 05:44 PM

* Bump *


All times are GMT. The time now is 11:53 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.01458 seconds
  • Memory Usage 1,710KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)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