Here is a patch for the profile module that provides a way to theme user lists. I simply took the last part of the giant if in profile_browse, moved it to a new function called theme_profile_list and mde profile_browse call the new function.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

moshe weitzman’s picture

looka useful ... please provide unified diff format. as per http://drupal.org/handbook

robertDouglass’s picture

It doesn't really look suitable for theming, though, due to all the database logic. To make this really a theme function, you'd have to prepare the data into some variables that you can get by calling function A, and make a theme function B that outputs the variables.

Things that can't be in theme functions include SQL and user access logic.

ejort’s picture

Status: Active » Needs review
FileSize
2.17 KB

Hi,

This is a patch providing the same thing, but without taking the database code into the theme_profile_list function. I've had this running on one of my sites for a while and found it necessary to output a table listing member contact details (note: there aren't many profile fields accessible by anonymous users in that example, but you get the idea). Unfortunately I never got around to separating it from my other profile.module modifications until now.

Let me know what you think.

Cheers,
Eric

Uwe Hermann’s picture

Status: Needs review » Needs work

Patch doesn't apply any more.

Jaza’s picture

Version: x.y.z » 6.x-dev
Assigned: vfilby » Jaza

Moving to 6.x-dev queue. There is a theme_profile_listing() function in HEAD now, but it doesn't seem to theme the whole list of users, just individual users... so this issue is probably still relevant.

Jaza’s picture

Assigned: Jaza » Unassigned

Unassigning from vfilby - user doesn't seem to have been active for some time on drupal.org.

catch’s picture

Status: Needs work » Fixed

Profile module now has tpl.php file for the profile listing.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

jmav’s picture

Title: Themeable profile list patch for profile.module » Weight sorting for input fields (when the user fill the form) doesn't apply on profile.module
Version: 6.x-dev » 5.5
Category: feature » bug
Priority: Normal » Critical
Status: Closed (fixed) » Needs review

Add SQL "ORDER BY" in db_query sentence inside function profile_load_profile().

Old query:
$result = db_query('SELECT f.name, f.type, v.value FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE uid = %d', $user->uid);

New query:
$result = db_query('SELECT f.name, f.type, v.value FROM {profile_fields} f INNER JOIN {profile_values} v ON f.fid = v.fid WHERE uid = %d ORDER BY f.weight ASC', $user->uid);

catch’s picture

Version: 5.5 » 6.x-dev
Category: bug » feature
Priority: Critical » Normal
Status: Needs review » Fixed

jmav. Please open a new issue at http://drupal.org/node/add/project-issue/drupal instead of re-opening this one. This function hasn't changed since 4.6 and is not related to this discussion.

jmav’s picture

Sorry my mistake, can you delete my issue in this treat?

New issue is http://drupal.org/node/206124

Pancho’s picture

Title: Weight sorting for input fields (when the user fill the form) doesn't apply on profile.module » Themeable profile list patch for profile.module

Nope, issue comments cannot be deleted. But nevermind, we just set the settings back, and everything's fine!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.