Error: own php script inside eZp (2)

Author Message

John van der Boom

Monday 02 June 2003 8:55:11 pm

I'm trying to make a php script run in eZp. Following the how-to: "How can I use my own php script inside eZp?" I did the following:
1. Edit the eZp index.php file:
Between:
- $scriptStartTime = microtime();
- ob_start();
Added:
- // phpBB login page
- ob_start();
- define('override_phpbb_root_path', 'forum/'); // path to the phpBB folder (if we're not in it), no beginning slash
- @include(override_phpbb_root_path . 'index_login.php');
- $phpbb_variable = ob_get_contents();
- ob_end_clean();
- // end phpBB login page
2. In the template where I want this to script to show up I added:
- {$phpbb_variable}
Now I'm getting this error from EzDebug"
" Unknown template variable 'phpbb_variable' in namespace ''
What is going wrong here?

Follow Up:

I've discover that when I echo $php_variable in index.php I do see the result of the script.
So something is wrong with the {$php_variable} in the template.
I also tested the idea of showing a variable declared in index.php in the templates like tis:
Added in index.php:
$test=1;
Added this in a random .tpl file:
($test}
Result EzDebug:
Unknown template variable 'test' in namespace ''
So the idea of passing a variable declared in index.php to a template isn't cleared to me.
Anyone any idea?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 30 2025 19:25:00
Script start
Timing: Jan 30 2025 19:25:00
Module start 'layout'
Timing: Jan 30 2025 19:25:00
Module start 'content'
Timing: Jan 30 2025 19:25:00
Module end 'content'
Timing: Jan 30 2025 19:25:00
Script end

Main resources:

Total runtime0.0257 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 589.2734151.2109
Module start 'layout' 0.00460.0042 740.4844220.7031
Module start 'content' 0.00880.0151 961.1875997.6953
Module end 'content' 0.02390.0017 1,958.882829.9922
Script end 0.0257  1,988.8750 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002810.8747140.0002
Check MTime0.00114.2862140.0001
Mysql Total
Database connection0.00062.474910.0006
Mysqli_queries0.00207.947930.0007
Looping result0.00000.054710.0000
Template Total0.00135.210.0013
Template load0.00093.381510.0009
Template processing0.00051.790010.0005
Override
Cache load0.00062.385810.0006
General
dbfile0.00134.873680.0002
String conversion0.00000.038040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs