Get Users (email) in eZUsers

Author Message

Eder Silva

Friday 16 March 2007 1:28:59 pm

Hi my friends !!

I read a lot of posts and articles about it, but I can´t get the users in eZUsers table

When I use this code, I obtain the user with id =184, but....

{let list_user=fetch( content, tree, hash( parent_node_id, 184,
                                                    sort_by, array( name, true() ),
                                                    class_filter_type, include,
                                                    class_filter_array, array( 'user' ) ) ) }

<select name="name">
{section var=child loop=$list_user}
<option value="{$child.object.name}">{$child.object.name}</option>
{/section}
</select>
{/let}

but...I need obtain the email !

If I try eZUser::('user','current_user'), :I just obtain the current_user, but I need all users in my eZuser table...

Thanks for any help !

Heath

Friday 16 March 2007 4:24:48 pm

Hello,

Have you considered doing this as an eZ publish module extension instead?
I could see how doing this via php could be simpler than within a template...

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Xavier Dutoit

Saturday 17 March 2007 12:03:04 am

{$child|attribute(show,2)} will displays what's inside the object user and where is the email.

X+

http://www.sydesy.com

Bruce Morrison

Saturday 17 March 2007 12:18:51 am

Hi Eder

A couple of basics first. The fetch is return all the content objects of content class user under node 184.

The user content class contain an attribute called <i>user_account</i> which is a user_account datatype

You want to display the email address associated with the user_account attribute.

The following should work:

{def $list_user=fetch( content, tree, hash( parent_node_id, 184,
                                                   sort_by, array( name, true() ),
                                                   class_filter_type, include,
                                                   class_filter_array, array( 'user' ) ) ) }

<select name="name">
{foreach $list_user as $child}
<option value="{$child.object.data_map.user_account.content.email}">{$child.object.data_map.user_account.content.email}</option>
{/foreach}
</select>

See these links for more info:
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/objects/ezuser
http://ez.no/doc/ez_publish/technical_manual/3_8/reference/datatypes/user_account

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Eder Silva

Monday 19 March 2007 8:07:49 am

Thanks for all !!

All the codes are perfect to me...

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

Main resources:

Total runtime0.0146 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.0047 589.3438152.6250
Module start 'layout' 0.00470.0026 741.968839.4453
Module start 'content' 0.00730.0049 781.414197.4453
Module end 'content' 0.01220.0024 878.859438.3047
Script end 0.0146  917.1641 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002617.9427140.0002
Check MTime0.00117.3435140.0001
Mysql Total
Database connection0.00064.268710.0006
Mysqli_queries0.002013.442830.0007
Looping result0.00000.074910.0000
Template Total0.001912.810.0019
Template load0.00117.255610.0011
Template processing0.00085.532510.0008
Override
Cache load0.00085.301210.0008
General
dbfile0.00031.846980.0000
String conversion0.00000.045640.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