Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Sort Members By State! Details »»
Sort Members By State!
Version: 1.00, by ranger2kxlt ranger2kxlt is offline
Developer Last Online: Jan 2011 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 06-07-2003 Last Update: Never Installs: 7
 
No support by the author.

Well since no one offered to make it for me, I have made it myself. I now have the full working version of the sort by state hack.

This is a rather large hack, although easy.
Install Time: 15 mins

Alright basically, I took out the default Location field in the vbulletin registration process and hardcoded a new one in. This does require you to lose data regarding you members locations. Simply PM all of them and ask them to update their profiles afterwards making the change.

Anyways. When you do sort by state, I took into account that some people will not return to your site and/or will not edit their profile, and therefor when you do sort by state, anyone with an invalid or blank state field will not be displayed. On my site this is a required field and it is set up that way in this hack.

You can see a live sample of this hack at my site,
http://www.thunderbirdnest.com/vb/me...?s=&what=state

Alright... one more thing before we get to the file.

There is more to come in the future.
1) Admin Functions - I would like to add the ability for admins to edit the location of members after this hack. They can still do if via the database.
2) State by State Sorting - View members from a single state of your choosing instead of all states.

[high]THIS HACK IS ONLY SET UP TO SUPPORT THE UNITED STATES AND CANADA! BUT IT CAN BE EASILY MODIFIED FOR THOSE THAT NEED IT BY COUNTRY![/high]

Please read through the hack slowly and carefully and as normal back up your files before you edit them.


One final note I promise. Thanks to hellsatan for his assistance on a few sections of this hack. I greatly appreciated his assistance.

[high]DOWNLOAD ATTACHMENT HERE![/high]

Show Your Support

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

Comments
  #12  
Old 06-08-2003, 03:28 PM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

just installed it with a few modifications such as full names for the states and I added provinces.... I was wondering though, when someone modifies their profile and say they pick newyorkstate.... when they click modify at the bottom everything is changed correctly but when they go to modify it again its back at alabama and I was wondering, what would I need to do to keep it at the state they picked.. get what I mean?
Reply With Quote
  #13  
Old 06-08-2003, 03:40 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes...

When you made this modification, you would have needed to edit 3 different places!

First is registeradult template... add your provinces etc.
Code:
	<td bgcolor="{secondaltcolor}"><normalfont><b>Location (City, State):</b></normalfont><br>
        <smallfont>Your Location</smallfont></td>
	<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="city" size="25" maxlength="50">,&nbsp;<select name="state" size="1">
                <OPTION>AL</OPTION>
                <OPTION>AK</OPTION>
                <OPTION>AZ</OPTION>
                <OPTION>AR</OPTION>
                <OPTION>CA</OPTION>
                <OPTION>CAN</OPTION>
                <OPTION>CO</OPTION>
                <OPTION>CT</OPTION>
                <OPTION>DE</OPTION>
                <OPTION>FL</OPTION>
                <OPTION>GA</OPTION>
                <OPTION>HI</OPTION>
                <OPTION>ID</OPTION>
                <OPTION>IL</OPTION>
                <OPTION>IN</OPTION>
                <OPTION>IA</OPTION>
                <OPTION>KS</OPTION>
                <OPTION>KY</OPTION>
                <OPTION>LA</OPTION>
                <OPTION>ME</OPTION>
                <OPTION>MD</OPTION>
                <OPTION>MA</OPTION>
                <OPTION>MI</OPTION>
                <OPTION>MN</OPTION>
                <OPTION>MS</OPTION>
                <OPTION>MO</OPTION>
                <OPTION>MT</OPTION>
                <OPTION>NE</OPTION>
                <OPTION>NV</OPTION>
                <OPTION>NH</OPTION>
                <OPTION>NJ</OPTION>
                <OPTION>NM</OPTION>
                <OPTION>NY</OPTION>
                <OPTION>NC</OPTION>
                <OPTION>ND</OPTION>
                <OPTION>OH</OPTION>
                <OPTION>OK</OPTION>
                <OPTION>OR</OPTION>
                <OPTION>PA</OPTION>
                <OPTION>RI</OPTION>
                <OPTION>SC</OPTION>
                <OPTION>SD</OPTION>
                <OPTION>TN</OPTION>
                <OPTION>TX</OPTION>
                <OPTION>UT</OPTION>
                <OPTION>VT</OPTION>
                <OPTION>VA</OPTION>
                <OPTION>WA</OPTION>
                <OPTION>WV</OPTION>
                <OPTION>WI</OPTION>
                <OPTION>WY</OPTION>
	</select></normalfont></td>
	</tr>
Next would be modifyprofile: Make sure the $location increments with each additional state/province you add.
Code:
	<tr>
	<td bgcolor="{secondaltcolor}"><normalfont><b>Location (City, State):</b></normalfont><br>
                <smallfont>Your Location</smallfont></td>
	<td bgcolor="{secondaltcolor}"><normalfont><input type="text" class="bginput" name="city" value="$bbuserinfo[city]" size="25" maxlength="50">,&nbsp;<select name="state" value="$bbuserinfo[state]" size="1">
	<OPTION $location2>AL</OPTION>
	<OPTION $location3>AK</OPTION>
	<OPTION $location4>AZ</OPTION>
	<OPTION $location5>AR</OPTION>
	<OPTION $location6>CA</OPTION>
	<OPTION $location1>CAN</OPTION>
	<OPTION $location7>CO</OPTION>
	<OPTION $location8>CT</OPTION>
	<OPTION $location9>DE</OPTION>
	<OPTION $location10>FL</OPTION>
	<OPTION $location11>GA</OPTION>
	<OPTION $location12>HI</OPTION>
	<OPTION $location13>ID</OPTION>
	<OPTION $location14>IL</OPTION>
	<OPTION $location15>IN</OPTION>
	<OPTION $location16>IA</OPTION>
	<OPTION $location17>KS</OPTION>
	<OPTION $location18>KY</OPTION>
	<OPTION $location19>LA</OPTION>
	<OPTION $location20>ME</OPTION>
	<OPTION $location21>MD</OPTION>
	<OPTION $location22>MA</OPTION>
	<OPTION $location23>MI</OPTION>
	<OPTION $location24>MN</OPTION>
	<OPTION $location25>MS</OPTION>
	<OPTION $location26>MO</OPTION>
	<OPTION $location27>MT</OPTION>
	<OPTION $location28>NE</OPTION>
	<OPTION $location29>NV</OPTION>
	<OPTION $location30>NH</OPTION>
	<OPTION $location31>NJ</OPTION>
	<OPTION $location32>NM</OPTION>
	<OPTION $location33>NY</OPTION>
	<OPTION $location34>NC</OPTION>
	<OPTION $location35>ND</OPTION>
	<OPTION $location36>OH</OPTION>
	<OPTION $location37>OK</OPTION>
	<OPTION $location38>OR</OPTION>
	<OPTION $location39>PA</OPTION>
	<OPTION $location40>RI</OPTION>
	<OPTION $location41>SC</OPTION>
	<OPTION $location42>SD</OPTION>
	<OPTION $location43>TN</OPTION>
	<OPTION $location44>TX</OPTION>
	<OPTION $location45>UT</OPTION>
	<OPTION $location46>VT</OPTION>
	<OPTION $location47>VA</OPTION>
	<OPTION $location48>WA</OPTION>
	<OPTION $location49>WV</OPTION>
	<OPTION $location50>WI</OPTION>
	<OPTION $location51>WY</OPTION>
	</select></normalfont></td>
	</tr>
Then and here is probably where you need it. Make sure the $locations match up with the modify profile template.
Member.php
Code:
  if ($bbuserinfo[state] == 'CAN') {
    $location1 = SELECTED;
  } elseif ($bbuserinfo[state] == 'AL') {
    $location2 = SELECTED;
  } elseif ($bbuserinfo[state] == 'AK') {
    $location3 = SELECTED;
  } elseif ($bbuserinfo[state] == 'AZ') { 
    $location4 = SELECTED;
  } elseif ($bbuserinfo[state] == 'AR') { 
    $location5 = SELECTED;
  } elseif ($bbuserinfo[state] == 'CA') { 
    $location6 = SELECTED;
  } elseif ($bbuserinfo[state] == 'CO') { 
    $location7 = SELECTED;
  } elseif ($bbuserinfo[state] == 'CT') { 
    $location8 = SELECTED;
  } elseif ($bbuserinfo[state] == 'DE') { 
    $location9 = SELECTED;
  } elseif ($bbuserinfo[state] == 'FL') { 
    $location10 = SELECTED;
  } elseif ($bbuserinfo[state] == 'GA') { 
    $location11 = SELECTED;
  } elseif ($bbuserinfo[state] == 'HI') { 
    $location12 = SELECTED;
  } elseif ($bbuserinfo[state] == 'ID') { 
    $location13 = SELECTED;
  } elseif ($bbuserinfo[state] == 'IL') { 
    $location14 = SELECTED;
  } elseif ($bbuserinfo[state] == 'IN') { 
    $location15 = SELECTED;
  } elseif ($bbuserinfo[state] == 'IO') { 
    $location16 = SELECTED;
  } elseif ($bbuserinfo[state] == 'KS') { 
    $location17 = SELECTED;
  } elseif ($bbuserinfo[state] == 'KY') { 
    $location18 = SELECTED;
  } elseif ($bbuserinfo[state] == 'LA') { 
    $location19 = SELECTED;
  } elseif ($bbuserinfo[state] == 'ME') { 
    $location20 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MD') { 
    $location21 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MA') { 
    $location22 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MI') { 
    $location23 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MN') { 
    $location24 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MS') { 
    $location25 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MO') { 
    $location26 = SELECTED;
  } elseif ($bbuserinfo[state] == 'MT') { 
    $location27 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NE') { 
    $location28 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NV') { 
    $location29 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NH') { 
    $location30 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NJ') { 
    $location31 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NM') { 
    $location32 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NY') { 
    $location33 = SELECTED;
  } elseif ($bbuserinfo[state] == 'NC') { 
    $location34 = SELECTED;
  } elseif ($bbuserinfo[state] == 'ND') { 
    $location35 = SELECTED;
  } elseif ($bbuserinfo[state] == 'OH') { 
    $location36 = SELECTED;
  } elseif ($bbuserinfo[state] == 'OK') { 
    $location37 = SELECTED;
  } elseif ($bbuserinfo[state] == 'OR') { 
    $location38 = SELECTED;
  } elseif ($bbuserinfo[state] == 'PA') { 
    $location39 = SELECTED;
  } elseif ($bbuserinfo[state] == 'RI') { 
    $location40 = SELECTED;
  } elseif ($bbuserinfo[state] == 'SC') { 
    $location41 = SELECTED;
  } elseif ($bbuserinfo[state] == 'SD') { 
    $location42 = SELECTED;
  } elseif ($bbuserinfo[state] == 'TN') { 
    $location43 = SELECTED;
  } elseif ($bbuserinfo[state] == 'TX') { 
    $location44 = SELECTED;
  } elseif ($bbuserinfo[state] == 'UT') { 
    $location45 = SELECTED;
  } elseif ($bbuserinfo[state] == 'VT') { 
    $location46 = SELECTED;
  } elseif ($bbuserinfo[state] == 'VA') { 
    $location47 = SELECTED;
  } elseif ($bbuserinfo[state] == 'WA') { 
    $location48 = SELECTED;
  } elseif ($bbuserinfo[state] == 'WV') { 
    $location49 = SELECTED;
  } elseif ($bbuserinfo[state] == 'WI') { 
    $location50 = SELECTED;
  } elseif ($bbuserinfo[state] == 'WY') { 
    $location51 = SELECTED;
  }
Reply With Quote
  #14  
Old 06-08-2003, 03:46 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just a clarification note for the others that are looking to install this hack... It works fully on mine. When a user edits their profile it does show their previous location and state with no problems.
Reply With Quote
  #15  
Old 06-08-2003, 03:48 PM
Xelation's Avatar
Xelation Xelation is offline
 
Join Date: Jan 2002
Location: Buffalo, New York
Posts: 457
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, it works now.. I must of done something wrong.. great hack!
Reply With Quote
  #16  
Old 06-08-2003, 03:53 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Found a VERY minor bug. I had originally set up the state row in the user table to only accept 2 characters because I was only planning to use states. Then after a member notified me that everytime they selected CAN (Canada) their profile would display CA (California). So I made the change.

For those of you that have already installed this, Run this query!
PHP Code:
ALTER TABLE `userCHANGE `state` `stateCHARNOT NULL 
Here is the new attachment!
Reply With Quote
  #17  
Old 06-08-2003, 03:54 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Today at 11:48 AM Xelation said this in Post #14
Ah, it works now.. I must of done something wrong.. great hack!
Thank you!
Reply With Quote
  #18  
Old 06-08-2003, 07:50 PM
Chris M's Avatar
Chris M Chris M is offline
 
Join Date: Dec 2001
Location: Northampton, England
Posts: 6,186
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice Justin

I will modify this hack to include English counties and test it out

Satan
Reply With Quote
  #19  
Old 06-10-2003, 01:31 AM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bump
Reply With Quote
  #20  
Old 06-10-2003, 03:06 AM
99SIVTEC 99SIVTEC is offline
 
Join Date: Nov 2001
Posts: 281
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Has anyone taken this a step further and made a US map that is clickable like the one over at http://dodgetalk.com/forums/memberstates.php?s=
Reply With Quote
  #21  
Old 06-23-2003, 01:12 PM
ranger2kxlt ranger2kxlt is offline
 
Join Date: Jan 2003
Location: Plano, TX
Posts: 272
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have not done so yet, but my plans are to do so in the future so states can be sorted seperatly instead of one large listing, kinda like the way the usernames can be sorted by letter in alphabetical order.
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 05:59 AM.


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.04731 seconds
  • Memory Usage 2,325KB
  • Queries Executed 27 (?)
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
  • (3)bbcode_code
  • (1)bbcode_php
  • (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
  • (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_postinfo_query
  • fetch_postinfo
  • 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