Has anyone got a good example of user_profile.tpl.php to show picture and other fields in default profile. I try to build somethinglike myspace.com (not so elaborate)

I have the following in thef user_profile.tpl.php now but would like to include
the default fields

<?php if($user->picture): ?>
<div class="picture">
<img src="/<?php print $user->picture ?>">
</div>
<?php endif; ?>
<div class="custom_profiles">
<div class="fields">City: <?php print $user->profile_city ?></div>
<div class="fields">Country: <?php print $user->profile_country ?></div>
<div class="fields">Postcode: <?php print $user->profile_postcode ?></div>
</div>

I can see the picture
However the other fillds are empty.
All the default fields also are missing due to override.

Which is the file to look for to copy or implement the default fields in to
user_profile.tpl.php .

Any help is appreciated.

Cheers
Shred
+===
A great deal for business
http://affilatesexcel.com

Comments

freehunter’s picture

bumping this up, this is needed.

yelvington’s picture

See http://drupal.org/node/16011

Make sure you have this in template.php -- it's from the phptemplate theming docs on this site.

<?php
/**
* Catch the theme_profile_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));
}
?>

Now user_profile.tpl.php should have all your standard and extended profile fields in the $user object.