Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Alpha Sort Custom Profile Field in Member List Details »
Alpha Sort Custom Profile Field in Member List
Mod Version: 1.00, by jpapadpapa (Member) jpapadpapa is offline
Developer Last Online: Oct 2013 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.8 Rating: (0 vote - 0 average) Installs: 0
Released: 23 Mar 2008 Last Update: Never Downloads: 1
Not Supported Code Changes Re-usable Code Translations  

Note: I came up with this very recently and am currently testing it on my board and running into issues after doing a member search. Please do not use this until I have it figured out. If you can help me figure out what is wrong, I would appreciate it! I am very new at this.

Well, I can't believe I have actually done something worthy of being posted. I have shocked myself. Admittedly, I did have a little help from my husband. (Thanks, Honey!)

Anyway, this is a modification for sorting a custom profile field by the letter/alpha sort at the top of the member list. Some forums, such as mine, are better sorted by another field. My forum is for a local group of people who already know one another. So, it makes more sense for them to see everyone alphabetized by their real names. However, we also wanted to allow everyone to pick their own usernames, rather than require them to use real names.

To do this, you must first use this hack to allow your custom field to be shown (without showing all of your custom fields) in the member list.

Once you have that working, you can move it to the first column by changing this code in the memberlist.php (thanks to Andreas for this part):

First, find this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Replace it with this (where "X" is the custom field you want to appear and "lastname" is the name of that field):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Then, find this:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Replace it with this (where "lastname" is the name of the profile field you are using):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Now you should have your specific custom field listed on your member list as the first column. Finally, to make it sort by the alpha list at the top, you will need to do the following:

Find this code in the memberlist.php:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


Replace it with this (again, using your specific custom field number and name instead of "fieldX" and "lastname"):


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

That's it! I hope this helps someone else. If there are any problems with it, let me know. It was quite a process for this newbie to figure it all out and it's possible I may have missed a step here.

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 24 Mar 2008, 00:06
aproape's Avatar
aproape aproape is offline
 
Join Date: Dec 2007
This sounds very useful! Thanks - we'll try it out very soon!


*poof*
aproape
Reply With Quote
  #3  
Old 15 Jul 2009, 20:37
anthonym16 anthonym16 is offline
 
Join Date: Feb 2009
Thanks, this post did help me. I wish there was a way to do this in a plug-in... There just aren't enough hooks to do it though.

To get the search working, you need to find the block of code starting with the IF statement:
Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.

When a quick search is done, the field 'ausername' contains the search string. All you need to do is update the condition variable to search fieldX rather than username.


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Note that I wrote this using vb 3.8.3.
Reply With Quote
  #4  
Old 19 Oct 2009, 16:50
ganima ganima is offline
 
Join Date: Jul 2009
There seems to be a problem with the field name. I get this MySQL error:
(...) Unknown column 'field7' in 'where clause' (...)

That is the part of my code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

What's wrong with that? field7 is correct but the field name is not. I also tried to insert a variable like $userinfo[field7].

What is the right syntax here for the field name? Can anybody help?
Reply With Quote
  #5  
Old 27 Oct 2009, 18:34
anthonym16 anthonym16 is offline
 
Join Date: Feb 2009
Prefix field7 with the table name. userfield.field7

There are a lot of joins in that query so you need to specify which table field7 comes from.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 02:40.

Layout Options | Width: Wide Color: