Go Back   vb.org Archive > vBulletin Article Depository > Read An Article > vBulletin 3 Articles
Easily create 50-state Thread Prefixes
briansol's Avatar
briansol
Join Date: Apr 2006
Posts: 254

 

CT
Show Printable Version Email this Page Subscription
briansol briansol is offline 06-10-2008, 10:00 PM

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.
https://vborg.vbsupport.ru/showpost....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.

:up:
Attached Images
File Type: png prefixes_ss.png (38.9 KB, 0 views)
Attached Files
File Type: txt prefixes.txt (25.3 KB, 60 views)
Reply With Quote
  #2  
Old 06-13-2008, 01:20 PM
Princeton's Avatar
Princeton Princeton is offline
 
Join Date: Nov 2001
Location: Vineland, NJ
Posts: 6,693
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thank you - great tip :up:
Reply With Quote
  #3  
Old 06-13-2008, 01:37 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 06-13-2008, 07:20 PM
briansol's Avatar
briansol briansol is offline
 
Join Date: Apr 2006
Location: CT
Posts: 254
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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 [DATE]1213388640[/DATE] at [TIME]1213388640[/TIME] ---------------

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).
Reply With Quote
  #5  
Old 06-13-2008, 10:29 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 06-29-2008, 07:56 PM
Grampz Grampz is offline
 
Join Date: Apr 2006
Location: Missouri
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by briansol View Post
i just tried this again and did not have to do this. Anyone else confirm?

--------------- Added [DATE]1213388640[/DATE] at [TIME]1213388640[/TIME] ---------------

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 07-31-2008, 08:05 PM
briansol's Avatar
briansol briansol is offline
 
Join Date: Apr 2006
Location: CT
Posts: 254
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 09-18-2008, 08:31 PM
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Location: Google Kansas
Posts: 4,678
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great article
Reply With Quote
Reply

Thread Tools

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 01:00 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.18137 seconds
  • Memory Usage 2,283KB
  • Queries Executed 24 (?)
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
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_article
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (2)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete