Using images

Author Message

Glenn MacGregor

Thursday 13 November 2003 12:53:13 pm

Hi All,

What is the correct way to store images and access them from a page. On my frontpage I want to rotate images (keep it looking fresh). I think I have the code to get a random number between a high and a low. Now how do I use that to query the DB and get the image name. Once I have that image name how do I get it to display on the page.

Example:
Create (at root of content) Images folder. Put an image in the images folder. Create a testpage and override the template putting in (somewhere) "<img src=/images/img1>" (I called the image img1). When I browse to the testpage it can't find the image. If I browse to the hostname/images/img1 it works fine.

Any clues

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 15:50:07
Script start
Timing: Jan 18 2025 15:50:07
Module start 'layout'
Timing: Jan 18 2025 15:50:07
Module start 'content'
Timing: Jan 18 2025 15:50:09
Module end 'content'
Timing: Jan 18 2025 15:50:09
Script end

Main resources:

Total runtime1.5233 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0058 587.7813152.6094
Module start 'layout' 0.00580.0042 740.390639.3984
Module start 'content' 0.00991.5114 779.7891401.2344
Module end 'content' 1.52130.0020 1,181.02348.2031
Script end 1.5233  1,189.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.2664160.0003
Check MTime0.00150.1007160.0001
Mysql Total
Database connection0.00090.059110.0009
Mysqli_queries1.474196.7691460.0320
Looping result0.00070.0466440.0000
Template Total1.477397.020.7387
Template load0.00250.162120.0012
Template processing1.474996.818720.7374
Template load and register function0.00020.013610.0002
states
state_id_array0.00120.081610.0012
state_identifier_array0.00490.322420.0025
Override
Cache load0.00190.124690.0002
Sytem overhead
Fetch class attribute can translate value0.00160.107310.0016
Fetch class attribute name0.00100.067610.0010
XML
Image XML parsing0.00010.008410.0001
class_abstraction
Instantiating content class attribute0.00000.000310.0000
General
dbfile0.00080.0529100.0001
String conversion0.00000.000640.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
3content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 8
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs