Forums / Setup & design / Get Users (email) in eZUsers

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...

eZ debug

Timing: Jan 18 2025 11:25:24
Script start
Timing: Jan 18 2025 11:25:24
Module start 'content'
Timing: Jan 18 2025 11:25:25
Module end 'content'
Timing: Jan 18 2025 11:25:25
Script end

Main resources:

Total runtime1.2066 sec
Peak memory usage4,096.0000 KB
Database Queries204

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0072 587.7109180.8359
Module start 'content' 0.00721.0408 768.5469654.5234
Module end 'content' 1.04800.1584 1,423.0703337.0625
Script end 1.2065  1,760.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3423210.0002
Check MTime0.00160.1331210.0001
Mysql Total
Database connection0.00220.183810.0022
Mysqli_queries1.109791.97582040.0054
Looping result0.00220.18382020.0000
Template Total1.175197.420.5875
Template load0.00190.155220.0009
Template processing1.173297.236620.5866
Template load and register function0.00020.015610.0002
states
state_id_array0.00100.086910.0010
state_identifier_array0.00140.114120.0007
Override
Cache load0.00170.1391370.0000
Sytem overhead
Fetch class attribute can translate value0.00140.119450.0003
Fetch class attribute name0.00200.163590.0002
XML
Image XML parsing0.01120.931950.0022
class_abstraction
Instantiating content class attribute0.00000.0017100.0000
General
dbfile0.01090.9047460.0002
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs