User Image

Author Message

Rene Sack

Wednesday 10 August 2005 2:54:35 am

Hello. How can I fetch and display the image from the user who is currently logged in? I tried something like this:

{let owner=$node.object.owner owner_map=$owner.data_map}
{section show=$owner_map.image.has_content}
{attribute_view_gui attribute=$owner_map.image image_class=small}
{/section}
{/let}

but this only displays the image from the owner of the node and not from the user who is currently logged in. Can anybody help plz? :-)

Greenvalley is waiting

David Eriksson

Wednesday 10 August 2005 4:49:54 am

If you are in page_layout, you already have the user in $current_user. If you're in a view template, you will have to fetch it first.

{def $user=fetch('user', 'current_user')}
{if $user.data_map.image.has_content}
    {attribute_view_gui attribute=$user.data_map.image image_class=small}
{/if}

/David

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

Main resources:

Total runtime0.9182 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0075 589.6641152.6094
Module start 'layout' 0.00750.0034 742.273439.3906
Module start 'content' 0.01090.9061 781.6641519.8906
Module end 'content' 0.91700.0012 1,301.55478.2031
Script end 0.9182  1,309.7578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.4013160.0002
Check MTime0.00140.1573160.0001
Mysql Total
Database connection0.00180.196610.0018
Mysqli_queries0.866994.4109540.0161
Looping result0.00050.0577520.0000
Template Total0.880595.920.4402
Template load0.00210.231320.0011
Template processing0.878395.655620.4392
Template load and register function0.00010.015410.0001
states
state_id_array0.00150.162110.0015
state_identifier_array0.00080.088720.0004
Override
Cache load0.00170.1887140.0001
Sytem overhead
Fetch class attribute can translate value0.00110.115220.0005
Fetch class attribute name0.00170.184330.0006
XML
Image XML parsing0.00410.447220.0021
class_abstraction
Instantiating content class attribute0.00000.000830.0000
General
dbfile0.00380.4155160.0002
String conversion0.00000.001040.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/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
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/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: 10
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs