"file_get_contents" to add content of a url not working

Author Message

Alexandre Cunha

Friday 24 March 2006 12:28:41 am

Hi,

I want add the content of a external html/php file on a ezP page.
Ive add to pagalayout.tpl

{"http://mysite.com/myfolder/"|file_get_contents}

and add into the settings/override/template.ini.append.php

[PHP]
PHPOperatorList[file_get_contents]=file_get_contents

But on the result page I only get:

http://mysite.com/myfolder/
 

What I need to do to add the content of a external url ?

thanks

http://AlexandreCunha.com

Marc Boon

Friday 24 March 2006 4:48:12 am

how about: {include uri='somefile.html'}

Alexandre Cunha

Friday 24 March 2006 5:32:52 am

how about: {include uri='somefile.html'}

This only works for local static html files.

I want include the result of a remote script.

http://AlexandreCunha.com

Marc Boon

Friday 24 March 2006 1:38:20 pm

I tried your first approach with the php operator file_get_contents, and it works fine.
Make sure you didn't make a typo somewhere, and try clearing cache.
Also, check in your php.ini that allow_url_fopen is enabled.

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 19:10:46
Script start
Timing: Jan 18 2025 19:10:46
Module start 'layout'
Timing: Jan 18 2025 19:10:46
Module start 'content'
Timing: Jan 18 2025 19:10:46
Module end 'content'
Timing: Jan 18 2025 19:10:46
Script end

Main resources:

Total runtime0.7037 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0113 588.1563152.6563
Module start 'layout' 0.01130.0048 740.812539.5078
Module start 'content' 0.01610.6861 780.3203509.4063
Module end 'content' 0.70230.0014 1,289.726612.1094
Script end 0.7036  1,301.8359 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00540.7675160.0003
Check MTime0.00260.3718160.0002
Mysql Total
Database connection0.00130.178510.0013
Mysqli_queries0.647091.9400600.0108
Looping result0.00060.0883580.0000
Template Total0.661093.920.3305
Template load0.00310.436620.0015
Template processing0.657993.490320.3289
Template load and register function0.00020.025410.0002
states
state_id_array0.00110.157210.0011
state_identifier_array0.00120.163720.0006
Override
Cache load0.00270.3837240.0001
Sytem overhead
Fetch class attribute can translate value0.00050.069820.0002
Fetch class attribute name0.00190.277040.0005
XML
Image XML parsing0.00020.032120.0001
class_abstraction
Instantiating content class attribute0.00000.002240.0000
General
dbfile0.00150.2160100.0002
String conversion0.00000.001840.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
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 21
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs