Forums / Developer / Error: own php script inside eZp (2)

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?

eZ debug

Timing: Jan 30 2025 16:38:22
Script start
Timing: Jan 30 2025 16:38:22
Module start 'content'
Timing: Jan 30 2025 16:38:22
Module end 'content'
Timing: Jan 30 2025 16:38:22
Script end

Main resources:

Total runtime0.0566 sec
Peak memory usage4,096.0000 KB
Database Queries4

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0073 587.9531370.2891
Module start 'content' 0.00730.0227 958.24221,001.4219
Module end 'content' 0.03000.0265 1,959.664170.7031
Script end 0.0566  2,030.3672 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00234.1224120.0002
Check MTime0.00111.9314120.0001
Mysql Total
Database connection0.00081.350410.0008
Mysqli_queries0.00427.422840.0011
Looping result0.00000.024420.0000
Template Total0.026045.910.0260
Template load0.00101.682610.0010
Template processing0.025044.160310.0250
Override
Cache load0.00071.172410.0007
General
dbfile0.017931.6203100.0018
String conversion0.00000.008830.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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