I would like to have a database of 650 members stored in my Drupal site.

I have the database in excel form now.

The database directory should be custom based.

For eg, for authenticated users there should be a display of important information of the members.

For anonymous users, the display can just be the name and country of each member.

For me (admin) all the information should appear.

I am new to Drupal and am just learning to use it. I am working only on my localhost.

Pls help with step by step instructions in simple terminology.

Comments

dwees’s picture

What I would do is:

1. Download/install:

  1. taxonomy
  2. user_import
  3. node_import
  4. content module
  5. cck dependent modules
  6. cck_field_perms (version 5.x-1.8 with the patch - look at the issues to find it)
  7. node_profile
  8. views

2. Enable the modules in the order listed.

3. Create a new node type, and use the node_profile module to set it as the user's profile.

4. Modify the new node type to include any extra fields you want. Mark the fields with the appropriate user access using the cck_field_perms module.

5. Upload the users as .csv and import them using user_import, making sure to match their fields appropriately. Basically you just need their username, email and password for this step.

6. Upload the profile information as .csv and import the nodes using node_import, making sure to match the fields appropriately.

7. Use the Views module to create a view to see this information.

Hope this starting point helps,

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Thanks so much. i will try out your steps.
1.Is the content module you mentioned same as cck module? i just downloaded the cck module. is that what you meant?

2.Can u pls tell me what exactly is "cck dependent modules"?Can u give its download link.

i have downloaded all the rest of the modules you suggested.

dwees’s picture

Yeah Content and CCK are the same thing. CCK stands for "Content construction kit".

If you go to the download/module page, you'll see you can choose by category. Choose CCK and you'll see a big list of CCK enabled modules.

In Drupal 5, you can create new content types without any extra modules. Then you download and install the CCK module to change the fields available in that node (actually any node).

I know what I described above actually works, because I've done it on my site successfully. Node import seems to have some minor issues with taxonomy when you have a multiple select taxonomy, but the rest works fine.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Do i have to do anything with "administer>> User management>> Profiles " page?

Can i use this instead of the step 3 you suggested?
" Create a new node type, and use the node_profile module to set it as the user's profile."

i am confused. Pls clarify.

dwees’s picture

You can, but there are 2 disadvantages.

1. As far as I know, the profile module isn't a node type, and so you can't add any custom fields.

2. Also each user will have to create their own profiles when they log in and so you can end up with a lot of empty profiles.

By using the nodeprofile module, and the nodeimport module, you can customize the appearance of the profile AND you can import a bunch of nodes to use for the profiles, relatively easily.

However, neither 1 or 2 is a huge deal, so you may not need to do this.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Hi ! i tried out your steps . Managed to import the csv file after testing. Actually my original database has 688 datas out of which 461 were imported. 227 datas are shown as error as those members did not have an email id.

The "User List" page shows all the randomly generated user names of the imported members. how and where do i view the rest of the information?

I tried to "add a view" in views module. is tht the process?
what is the procedure for your step 7
"7. Use the Views module to create a view to see this information."

Pls elaborate.

Lakshmipriya-1’s picture

Can u pls help answer these:

1.Actually my csv file has 30 fields. will i be able to view all tht?
incase i am not satisfied, and if i delete this import, will the "user list" page remove those usernames as well?

2. in Administer » Content management » Content types
while adding fields, what is the preferred "field type" i shd give?
for most of the fields, i checked the " Autocomplete Text Field " under "User Reference" field type. is tht correct?
For fields like "phone no", i selected the "Text Field " under "Integer" field type.

dwees’s picture

Hi Lakshmipriya,

If your users all have randomly generated usernames, that isn't very useful for you, and I would delete all of those users. When you use user import, make sure to select some of the fields as username. For instance, in the username column, you could use firstname and lastname as username, which means the firstname field would equal 1 in the username column, and lastname would equal 2 in the same column.

Not all of your fields are going to be imported properly unfortunately, the user module only needs name + email + a password, but it will generate the random password for you if you do not set it. My suggestion is to set the password field for the users in the Excel file, and let the users reset it when they login initially.

As for the CCK fields, user reference isn't very useful, it indicates another user. This is used to link a user to a node, which node profile already does. For the other fields, I would choose 'text' and a 'textfield'.

Once you have the fields set up that you need from the Excel file, you can import the profiles, making sure to match each field in the excel file with the field of the profile. This way the import will run smoothly. Otherwise, you will have to enter all of the information again.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Thanks Dave. i will delete the import and start afresh.
by the way, how to view the information thts imported?

dwees’s picture

What you do to view the data is this.

If you want to view the user data, you go to user management and click on the individual user names. I don't know of any other way.

If what you want to see is the user profiles that you uploaded in the 2nd step, then you can use the Views module to do this. There is some good documentation on how to use this module, but to get you started.

1. Navigate to admin/views
2. Click on add view
3. Click on page view, then fill in the fields appropriately, choosing 'table view' for the select drop down.
4. Click on fields and choose the fields from the select drop down you want to view.
5. Click on filter and choose node: type and choose the content type you specified to be the profile for the node profile module.
6. Save your view

To see the output of your new view, navigate to www.yoursite.com/the_view_url_you_provided.

Hope this helps,

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Hi Dave
i'm no longer working on localhost. the site has been brought online and i tried the steps u mentioned to create a directory.
i still have some doubts.
Could you help answer these.

1. the import steps seem to be different than what i did it localhost. i never came across a step to set fields for username and password. i uploaded the csv file at Home › Administer › Content management > Import content. then i was asked to match the fields which i created to those in the csv file. then the import was over. i see no usernames generated. many nodes has been created, each node containing the information tht got imported. When i see the "user list" there are no new inclusions. can you figure out what has happened?

2. where do i delete this import so tht i can try out a new one? i saw an option for tht in the local host , but now i dont see it.

Pls help

dwees’s picture

If you want to import new users, you use User Import. If you want those users to have a profile, you use NodeProfile to create the basic profile, and then Node Import (or Import Content) to import their profiles.

For user imports, you need 3 fields, username, password, email address. The username can be constructed from whatever other fields you have in your csv file.

For node imports you need to choose a title field, and whatever other fields you have configured for your Node Profile (using the CCK module to adapt the Node Profile).

Does this make sense?

Also, if you have done this successfully on your localhost, you can export the SQL from your localhost. What I usually do is create my site on my localhost the way I want it, disable clean-urls, and export the sql for the site (using PhpMyAdmin or something similar). Then I create a blank Drupal site with no content or users, and using PhpMyAdmin drop all of the tables from the fresh site, then import the sql from my localhost. This way I end up with a copy of my local site (since all of the data is in the database). You just need to make sure that you also copy over all of your modules from your localhost site into the same relative positions for the fresh install.

I wouldn't do this at all if you have anything in your current online site, just import them as before.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

hi Dave
i somehow finished the directory part with user import under the inbuilt profiles feature. it works fine. thanks so much for your patient explanations.

i would like to search users by their first name, last name, city, state, country fields.
i tried installing the site user list module. as it is without any custom modifications to the module, the module lists the users with their user id, user name and email address. these 3 are searchable. but i dont need these fields , so i added more fields like country, first name etc. After this modification the site user list page displays every entry multiple times.

for eg, along with the original list, if i add one searchable field, every single user's detail is appearing twice. if i add 5 fields (first name , last name, city, state, country) the detail of each user is appearing 6 times.

am i missing anythng? or is there any other effective method/ module for search purpose?

the "read me" of the site user module says this:

The site_user_list module provides a listing of all the users on
the site, with access to all the profile.module fields.

Your user will need to have the 'CREATE VIEW' privilege on the
MySQL database if you want to use the view version (which is
preferred to a table).

Once you enable the module, go to the settings page, and select
which profile fields are available for display and what order
they should appear in by putting numbers into the leftmost
boxes. You should also choose which fields are visible by
default.

-------------------------------------------------------------------------
i dont follow the create view step mentioned. do i have to create a view. i tried, but in vain.

pls help.

thnks

dwees’s picture

That sounds a bit like it might be a bug with the site_user_list module.

To create a view:

1. Create a new view (it sounds like you know how to navigate to this step).
2. Click on 'Page' and click the checkbox. Enter the url to this view and decide how many user profiles you wish to have displayed. From the drop-down select, choose 'list-view'.
3. Click on fields further down the page and add the fields you want to have shown.
4. Click on filters and choose node->type (and then select profile).

Save the view and then navigate to the url you provided.

If you have difficulty with this, there is a lot, and I mean a lot of information on the views module in the Handbook on this site, check it out.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

hi Dave

i tried out all the steps. in step 4, after chosing node-type, i dont see any "Profile" in the list. i see only the default content types like the blog entry , book, page etc. do i have to create a new content type called "Profile".

actually i got the directory set up without the new node type..i mean new content type. i was able to create multiple extra fields in the administer>>usermanagement>>profiles page. then, using user import and matching the fields, i was able to get the user information into the site. and now if i click on a user from user list page, i get to see the information tht was imported.
so far so good.

i need to facilitate a search now. any user shd be able to search for other users by certain fields.
am stuck up. can u help?

dwees’s picture

If you want to use Views to do this, then the profiles have to be nodes, using the node profile module. Otherwise you'll have to custom created the view.

Dave

My site: http://www.unitorganizer.com/myblog

Sree’s picture

did u used profile module or nodeprofile module for extending the form fields of user registration?

-- Sree --
IRC Nick: sreeveturi

Lakshmipriya-1’s picture

I used the profile module thats under administer >> usermanagement >> Profiles.

dwees’s picture

Unfortunately, the default behaviour of Profile module is to extend the user fields, rather than creating nodes for each user. So as a result, Views won't be able to pick up on those fields (since it only shows lists of nodes).

At this point you have two choices (there are probably more, but these two seem the best):

1. Create a custom page to display the user data as you'd like it displayed. This basically requires creating a module and coding.
2. Disable the profile module. Enable the node_profile module. Create a new content type and specify it as the node_profile. Add the fields to the node_profile that you want using CCK. Import your user data again using the Node Import module, specifying which fields you want to match up with the fields in the node_profile (note that this time, you will see node_profile as a choice). Use Views to display the data as previously discussed.

The unfortunate thing about the process I'm describing is that you then end up storing user data in two different places.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave i have something to ask. the user list page displays the user names of the users rather than their real names. is there a possibility where we can make the list appear with the users original names ..i mean (first name, middle name and last name all put together)

for eg
Gjacobs is one user name in the list. i would like it to appear Garry Jacobs. is tht possible. pls guide.

Lakshmi

Lakshmipriya-1’s picture

Dave i forgot to say this : the user name shd be as it is now (abbreviated first name and entire last name). i just need a page which displays all users by the full name. when clicking on them, it shd go to their respective profile pages.

dwees’s picture

This is slightly trickier. You have two choices.

The titles of the profiles can be their full names, and then in Views you just include the title of the node (as link) which will automatically link to their profiles. This is probably the easiest way to handle it.

The other choice is you can include full name as a separate field in their profile, and then use a custom theme function to provide a link to their profile. This is definitely trickier and involved writing code.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave ... the first suggestion would likely not suit me right now as i havent used the node profile module. as i mentioned earlier i made the import with just user import and profile module.

so, left with the second option, can u guide me more on what exactly the code must be and where exactly it shd be placed? i dont know anything abt php scripting.

dwees’s picture

Unfortunately I doubt the code for this is extremely straight forward. Basically you have to search the database for the Full name field associated with each user, and then create a link to each user page from that. Since I'm not using the Profile module on any of my sites, I'm not sure exactly how to do it.

The steps would be:

1. use db_query and select the profile full name fields from the database for each user (make sure to use a pagered query here).
2. use the results of the query to generate an html list with links to each user page.
3. add the pager query link.

All of this could be put in a page (using the php filter) and displayed there.

The part I am unclear about is the exact select query you would need.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave i'm testing things in my localhost now. here, i created a new content type, imported the contents(profile info) using node import. and also used user import to create user names and password. i could also create a view to display the profile info as table view.

now, i cant follow this instruction of u'rs.

The titles of the profiles can be their full names, and then in Views you just include the title of the node (as link) which will automatically link to their profiles. This is probably the easiest way to handle it.

though i get the idea, where do i do this?
thnks for putting up with me.

Lakshmi

Lakshmipriya-1’s picture

Dave, i see this option of integrating node profile to the profile module. will tht be helpful for my issues?

dwees’s picture

Sorry, I don't know.

Dave

My site: http://www.unitorganizer.com/myblog

dwees’s picture

When you imported the users using Node Import, what you want to do is choose the full name of the individual as the title of their profile. That way in Views you can just choose node->title as one of your fields (and having done that, you will have the option of setting it as a link). This would require full name to be one of the columns in your csv file you upload.

Does that make sense?

Dave
My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave thank you so much!!
i followed exactly what you said. i successfully got the node import done with title as full name. now my view shows full name as a link which goes to the profile info page. Thanks again.

as u said earlier, now the user datas are in 2 places, one in content type (node profile) and other in profile module.
in the profile module, users can login to update/change their information under my accounts.

is it possible in this node profile method? can users change their profile info? if tht can be done , i can very well delete the profile fields tht i created under profile module and user data will be visible in only one place ,which will avoid lots of confusion.
pls guide.
thnks soooo much
Lakshmi

dwees’s picture

Yeah, users should be able to edit their node.profiles. You can check pretty easily by logging in as one of your users and verifying all of the functionality works. You don't need to delete their profile.module information at first, just disable the module should be enough (I don't think the Node profile module requires it).

If everything works fine, then you can do a full uninstall, but it's probably not a bad idea to keep the profile information, just disable the module. That way you have a handy backup.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave i tried out all possibilities ..i am not able to get it right.

1. i disabled site user list module and profile module.

2. under admin>>content management>>content type>> the edit tab of the new content type has a check box which says "use this content type as node profile for users." i checked tht box and i got a tab "node profile" along with manage fields, display fields, add field, add group. under tab "node profile", i checked " Integrate this node profile with user categories." and also "Show this node profile during user registration." but it didnt turn out as expected.
when i sign in as a user and go to my accounts, the edit page shows a new category tab for node profile and i see all the fields tht i created in tht content type. but the fields are empty.
as an admin when i do the same thing, i see the node profile display (the filled in form with node imported info of the 1st member of my directory..)
i can only see empty fields for other users.

3.as another trial, under administer>>user management>>access control, for node module, i checked the "create userprofile(the name of my new content type) content" and "edit own userprofile content". as a user i was able to create content on empty fields of my new content type "userprofile"., but i am not able to edit the node profile.
so i checked the "edit userprofile content". now as a user, i was able to see the edit tab on every member's node profile. to reach a person's node profile, i have to scroll down the directory( name of my view) to find him in order to click on the title, which is the full name.

am so worked up, what can be the solution. i know i am asking too much from you.thnks for all tht u do.
Lakshmi

dwees’s picture

Well here's what I think the database workflow is:

Node Profile is an empty profile and you add fields to it using CCK. It does not use the information that previously in the user profiles from the Profile module, it uses the CCK fields.

What you need to do is configure the Node profile fields the way you want, and keep track of the names of the fields. Then when you use Node Import to import the user profiles, you should be able to match the fields in the csv file to the fields you created using CCK. If this doesn't work, then there is a bug in the Node Import module and you should file an issue with them for support.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave what you say is right and i did it the same way.I am not sure if i made myself clear in my earlier message. i can view the profile information from both profile module and also from the bunch of nodes tht i imported using node import. Each node has title as "Full name" and while creating the view, i specified one of the fields as Node-title as link. so when i click on the "full name" field, am able to see the profile info of tht person.

now i have 2 issues,
1. how can a user go to his profile page easily without much struggle and also how can he edit his profile?

you once mentioned that you have used this method of node import to form a directory. What do you do for users to update information? This is not an issue when we use the inbuilt profile module. thts easy for users to handle. but it does not support creating a view(am i right?)

2. a list view displays like this

Name:
Garry Jacobs
Address:
venkata nagar
postal code:
605011

can't we make it?

Name: Garry Jacobs
Address: venkata nagar
postal code: 605011

3. Can u show me a drupal site which has maximum features. especially one which has a directory.

Lakshmi

dwees’s picture

I think #1 requires some custom coding.

Put this in a block with Php filtering set, including the two php tags:


global $user;
echo l('Edit your profile', 'user/'. $user->uid .'/edit/profile');

This assumes that every user on your site has a profile, which they should, especially since new users who register will automatically create a profile upon registering. The only issue you would have with this code is if you create a user for someone, you'll have to go and create an empty profile for them.

For #2, you'll need to create a custom theme function for the view, which you can read about here, or use some CSS to style it differently. Either way it involves coding that I'm not quite sure about. I'd have to dig a bit to find it. Maybe ask at #drupal-support on an IRC channel.

#3 Sorry no clue. Maybe check groups.drupal.org? I think they have a directory of people.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Thnks Dave, i'll certainly try out your suggestions . how do i access the irc channel. can u give me the link.

dwees’s picture

You need an irc client first. If you are using Firefox, I suggest Chatzilla, it's pretty decent (It's an add-on for Firefox).

The exact details of the connection will depend on your location. Do a search for irc channel on Drupal, and you should find some useful information.

Dave

My site: http://www.unitorganizer.com/myblog

Lakshmipriya-1’s picture

Dave
i have the users information in profile module for a new site. the users have created their profiles manually filling the extended fields of profile module. is it possible to export the profile info later?

dwees’s picture

Yeah definitely, but it involves using SQL. If you have something like phpmyadmin access to your database, you can export the 'profile' (or maybe it's called 'profiles') table into a .csv file and open it up with Excel.

If you want to import this data into the already existing node profiles, then I'm not totally sure how you would do this. Maybe there is a cck_import module?

Dave

My site: http://www.unitorganizer.com/myblog