Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

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
  #22  
Old 09-13-2012, 11:09 PM
Superorb Superorb is offline
 
Join Date: Feb 2012
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone found a way to get this working on 4.2?
Reply With Quote
  #23  
Old 07-10-2013, 08:25 AM
Charis Charis is offline
 
Join Date: Oct 2009
Location: Thessaloniki, Greece
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Superorb View Post
Has anyone found a way to get this working on 4.2?
Anyone?
Reply With Quote
Reply


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 03:51 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.03862 seconds
  • Memory Usage 2,224KB
  • Queries Executed 17 (?)
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
  • (1)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
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (2)postbit
  • (3)postbit_onlinestatus
  • (3)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