Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
Easily create 50-state Thread Prefixes
briansol
Join Date: Apr 2006
Posts: 254

CT
by briansol briansol is offline 11 Jun 2008

Don't feel like entering 50 states selecting all the options each time for prefixes? I didn't either.

If your comfortable with phpmyadmin, this will be easy for you.

Step 1) Make a new Prefix Group.
  • ID = states1
  • name = States
  • Display order = (any you want, given your other lists)
  • forums = select which forums which the prefixes should appear on (i used it on my classifieds area)
  • Save
(Note: The ID of states1 is important, as it must match the file below. The other options can be any values you wish)

Step 2) Run the attached code block from the txt file in phpmyadmin -> SQL tab
  • Note 1: You will need to edit the file FIRST if you used a table prefix (perhaps, vb_ or forum_) on your database. ie, replace "INSERT INTO prefix" with "INSERT INTO vb_prefix" and "insert into phrase" with "insert into vb_phrase". Any decent text editor will allow you do to a global replace.
  • Note 2: This assumes language ID of 0, the default language. I would imagine most people using the states list would have English as their language set. If you are using a different language than default where you want this prefix associated with, you will need to alter the code block from 0 to your language ID as well.
Step 3) verify that you have uploaded everything properly by visiting the prefix group in the ACP. you should see something like the screen shot below.

If not, you may need to click on 'edit' as described in post 3 of this thread.
http://www.vbulletin.org/forum/showp...09&postcount=3

Step 4) Finally, go to a forum you selected in step one, and click new thread. you should see your prefixes listed there.



This list also includes Washington DC.

and feel free to add in Canadian provinces as well if you wish, just follow the same format.

Attached Images
File Type: png prefixes_ss.png (38.9 KB, 408 views)
Attached Files
File Type: txt prefixes.txt (25.3 KB, 56 views)

Last edited by briansol; 31 Jul 2008 at 21:04..
Views: 5192
Reply With Quote
Comments
  #2  
Old 13 Jun 2008, 14:20
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Real name: Joe Velez
thank you - great tip
__________________
Former vBulletin.org Staff Member

Latest Articles:
Liquid Layout = Less Ad Revenue?
How to Monetize Your Site
Improve Web Page Performance
How To Write For The Web


If it needs instructions, there's room for improvement.
Give users what they actually want, not what they say they want. And whatever you do, don't give them new features just because your competitors have them!
Reply With Quote
  #3  
Old 13 Jun 2008, 14:37
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Excellent article although you might want to point out that they have to edit and save one state from the list to have them all show up.
Reply With Quote
  #4  
Old 13 Jun 2008, 20:20
briansol's Avatar
briansol briansol is offline
 
Join Date: Apr 2006
Real name: Brian
Originally Posted by Boofo View Post
Excellent article although you might want to point out that they have to edit and save one state from the list to have them all show up.
i just tried this again and did not have to do this. Anyone else confirm?

--------------- Added 13 Jun 2008 at 20:24 ---------------

I also just noticed that i'm missing a state.

I have washington DC in there, and the list only goes to 50.

rep points to the first person who finds the state i forgot, and then i will edit the file(s).

Last edited by briansol; 13 Jun 2008 at 20:24. Reason: Auto-Merged DoublePost
Reply With Quote
  #5  
Old 13 Jun 2008, 23:29
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
When I added the SQL queries from the text file, they ran fine. My listing showed like your pic in the first post except it had no state names on the left column. That is when I clicked on the edit button for one of the states and saved it without doing anything to it and then the whole list showed up fine.

I was just on my way up to report about the missing state. I haven't looked closely enough to figure out which one yet, though.
Reply With Quote
  #6  
Old 29 Jun 2008, 20:56
Grampz Grampz is offline
 
Join Date: Apr 2006
Originally Posted by briansol View Post
i just tried this again and did not have to do this. Anyone else confirm?

--------------- Added 13 Jun 2008 at 20:24 ---------------

I also just noticed that i'm missing a state.

I have washington DC in there, and the list only goes to 50.

rep points to the first person who finds the state i forgot, and then i will edit the file(s).
Washington D.C. is not a state. The state you forgot is Virginia.
Reply With Quote
  #7  
Old 31 Jul 2008, 21:05
briansol's Avatar
briansol briansol is offline
 
Join Date: Apr 2006
Real name: Brian
Thanks.

VA has been added, and the file updated.


While DC is technically not a state, it is an 'area' that could be considered useful for geographic location on classified forums, etc.
Reply With Quote
  #8  
Old 18 Sep 2008, 21:31
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Real name: Brandon
great article
__________________

Love and support one another #vote2020
I offer Managed IT Services in Kansas
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

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


New To Site? Need Help?

All times are GMT. The time now is 21:13.

Layout Options | Width: Wide Color: