Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons

Reply
 
Thread Tools
Memberlist -- Custom Profile Field Sorting Details »»
Memberlist -- Custom Profile Field Sorting
Version: 1.0.0, by Oblivion Knight Oblivion Knight is offline
Developer Last Online: Nov 2016 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.6.0 Rating:
Released: 08-20-2006 Last Update: Never Installs: 34
Uses Plugins Template Edits
Is in Beta Stage  
No support by the author.

Memberlist -- Custom Profile Field Sorting
For vBulletin 3.6.0



Description
By default, vBulletin cannot show just a single custom field on the memberlist, nevermind make it sortable. It's all or nothing.. I wanted to display just the location field and make it sortable, because I use the CountryFlag modification. I searched vbulletin.org to see if this was possible, but all that I could find was unanswered questions similarly asking how to do it. So I took it on myself to get something usable and working.


Instructions
Upload the PLUGIN, and edit it via the Plugin Manager.

Find:
Code:
	case 'urlname':
Change urlname to the variable you want to be used in the URL of the memberlist sorting. My example is location.

Find:
Code:
		$sqlsort = 'userfield.fieldX';
Change X to the field number of your custom profile field. My example is 2.

Now you have 2 templates to edit. First, memberlist.

Find:
Code:
	<if condition="$show['homepagecol']"><td class="thead" nowrap="nowrap">$vbphrase[home_page]</td></if>
Above it, add:
Code:
	<td class="thead" nowrap="nowrap"><a href="$sorturl&amp;order=DESC&amp;sort=urlname&amp;pp=$perpage$usergrouplink">Title</a> $sortarrow[urlname]</td>
Use DESC or ASC depending on which default sort order that you wish to use. Change both instances of urlname to the variable that you specified in the plugin earlier (location). Change Title to the title of the field that you wish to be displayed. My example is Location.

Now edit the memberlist_resultsbit template.

Find:
Code:
	<if condition="$show['homepagecol'] AND exec_switch_bg()"><td class="$bgclass"><if condition="$show['homepagelink']"><a href="$userinfo[homepage]" target="_blank"><img src="$stylevar[imgdir_button]/home.gif" alt="home.gif" title="<phrase 1="$userinfo[username]">$vbphrase[visit_xs_homepage]</phrase>"  border="0" /></a><else />&nbsp;</if></td></if>
Above it, add:
Code:
	<if condition="exec_switch_bg()"><td class="$bgclass"><if condition="$userinfo[fieldX]"><div class="smallfont">$userinfo[fieldX]</div></if></td></if>
Change both instances of X to the field number that you specified in the plugin earlier (2).


Final Comment
It's not pretty, it's not clever but it works..

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 04-08-2007, 04:16 AM
D Holzwarth D Holzwarth is offline
 
Join Date: Apr 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with vb 3.6.5
Reply With Quote
  #13  
Old 04-08-2007, 07:55 AM
jacobi's Avatar
jacobi jacobi is offline
 
Join Date: Jan 2003
Location: Ripon, WI, USA
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works on my site.
Reply With Quote
  #14  
Old 04-08-2007, 09:33 PM
D Holzwarth D Holzwarth is offline
 
Join Date: Apr 2007
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works on mine now too. Very sweet. Was able to delete additional databases due to this feature. Thank you.
Reply With Quote
  #15  
Old 03-16-2008, 11:35 PM
baderandsonsco baderandsonsco is offline
 
Join Date: Feb 2008
Posts: 24
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much!
Reply With Quote
  #16  
Old 08-20-2008, 05:52 PM
VikesRule VikesRule is offline
 
Join Date: Aug 2008
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

On this part:

Quote:
Change both instances of urlname to the variable that you specified in the plugin earlier (location).
If I'm doing this for a custom field, do I put say "field4" in for the urlname or whatever field number corresponds with it?

And what do I do to add more than one custom field that is sortable?
Reply With Quote
  #17  
Old 08-27-2008, 07:49 PM
VikesRule VikesRule is offline
 
Join Date: Aug 2008
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Bump..........................
Reply With Quote
  #18  
Old 10-18-2009, 02:21 PM
ganima ganima is offline
 
Join Date: Jul 2009
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anybody know how to change sort from DESC to ASC when clicking on the link in the forum?

Untill now I only can specify which order to sort at the first click. But it should go revers on click #2.

Need some help.
Reply With Quote
  #19  
Old 12-03-2009, 10:40 PM
MjrNuT's Avatar
MjrNuT MjrNuT is offline
 
Join Date: Jun 2008
Location: NorCal
Posts: 77
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This works like a charm for v3.8.4

@ganima -- Not possible I guess. Mine will not resort either. Not critical for me though.
Reply With Quote
  #20  
Old 02-01-2010, 05:07 AM
joshskeety joshskeety is offline
 
Join Date: May 2004
Location: Virginia
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by ganima View Post
Does anybody know how to change sort from DESC to ASC when clicking on the link in the forum?

Untill now I only can specify which order to sort at the first click. But it should go revers on click #2.

Need some help.
Once you've clicked it once you have to click the arrow next to the title to sort up or down
Reply With Quote
  #21  
Old 09-09-2010, 02:31 PM
Jim Westergren Jim Westergren is offline
 
Join Date: Jun 2006
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work with vBulletin 4?
Reply With Quote
Reply

Thread Tools

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

Forum Jump


All times are GMT. The time now is 09:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04506 seconds
  • Memory Usage 2,304KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (6)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete