Closed (won't fix)
Project:
ProfilePlus
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Feb 2008 at 00:41 UTC
Updated:
11 Aug 2010 at 05:59 UTC
I actually store the first name and last name as extra fields. When I search for the similar names I get a list but it's ordered by the creation time (Ascending UID).
What I wanted to do is sort it by one of the field on the profile list or at least hard code it to sort it by first name or last name.
My solution is this and it seems be working but I don't know how to merge this into Search View.
if ($items) {
$finalsql = pager_query('SELECT uid FROM {users} WHERE uid IN ('.implode(', ', $items).') ');
while ($pageditems = db_fetch_object($finalsql)) {
$user = user_load(array('uid'=>$pageditems->uid));
$profile_fields = profile_view_profile($user);
if ($items) {
// order by first name
$finalsql = pager_query('SELECT uid FROM {profile_values} WHERE uid IN ('.implode(', ', $items).') AND fid = 2 ORDER BY value');
while ($pageditems = db_fetch_object($finalsql)) {
$user = user_load(array('uid'=>$pageditems->uid));
$profile_fields = profile_view_profile($user);
What I would like to do is some how get that '2' as a profile type field on the search form. I guess it's related to modifying the theme for the search_form. But I don't want to change all search forms just the profile plus user search forms.
Comments
Comment #1
james marks commentedProfile fields in Drupal 5 don't have a weight value so it's not possible, as far as I know, to sort the SQL results in any custom manner that would suit all users of the module.
James