vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Style and Graphics Requests (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=226)
-   -   Sort memberlist by location (https://vborg.vbsupport.ru/showthread.php?t=315503)

dknelson 11-19-2014 01:04 PM

Sort memberlist by location
 
Is there a mod out there that allows you to sort the memberlist by location or a custom field? I've created a dropdown menu for people to select their state or province but it is not sortable from the members list. There was a mod for 3.8 that called custom profile field sorting or something like that. I've looked at it but it doesn't appear that it would work for VB4.

If there's not a mod, does anybody know how you would manually edit the memberslist template to add it to a particular field?

ozzy47 11-19-2014 01:51 PM

What's the link to the vB3 version?

nerbert 11-19-2014 03:30 PM

Here's an experiment I tried:
hook location: "memberlist_fetch", in memberlist.php, line 596

Code:

if($_GET['sortbyloc'] == 'sort') {
        $sqlsort = 'userfield.field10';
}

My location field is "field10"

so add "&sortbyloc=sort" to the memberlist URL and I think it'll work.

This is lousy programming but it gets you started

dknelson 11-19-2014 04:10 PM

Quote:

Originally Posted by ozzy47 (Post 2523410)
What's the link to the vB3 version?

This is the one I used for 3.8.

https://vborg.vbsupport.ru/showthread.php?t=124580

--------------- Added [DATE]1416420878[/DATE] at [TIME]1416420878[/TIME] ---------------

Quote:

Originally Posted by nerbert (Post 2523416)
Here's an experiment I tried:
hook location: "memberlist_fetch", in memberlist.php, line 596

Code:

if($_GET['sortbyloc'] == 'sort') {
        $sqlsort = 'userfield.field10';
}

My location field is "field10"

so add "&sortbyloc=sort" to the memberlist URL and I think it'll work.

This is lousy programming but it gets you started

I'm certainly not a coder. I don't completely understand what you are saying. Are you talking about two different edits? Thanks. You say that you experimented with it, did it work?


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00927 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete