Forums / Setup & design / Make a list of all registered users ++

Make a list of all registered users ++

Author Message

Mikael André Larsen

Tuesday 18 January 2005 9:35:16 am

Hi. I have just started developing a site using ez 3.5. so far I am impressed by its functionality, but there are a few things that I have not managed:

1. I want to register more info about the users, such as nationality and age
2. I want to create a list of all registered users, only viewable when you are logged in. That list would include the info above.
3. I have the option for anonymous users to add comments to some articles, but I want them to write in their name and nationality when posting.

Is this possible?

laurent le cadet

Tuesday 18 January 2005 9:53:31 am

Hi (slt;) Michaël,

I can answer only one part of your question at the moment.

(1.)If you want to add more info about users, you have to edit the user classe (config tab > Classes > Users > User) and add as many fields as you want.

Basically users are objetcs as articles or folders.

Laurent

Mikael André Larsen

Wednesday 19 January 2005 7:47:45 am

Thanks, that was what I was looking for. Anyone has an idea how to list the users?

Eivind Marienborg

Wednesday 19 January 2005 8:26:33 am

It's as simple as fetching all the users from the user folder, the same way you fetch articles from any other folder. You just have to change the classes being fetched.

 {let user_list=fetch( content, tree, hash( parent_node_id, $node.node_id,
                                            depth, 2,
                                            limit, 5,
                                            sort_by, array( 'modified', false())))}

This is the code I use at my site for the fetch.

Mikael André Larsen

Friday 21 January 2005 4:29:31 am

I can't make it work... The users I'm talking about is the users that have login access to the site, and they are not in the content class... changing content to users gives me this errors:

Missing function definition file for module: Users
Cannot execute module 'Users', no module found
Cannot execute function 'tree' in module 'Users', no valid data

Eivind Marienborg

Friday 21 January 2005 4:40:39 am

It still works for me, as long as the node.node_id is updated to match the root user folder.

Mikael André Larsen

Monday 24 January 2005 8:53:35 am

I can't make this work... When I insert parent_node_id from a folder in the content structure, the code works great. When changing that number to the node id from the user folder, I get no error messages, but it wont iterate, as if the query returns an empty array....

Heiner Wurbs

Friday 11 March 2005 7:08:28 am

Hi, the reason why it didn't work, is that you have not enough rights. So you have to edit the right policies for the anonymous user group to read users or login to the website as admin. Then this code will show you all registered users:

		{* Fetch all registered users *}
		{let new_members=fetch('content',tree, hash(parent_node_id,5) ))}

		<ul>
		{section loop=$new_members}
		<li>{node_view_gui view=line content_node=$item}</li>
		{/section}
		</ul>
		{/let}