Forums / Developer / Adding a new Operator

Adding a new Operator

Author Message

John van der Boom

Tuesday 29 July 2003 9:53:47 am

Im tying to add a new operator to eZ wich I will share with the community when I'm finished with it.

I took a look at the operators in the contribution (ezIPCountry and eZRSSFeed). Now my Q is: should one always use the functions: modify and namedParameterList() ?

Thanks

John van der Boom

Tuesday 29 July 2003 12:53:54 pm

Next problem I bumping into is that Ez is not seeing my new operator as a registered one.

Operator 'ezcookie' is not registered

I added these line into all the site.ini(.append.php) files:

[ExtensionSettings]
ActiveExtensions[]=ezcookie

AutoloadPath=lib/eztemplate/classes/;kernel/common/;extension/ezcookie/kernel/common

Any ideas?

John van der Boom

Wednesday 30 July 2003 4:50:28 am

I'm also having problem with these operators:

Operator 'ezcookie' is not registered

upword
shorten

Am I missing something?

Paul Borgermans

Wednesday 30 July 2003 9:54:25 am

Maybe this:

AutoloadPath=lib/eztemplate/classes/;kernel/common/;extension/ezcookie/kernel/common

should be

AutoloadPath=lib/eztemplate/classes/;kernel/common/;extension/ezcookie/kernel/common/

Can you install the contributed ezenv operator? It is doing what you want but for post/get vars. Session and cookie variables should be almost the same.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

John van der Boom

Wednesday 30 July 2003 11:25:23 am

I installed the ezenvoperator. And I think it's working, because it's not giving me the ezenv not registered warning. Si it's the ezcookie operator that's giving me problem.

You're telling me that cookie and session vars should be the same. I have a cookie named member_id so:

{"member_id"|ezenv}

should work right?
That's not the case :(
I took a closer look at the ezenv operator and it wn't work with cookies. Because it's using eZHTTPTool.
I don't think eZHTTPTool can handle cookies. Correct me if I'm wrong.

This cookie thing is giving me a headache. Am I the only one trying to do something with cookies or having problem with cookies? I'm getting desperate here.

Paul Borgermans

Thursday 31 July 2003 2:20:39 am

the ezenv operator indeed only works for post/get vars. Can't you use the $GLOBALS array directly and look up the cookie vars? Which server sets these cookies (it should be done within your ezp server, otherwise it won't show up)?

Make sure you disable viewcaching.

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

John van der Boom

Thursday 31 July 2003 10:05:46 am

$_COOKIE is working correctly in the index.php of ezP.
But when I call the $_COOKIE in the template (using the insert operator for a php file) to call the $_COOKIE I get nothing.

Printing the $_COOKIE array also shows me blank, nada, null :-(
eZ isn't showing me the cookies. I'm working on the same server here.

So index.php: cookie are showed perfectly
In template using (insert operator for php): no cookies

John van der Boom

Friday 01 August 2003 2:25:17 am

Can anyone try to show there $COOKIE vars in a template.

Then I will know it's something I'm doing wrong or that this functionality has yet to be implemented in eZ.
Thank you

John van der Boom

Friday 01 August 2003 3:05:23 pm

Found a solution for the cookie problem:

IFRAME!!

Iframe the .php file and everything is working just fine.

eZ debug

Timing: Jan 18 2025 11:03:29
Script start
Timing: Jan 18 2025 11:03:29
Module start 'content'
Timing: Jan 18 2025 11:03:31
Module end 'content'
Timing: Jan 18 2025 11:03:31
Script end

Main resources:

Total runtime1.8863 sec
Peak memory usage4,096.0000 KB
Database Queries212

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0120 587.6094180.8438
Module start 'content' 0.01211.7290 768.4531610.4141
Module end 'content' 1.74110.1451 1,378.8672341.0703
Script end 1.8862  1,719.9375 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.2350210.0002
Check MTime0.00160.0839210.0001
Mysql Total
Database connection0.00090.049410.0009
Mysqli_queries1.783694.55652120.0084
Looping result0.00310.16232100.0000
Template Total1.809996.020.9050
Template load0.00280.147020.0014
Template processing1.807195.805220.9036
Template load and register function0.00010.007110.0001
states
state_id_array0.00760.405510.0076
state_identifier_array0.00230.121420.0011
Override
Cache load0.00230.1240570.0000
Sytem overhead
Fetch class attribute can translate value0.00140.073930.0005
Fetch class attribute name0.00110.0575100.0001
XML
Image XML parsing0.00100.053430.0003
class_abstraction
Instantiating content class attribute0.00000.0012110.0000
General
dbfile0.00890.4731280.0003
String conversion0.00000.000330.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
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
9content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
7content/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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs