PDA

View Full Version : Sort Users By State


joeychgo
07-31-2004, 05:06 AM
Looking for something similar to this for 3.0

https://vborg.vbsupport.ru/showthread.php?t=54010&highlight=user+location

joeychgo
08-01-2004, 04:10 PM
bump

joeychgo
08-15-2004, 10:01 PM
bump

oldford
08-21-2004, 03:07 AM
I just did this tonight. I'm sure it's not the cleanest way to do things, but it works for me. Screenshot attached.

All I did was copy the advanced search code for "search by state" and put it at the top of my Member List so people could search it more easily.

1. Create a new "User Profile Field" named State. Make it a "single selection menu" field and add in all your states. (See a list of US states at the bottom of this post to copy and paste) Be sure to also set "Field Searchable on Members List" to "yes".

2. Note what field # your new State field is. (ie. mine was field10)

3. Edit your "memberlist" template.

Below this code:
<body>
$header
$navbar

Add this: (but be sure to change the field # to your correct #. See item 2 above)

<form action="memberlist.php" method="post">
<input type="hidden" name="s" value="" />
<input type="hidden" name="do" value="getall" />
Search Members by State: <select name="field10" id="csel_field10"><option value="0" selected="selected"></option>
<option value="1" >AL</option><option value="2" >AK</option><option value="3" >AZ</option><option value="4" >AR</option><option value="5" >CA</option><option value="6" >CO</option><option value="7" >CT</option><option value="8" >DE</option><option value="9" >DC</option><option value="10" >FL</option><option value="11" >GA</option><option value="12" >HI</option><option value="13" >ID</option><option value="14" >IL</option><option value="15" >IN</option><option value="16" >IA</option><option value="17" >KS</option><option value="18" >KY</option><option value="19" >LA</option><option value="20" >ME</option><option value="21" >MD</option><option value="22" >MA</option><option value="23" >MI</option><option value="24" >MN</option><option value="25" >MS</option><option value="26" >MO</option><option value="27" >MT</option><option value="28" >NE</option><option value="29" >NV</option><option value="30" >NH</option><option value="31" >NJ</option><option value="32" >NM</option><option value="33" >NY</option><option value="34" >NC</option><option value="35" >ND</option><option value="36" >OH</option><option value="37" >OK</option><option value="38" >OR</option><option value="39" >PA</option><option value="40" >RI</option><option value="41" >SC</option><option value="42" >SD</option><option value="43" >TN</option><option value="44" >TX</option><option value="45" >UT</option><option value="46" >VT</option><option value="47" >VA</option><option value="48" >WA</option><option value="49" >WV</option><option value="50" >WI</option><option value="51" >WY</option></select> <input type="submit" class="button" value="Search" accesskey="s" />
</form>

The above search code willl only work if you use the same exact list of states I did. If you modify it you'll need to modify the code accordingly. Or just view the source code of your "advanced search" page and steal the Search by State bit.


Here's is a list of US states to copy and paste.
AL
AK
AZ
AR
CA
CO
CT
DE
DC
FL
GA
HI
ID
IL
IN
IA
KS
KY
LA
ME
MD
MA
MI
MN
MS
MO
MT
NE
NV
NH
NJ
NM
NY
NC
ND
OH
OK
OR
PA
RI
SC
SD
TN
TX
UT
VT
VA
WA
WV
WI
WY

joeychgo
08-21-2004, 06:38 AM
is there any way to base it off zip code? Many already have that in the profile for weather data, etc..............

shunx91
01-19-2006, 11:33 PM
When I tried to enter this vBulletin gave me this message :(


You may only specify up to 32 options for checkbox or select_multiple input types. You entered 51 options for this field.


Any idea how to fix this?

Also, if I add this new profile field as "required" what would happen to the existing members on the foruM?