including phpopentracker

Author Message

Michael Kress

Friday 13 April 2007 1:41:55 pm

Hello, I'm trying to include phpopentracker, but somehow I can't include the code needed for that in the template pagelayout.tpl, the code doesn't get executed:

<?php
// prepend phpOpenTracker
include 'phpOpenTracker.php';
 
// log access
phpOpenTracker::log();
?>

(See: http://www.phpopentracker.de/docs/de/installation.html )

Can anybody tell me how to include that properly?
Thank you
Michael

André R.

Friday 13 April 2007 5:09:57 pm

you cant run php code directly inside a template, you'll need to write your self a template operatetor. Witch is basically a wrapper for some php code.

Some examples:
http://ez.no/community/contribs/template_plugins

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

Heath

Friday 13 April 2007 7:18:09 pm

Most of this code belongs in php instead of tpl.

In moving the logic (up the chain-o-command) to php (I think) you might be able to do as you seek.

You might want to take a look at using the Wrap Operator extension which can provide a simple flexible way to write a php code which can return results inside of a template using a custom template operator.

<i>http://ezpedia.org/wiki/en/ez/wrap_operator</i>

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Michael Kress

Saturday 14 April 2007 1:31:42 am

I tried defining a template operator, cf. to
http://ez.no/ezpublish/documentation/development/extensions/template_operator
but that failed. Somehow I had to do the include of phpOpenTracker.php and as soon as I included the file, execution stopped and there were tons of error messages. It seems that this include messed up some path.

IMHO the cleaner way to include that is to use an extension and there is one:
http://pubsvn.ez.no/community/trunk/extension/phpopentracker/
but inclusion of that one (I followed doc/manual.txt) brought up the same type of error as above.

However, has anybody successfully used phpopentracker with ez publish as of version 3.9.1? If so, how?

TIA Michael

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 19 2025 04:34:33
Script start
Timing: Jan 19 2025 04:34:33
Module start 'layout'
Timing: Jan 19 2025 04:34:33
Module start 'content'
Timing: Jan 19 2025 04:34:33
Module end 'content'
Timing: Jan 19 2025 04:34:33
Script end

Main resources:

Total runtime0.7447 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0054 589.1563152.6250
Module start 'layout' 0.00550.0034 741.781339.4453
Module start 'content' 0.00890.7343 781.2266594.8828
Module end 'content' 0.74320.0015 1,376.109412.1641
Script end 0.7447  1,388.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.4593160.0002
Check MTime0.00130.1736160.0001
Mysql Total
Database connection0.00090.119810.0009
Mysqli_queries0.686492.1600620.0111
Looping result0.00080.1037600.0000
Template Total0.717096.320.3585
Template load0.00200.273220.0010
Template processing0.715096.001120.3575
Template load and register function0.00020.025610.0002
states
state_id_array0.00080.104210.0008
state_identifier_array0.00070.093120.0003
Override
Cache load0.00170.2300290.0001
Sytem overhead
Fetch class attribute can translate value0.00080.109330.0003
Fetch class attribute name0.00200.264960.0003
XML
Image XML parsing0.00170.225430.0006
class_abstraction
Instantiating content class attribute0.00000.001960.0000
General
dbfile0.00110.1538240.0000
String conversion0.00000.001240.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs