Embed a PHP Script

Author Message

Andy Boston

Saturday 02 February 2008 3:32:16 am

Hi,

I have a PHP script that I want to embed in the pagelayout.tpl but it's not being run. The script references folders I've uploaded to the root directory and I've changed the paths accordingly but to no avail.

It runs perfectly on a HTML site but not on an ezp 4.0 site.

Is it possible to make this script run?

Please help, this is really frustrating!!!

André R.

Saturday 02 February 2008 3:59:36 am

Take a look at custom 'template operators' / functions, there are several examples in the contribution area. Basically you registers a function you can use in templates that calls you own php code.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

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 31 2025 01:33:22
Script start
Timing: Jan 31 2025 01:33:22
Module start 'layout'
Timing: Jan 31 2025 01:33:22
Module start 'content'
Timing: Jan 31 2025 01:33:22
Module end 'content'
Timing: Jan 31 2025 01:33:22
Script end

Main resources:

Total runtime0.0229 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.1094151.1953
Module start 'layout' 0.00580.0046 739.3047220.6563
Module start 'content' 0.01040.0111 959.9609997.6797
Module end 'content' 0.02150.0013 1,957.640629.9922
Script end 0.0229  1,987.6328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002711.7002140.0002
Check MTime0.00115.0150140.0001
Mysql Total
Database connection0.00073.216710.0007
Mysqli_queries0.004218.240930.0014
Looping result0.00000.047910.0000
Template Total0.00104.310.0010
Template load0.00083.513310.0008
Template processing0.00020.799210.0002
Override
Cache load0.00052.353010.0005
General
dbfile0.00021.004280.0000
String conversion0.00000.034340.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