vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Sort Members By State! (https://vborg.vbsupport.ru/showthread.php?t=54010)

Xelation 06-08-2003 03:28 PM

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?

ranger2kxlt 06-08-2003 03:40 PM

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;
  }


ranger2kxlt 06-08-2003 03:46 PM

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. :)

Xelation 06-08-2003 03:48 PM

Ah, it works now.. I must of done something wrong.. great hack! :)

ranger2kxlt 06-08-2003 03:53 PM

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!

ranger2kxlt 06-08-2003 03:54 PM

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!

Chris M 06-08-2003 07:50 PM

Very nice Justin:)

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

Satan

ranger2kxlt 06-10-2003 01:31 AM

bump

99SIVTEC 06-10-2003 03:06 AM

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=

ranger2kxlt 06-23-2003 01:12 PM

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.


All times are GMT. The time now is 07:27 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.04742 seconds
  • Memory Usage 1,790KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete