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?