Forums / Setup & design / including phpopentracker

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

eZ debug

Timing: Jan 19 2025 01:12:11
Script start
Timing: Jan 19 2025 01:12:11
Module start 'content'
Timing: Jan 19 2025 01:12:11
Module end 'content'
Timing: Jan 19 2025 01:12:11
Script end

Main resources:

Total runtime0.2572 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0088 588.9531180.8359
Module start 'content' 0.00880.0125 769.789197.9922
Module end 'content' 0.02130.2359 867.7813526.5234
Script end 0.2572  1,394.3047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00401.5677200.0002
Check MTime0.00150.5811200.0001
Mysql Total
Database connection0.00090.360410.0009
Mysqli_queries0.177969.14961410.0013
Looping result0.00160.63091390.0000
Template Total0.235391.510.2353
Template load0.00110.416310.0011
Template processing0.234291.062510.2342
Override
Cache load0.00070.290410.0007
Sytem overhead
Fetch class attribute can translate value0.00130.521310.0013
XML
Image XML parsing0.00030.098410.0003
General
dbfile0.02037.9004200.0010
String conversion0.00000.003530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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.0002 secs