Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#3 | profile.module.theme_profile_list.patch | 2.17 KB | ejort |
profile-themeable-user-list.patch | 2.08 KB | vfilby | |
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedlooka useful ... please provide unified diff format. as per http://drupal.org/handbook
Comment #2
robertDouglass CreditAttribution: robertDouglass commentedIt 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.
Comment #3
ejort CreditAttribution: ejort commentedHi,
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
Comment #4
Uwe Hermann CreditAttribution: Uwe Hermann commentedPatch doesn't apply any more.
Comment #5
Jaza CreditAttribution: Jaza commentedMoving 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.
Comment #6
Jaza CreditAttribution: Jaza commentedUnassigning from vfilby - user doesn't seem to have been active for some time on drupal.org.
Comment #7
catchProfile module now has tpl.php file for the profile listing.
Comment #8
(not verified) CreditAttribution: commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #9
jmav CreditAttribution: jmav commentedAdd 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);
Comment #10
catchjmav. 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.
Comment #11
jmav CreditAttribution: jmav commentedSorry my mistake, can you delete my issue in this treat?
New issue is http://drupal.org/node/206124
Comment #12
PanchoNope, issue comments cannot be deleted. But nevermind, we just set the settings back, and everything's fine!
Comment #13
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.