Forums / Setup & design / Problem including this script inside eZp

Problem including this script inside eZp

Author Message

Shurbann Martes

Tuesday 09 September 2003 2:01:09 pm

Hello eZ,

Sorry that I'm going to put alot of code here, but I think it might help you guys understand the problem I think better.

I'm using eZ version 3.1-1. Everything is working fine.
Right now I want to put this code (weather code) into ezP.

I tried alot of things like in the contribution insert operator:
{"http://localhost/weather/weather.php"|insert}

and the documentation http://www.ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/how_can_i_use_my_own_php_script_inside_ezp

Still no results. I find it hard to believe that there is no way for this to work.

This is the code I need to include in my site (again my apoloies for the amount of code)

< Code snipped because of length >

I hope you can help me including this code into eZp.

Shurbann Martes

Tuesday 09 September 2003 2:35:43 pm

Another method I tried is this one:

I placed the include right before the
include_once( 'kernel/classes/ezsection.php' );
line in index.php. (see forum implementing counter)

Then I deleted of the mweather.php the 6th line before end "echo $tmpl;t"
And then I used this variable inn the pagelayout.tpl like this: {$tmpl}

But this method is giving me this error:

Error: index Sep 09 2003 17:28:36
Undefined module: 0

I still hope anyone of you can help me.
Greets,
Shurbann

Paul Forsyth

Wednesday 10 September 2003 12:11:36 am

In future it is best not to post code of this size. Not only is it difficult to read but it prevents others from actually following and helping with your problem.

Now, what is your aim with this code? Is it going to be a simple function call and you want to display the results in your template? If so the quick way to put the code in is to make it an operator. Read this:

http://ez.no/developer/ez_publish_3/documentation/customization/tips_tricks/including_php_files_in_templates
http://ez.no/developer/ez_publish_3/documentation/development/kernel/custom_template_operators

If you need to have further communication where you use POST or GET commands to pass information back and forward you should consider building a module. It isn't too hard and is within the documents.

Paul

Shurbann Martes

Wednesday 10 September 2003 10:22:24 am

Ok Paul I'll keep this in mind.

The operator solution is working great!!!! Thank you.

But since I got the idea on how to make a new operator, now I want to do the same for another small script.

But the problem is, this one make use of a DB of his own. The operator solution won't work here cause eZ is giving me a Database error response :(

Do I need to make a module for this one?

Jianjun Hu

Saturday 21 June 2008 8:37:53 am

Nearly same problem as me. I'll try latter.

onlyblue

☆..·°∴°.☆°°.☆°.
°∴ °☆ .·enjoy star° .·★°∴°
∴°.°★ .·°
  ミ☆°∴°.★☆° ∴·°
°.☆° .·∴° 

Is it a pleasure after all to practice in due time what one has learnt?

eZ debug

Timing: Jan 31 2025 04:19:28
Script start
Timing: Jan 31 2025 04:19:28
Module start 'content'
Timing: Jan 31 2025 04:19:28
Module end 'content'
Timing: Jan 31 2025 04:19:28
Script end

Main resources:

Total runtime0.1738 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.0069 588.0625180.8125
Module start 'content' 0.00690.0064 768.875097.9297
Module end 'content' 0.01330.1605 866.8047526.8750
Script end 0.1738  1,393.6797 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00372.1132200.0002
Check MTime0.00140.8124200.0001
Mysql Total
Database connection0.00100.599410.0010
Mysqli_queries0.121770.02951410.0009
Looping result0.00140.81261390.0000
Template Total0.160292.110.1602
Template load0.00070.416410.0007
Template processing0.159491.723410.1594
Override
Cache load0.00050.262410.0005
Sytem overhead
Fetch class attribute can translate value0.00090.531510.0009
XML
Image XML parsing0.00030.179410.0003
General
dbfile0.00885.0609200.0004
String conversion0.00000.003630.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.0001 secs