How to access user attributes

Author Message

Pascal France

Wednesday 17 May 2006 6:13:21 am

Hi,

when I display the user attributes table with {$user1|attribute(show)} I can see:

contentobject 	           object[ezcontentobject] 	Object
>id 	                          string 	                          10
>section_id 	             string 	                             2
>owner_id 	             string 	                            14
>contentclass_id 	 string 	                        4
>name 	                     string 	                             'Anonymous User'
>is_published 	           string 	                           0
>published 	            string 	                            1033920665
>modified 	            string 	                             1072180405
and so on....
groups 	                       array 	                              Array(2)
>0 	                         string 	                        42
>1 	                         string 	                        4

I can access contentobject attributes but I don't know how to access "groups" strings.

Cordially

Pascal

Ce qui embellit le désert c'est qu'il cache un puits... quelque part... (A. de Saint-Exupéry) - http://luxpopuli.fr/eZ-Publish

Łukasz Serwatka

Wednesday 17 May 2006 11:27:29 pm

groups is an array so you can use {$user1.groups.0} for the first element. or loop

{foreach $user1.groups as $group}
    {$group}
{/foreach}

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

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 21 2025 17:05:15
Script start
Timing: Jan 21 2025 17:05:15
Module start 'layout'
Timing: Jan 21 2025 17:05:15
Module start 'content'
Timing: Jan 21 2025 17:05:15
Module end 'content'
Timing: Jan 21 2025 17:05:15
Script end

Main resources:

Total runtime0.0121 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 591.5313151.2109
Module start 'layout' 0.00460.0021 742.742236.6484
Module start 'content' 0.00670.0040 779.390690.1719
Module end 'content' 0.01070.0014 869.562529.9922
Script end 0.0121  899.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002319.1953140.0002
Check MTime0.00108.5618140.0001
Mysql Total
Database connection0.00086.578610.0008
Mysqli_queries0.001814.584230.0006
Looping result0.00000.082610.0000
Template Total0.00118.810.0011
Template load0.00086.315210.0008
Template processing0.00032.407810.0003
Override
Cache load0.00054.501110.0005
General
dbfile0.00021.782780.0000
String conversion0.00000.060940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs