The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Sort Members By State! Details »» | |||||||||||||||||||||||||
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
|
Comments |
#12
|
||||
|
||||
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?
|
#13
|
|||
|
|||
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">, <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> 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">, <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> 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; } |
#14
|
|||
|
|||
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.
|
#15
|
||||
|
||||
Ah, it works now.. I must of done something wrong.. great hack!
|
#16
|
|||
|
|||
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:
|
#18
|
||||
|
||||
Very nice Justin
I will modify this hack to include English counties and test it out Satan |
#19
|
|||
|
|||
bump
|
#20
|
|||
|
|||
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=
|
#21
|
|||
|
|||
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.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|