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?

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 31 2025 06:56:08
Script start
Timing: Jan 31 2025 06:56:08
Module start 'layout'
Timing: Jan 31 2025 06:56:08
Module start 'content'
Timing: Jan 31 2025 06:56:08
Module end 'content'
Timing: Jan 31 2025 06:56:08
Script end

Main resources:

Total runtime0.0163 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 588.2656151.2266
Module start 'layout' 0.00580.0029 739.492236.6797
Module start 'content' 0.00870.0061 776.171994.1875
Module end 'content' 0.01480.0014 870.359433.9922
Script end 0.0162  904.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002314.2656140.0002
Check MTime0.00116.9546140.0001
Mysql Total
Database connection0.00105.995710.0010
Mysqli_queries0.002817.293530.0009
Looping result0.00000.148110.0000
Template Total0.00116.810.0011
Template load0.00085.190710.0008
Template processing0.00031.605610.0003
Override
Cache load0.00063.585110.0006
General
dbfile0.002012.227580.0002
String conversion0.00000.055740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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