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.