PHP Scripts into a content item/ Article

Author Message

Jung Son

Wednesday 03 September 2008 4:05:05 pm

Can I put php scripts into ezpublish contents item or article?
or can we wrap external php page within the contents?

If you know the solution, please advice.

Thanks!

Pierre T.

Thursday 04 September 2008 1:45:56 am

Hi Jun and welcome to the ezecosystem ;)

Have a look at :
http://ez.no/developer/forum/setup_design/php_code_in_content
http://ez.no/developer/forum/developer/how_to_insert_php_code_in_templates

And I was looking for a contribution I think which enabled to hack the kernel of ez and insert php code in online editor... But I don't refind it... I tell you as soon as get it.

Hope it helps !

Regards,

P.

Maxime Thomas

Thursday 04 December 2008 10:08:52 pm

Hi,

As you can see here :

http://ez.no/doc/ez_publish/technical_manual/4_0/concepts_and_basics/content_and_design

On line one of the content section : it's written that content and design are separeted.

I guess it's a very bad idea to put PHP code in a content for this reason.
If you want a code to be executed on a particular content, you can make a specific module or make an override and create a specific operator / function.

Another point is that as it's content, it won't neer be interpreted by the template engine...

Max

Maxime Thomas
maxime.thomas@wascou.org | www.wascou.org | http://twitter.com/wascou

Company Blog : http://www.wascou.org/eng/Company/Blog
Technical Blog : http://share.ez.no/blogs/maxime-thomas

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 18 2025 16:00:26
Script start
Timing: Jan 18 2025 16:00:26
Module start 'layout'
Timing: Jan 18 2025 16:00:26
Module start 'content'
Timing: Jan 18 2025 16:00:27
Module end 'content'
Timing: Jan 18 2025 16:00:27
Script end

Main resources:

Total runtime0.7292 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0071 589.1484152.6406
Module start 'layout' 0.00710.0029 741.789139.4766
Module start 'content' 0.01000.7174 781.2656570.2656
Module end 'content' 0.72730.0018 1,351.531312.1250
Script end 0.7292  1,363.6563 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00360.4873160.0002
Check MTime0.00150.2011160.0001
Mysql Total
Database connection0.00150.200410.0015
Mysqli_queries0.671792.1146590.0114
Looping result0.00070.0950570.0000
Template Total0.692494.920.3462
Template load0.00230.309820.0011
Template processing0.690194.635820.3450
Template load and register function0.00020.026510.0002
states
state_id_array0.00190.261610.0019
state_identifier_array0.00180.253220.0009
Override
Cache load0.00190.2575260.0001
Sytem overhead
Fetch class attribute can translate value0.00060.076930.0002
Fetch class attribute name0.00150.206740.0004
XML
Image XML parsing0.00080.104230.0003
class_abstraction
Instantiating content class attribute0.00000.001940.0000
General
dbfile0.00150.2065160.0001
String conversion0.00000.001140.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 14
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs