Modified file:
1, profile-listing.tpl.php
2, profile.pages.inc
Configure: Administer->User management ->Profile
Step 1: Add fields
| Category | The categroy will be show in user edit page as a tab. |
| Title | $field->title |
| Form name | $profile's key word |
| Visibility | It should be selection 4: " Public field, content shown on profile page and on member list pages." |
This two fields are required
| Title | Form name |
| Group | profile_group |
| Role in project | profile_role_description |
Step 2: Change the display
in profile-listing.tpl.php
Title: $field->title
Value: $field->value
Step 3: Group the list
in profile.pages.inc
The code:
============================================
$profiles = array();
$content = '';
while ($account = db_fetch_object($result)) {
$account = user_load(array('uid' => $account->uid));
$profile = _profile_update_user_fields($fields, $account);
foreach($profile as $p)
{
if($p->name =='profile_group')
{
$group = $p->value;
break;
}
}
if(!isset($group)||$group =='')
{
$group = 'Unknow';
}
if(!array_key_exists($group,$profiles))
{
$profiles[$group] = array();
}
$pro = array();
$pro['account'] = $account;
$pro['profile'] = $profile;
$profiles[$group][] = $pro;
//$content .= theme('profile_listing', $pro['account'], $pro['profile']);
//$content .= theme('profile_listing', $account, $profile);
}
$keys = array_keys($profiles);
foreach($keys as $k){
$content .= $k;
foreach($profiles[$k] as $pro)
{
$content .= theme('profile_listing', $pro['account'], _profile_update_user_fields($fields, $pro['account']));
}
}
================================================
See the codes files : http://code.google.com/p/eberea/source/browse/#svn/trunk/sizzle/profile