Fetching User information

Author Message

John Smith

Tuesday 04 May 2010 6:59:51 am

Hi guys,

I am working on a website in which users will register from the public website. Once registered, user can search other users that are already registered on the website.

The search result will display name of the registered user, few other selective information from user class in a list. Now in the search result list, name of the user will be a link, when clicked will display all the information related to that user.

Is that possible, what is the best method?

I tried few roles and policies, it seems current logged in user cannot access information related to other user.

John Smith

Tuesday 04 May 2010 12:26:03 pm

Anyone please....

Abdelkader RHOUATI

Tuesday 04 May 2010 1:15:11 pm

Hello,

Users under ezpublish are managed in the same ways that the content, except that it is in another root node that has the node_id equal to 5, and another section "Users".

So I advice you to create a new section called for exemple "Public Users" and in new profile you give access to module content > function read on the new created section.

I hope it's help you.

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

John Smith

Tuesday 04 May 2010 2:28:31 pm

Cheers Mate for your swift reply and help.

So according to you I should create new section "Public Users" and assign it to user-group containing all the users. What is best way to display the information for each user??

The only way I can see the user information is via

/user/edit/<object_id>

which probably not the right way? Is it possible to display the information like we use for content, something like

/content/view/full/<node_id>

Cheers,

Abdelkader RHOUATI

Tuesday 04 May 2010 2:57:43 pm

Anything you can do with content, you can do it with the users.

So to display the details of a user, you use content/view/full/[node_id] or even if you retrieve the node of the user, using his url alias (something like this : $user.url_alias )

Regrads

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

John Smith

Tuesday 04 May 2010 11:53:24 pm

Cheers Abdelkader,

It seems working. I can display the information for other users. Seems possible.

Following are the templates which are getting loaded.

extension/ezwebin/design/ezwebin/templates/node/view/full.tpl

design/standard/templates/content/datatype/view/ezuser.tpl

design/standard/templates/content/datatype/view/eztext.tpl

design/standard/templates/content/datatype/view/ezimage.tpl

To get the required information as I have changed the user class (added few other attributes), I think I need to override ezuser.tpl (datatype template) or do you suggest something else to display the user information.

Can it be done like we do the overrides for content objects like article, folder etc?

Abdelkader RHOUATI

Wednesday 05 May 2010 12:42:31 am

Hello

The answer is yes.

TKS, have a nice day ;)

Abdelkader RHOUATI

Blog (french) : http://arhouati.com
----
Extension arh_jdebug : EzDebug using jquery

John Smith

Wednesday 05 May 2010 12:58:55 am

Got it, something like, have to do manually in override.ini.append.php

[xx_user_full.tpl]
Source=node/view/full.tpl
MatchFile=xx_user_full.tpl
Subdir=templates
Match[class_identifier]=user
Match[section]=10 (ID of Public Users section)

Cheers,

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 30 2025 19:39:03
Script start
Timing: Jan 30 2025 19:39:03
Module start 'layout'
Timing: Jan 30 2025 19:39:03
Module start 'content'
Timing: Jan 30 2025 19:39:03
Module end 'content'
Timing: Jan 30 2025 19:39:03
Script end

Main resources:

Total runtime0.0235 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0050 588.1250151.2109
Module start 'layout' 0.00500.0043 739.3359220.6875
Module start 'content' 0.00920.0128 960.02341,005.7578
Module end 'content' 0.02200.0014 1,965.781337.9922
Script end 0.0234  2,003.7734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002711.3250140.0002
Check MTime0.00114.5861140.0001
Mysql Total
Database connection0.00062.403810.0006
Mysqli_queries0.002811.943830.0009
Looping result0.00000.097510.0000
Template Total0.00114.510.0011
Template load0.00083.379110.0008
Template processing0.00031.099310.0003
Override
Cache load0.00052.279810.0005
General
dbfile0.00093.763280.0001
String conversion0.00000.042740.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