drupal combine account and profile
Can any one sugges开发者_C百科t simple code snippet for combining account and profile tabs in drupal 6. i'm using onepageprofile module it works fine but any other simple solution ?
This is tricky. If you have groups defined in the Profile module, like About Me, Address Information, etc example categories, they show up as tabs in the $tabs2 array of the theme template.
The obvious solution is to not group fields at all, but this could make the user edit/registration form very large and vertical.
you need to comment line number 567 and 568 in profile.module but this is hack.
This how it is.
function _profile_get_fields($category, $register = FALSE) {
$args = array();
$sql = 'SELECT * FROM {profile_fields} WHERE ';
$filters = array();
if ($register) {
$filters[] = 'register = 1';
}
else {
// Use LOWER('%s') instead of PHP's strtolower() to avoid UTF-8 conversion issues.
//$filters[] = "LOWER(category) = LOWER('%s')";
//$args[] = $category;
}
if (!user_access('administer users')) {
$filters[] = 'visibility != %d';
$args[] = PROFILE_HIDDEN;
}
$sql .= implode(' AND ', $filters);
$sql .= ' ORDER BY category, weight';
return db_query($sql, $args);
}
精彩评论