Drupal Community Part 2 (customizing the user profile)
In part one we discussed the basic Drupal install, some minor customization and a few community-centric modules. Now we’ll be moving on to user profiles and customizing the default user profile page layout supplied by drupal.
First off, make sure you have the Profile module enabled. This is a core drupal module that allows you to extend the information collected for registered users. Once profile is enabled, head over to Administer -> User management -> Profiles. From here you can add whatever features you feel would be valuable for community on your site. You may want to add first / last name, state, ‘about me’ and the like.
You can flag any of these as publicly viewable, private, required or optional. You may want to add a required “I agree to this site’s terms of use” sort of field. Once you’ve gotten all these fields setup, log out of your site, and create a new dummy account to see how the registration process goes. Once you’ve logged in, view your user profile page ( http://yoursitename.com/user if you have clean URLs enabled). You’ll see Drupal’s very unstyled layout that doesn’t make ideal use of screen real estate.
Standard vs. Customized User Profile Page
Standard User Profile Page

Customized User Profile Page
If you’re going to keep reading, you’ll need to have a basic understanding of PHP and HTML/CSS, as we’ll be getting into a little bit of code here. (if you don't have a good text editor, check out my web tools blog posting).
Make sure you're logged back in as yourself, admin, etc. To customize the user profile page, we need to do a couple things:
Always backup any existing files before you edit and re-save them.
Create a custom user profile template (user_profile.tpl.php).
If your theme already has this file, use it as a starting point. If not, you’ll need to create the file and upload it to your theme folder.
Edit the user_profile.tpl.php
Edit your file to utilize your custom layout and call the user profile fields where you want them.
To call profile fields individually, you can use following syntax in PHP:
$user->profile_first
Assuming we defined a custom profile field named "profile_first", this would return the user's first name. You could use this in your custom layout by doing something like:
<strong>First Name:</strong> <? echo "$user->profile_first"; ?>
To see the entire profile array that is availabe to you, use php's print_r function. WARNING: this will provide the raw output of the user array. Don't do this on a live site, people will see very ugly things.
print_r($user);
So that's it for the user_profile part. Do up your layout, add your classes / IDs to your stylesheet, and drop in the user profile fields wherever you want them.
Check your template.php file
Add these lines to the end of template.php if they aren’t already present to make the theme check for your custom user profile:
/**
* Catch the theme_user_profile function, and redirect through the template api
*/
function phptemplate_user_profile($user, $fields = array()) {
// Pass to phptemplate, including translating the parameters to an associative array. The element names are the names that the variables
// will be assigned within your template.
/* potential need for other code to extract field info */
return _phptemplate_callback('user_profile', array('user' => $user, 'fields' => $fields));
}
There you have it, a customized user profile page. The Drupal Forums also offer tons of user suggestions and tutorials on this topic.
Stay tuned for photo albums, blogs, user voting, forums and more.

