home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (united_states_840_1.cif)

This example Drupal source code file (united_states_840_1.cif) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

armed, array, forces, foreach, function, into, islands, new, of, php, south, virginia, zone

The united_states_840_1.cif Drupal example source code

<?php
// $Id: united_states_840_1.cif,v 1.5.2.3 2010/02/21 03:43:00 tr Exp $

function united_states_install() {
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  db_query("INSERT INTO {uc_countries} (country_id, country_name, country_iso_code_2, country_iso_code_3, version) VALUES (840, 'United States', 'US', 'USA', 1)");

  // Make the entries in the zones table.
  $zones = array(
    array(840, 'AL', 'Alabama'),
    array(840, 'AK', 'Alaska'),
    array(840, 'AS', 'American Samoa'),
    array(840, 'AZ', 'Arizona'),
    array(840, 'AR', 'Arkansas'),
    array(840, 'AF', 'Armed Forces Africa'),
    array(840, 'AA', 'Armed Forces Americas'),
    array(840, 'AC', 'Armed Forces Canada'),
    array(840, 'AE', 'Armed Forces Europe'),
    array(840, 'AM', 'Armed Forces Middle East'),
    array(840, 'AP', 'Armed Forces Pacific'),
    array(840, 'CA', 'California'),
    array(840, 'CO', 'Colorado'),
    array(840, 'CT', 'Connecticut'),
    array(840, 'DE', 'Delaware'),
    array(840, 'DC', 'District of Columbia'),
    array(840, 'FM', 'Federated States Of Micronesia'),
    array(840, 'FL', 'Florida'),
    array(840, 'GA', 'Georgia'),
    array(840, 'GU', 'Guam'),
    array(840, 'HI', 'Hawaii'),
    array(840, 'ID', 'Idaho'),
    array(840, 'IL', 'Illinois'),
    array(840, 'IN', 'Indiana'),
    array(840, 'IA', 'Iowa'),
    array(840, 'KS', 'Kansas'),
    array(840, 'KY', 'Kentucky'),
    array(840, 'LA', 'Louisiana'),
    array(840, 'ME', 'Maine'),
    array(840, 'MH', 'Marshall Islands'),
    array(840, 'MD', 'Maryland'),
    array(840, 'MA', 'Massachusetts'),
    array(840, 'MI', 'Michigan'),
    array(840, 'MN', 'Minnesota'),
    array(840, 'MS', 'Mississippi'),
    array(840, 'MO', 'Missouri'),
    array(840, 'MT', 'Montana'),
    array(840, 'NE', 'Nebraska'),
    array(840, 'NV', 'Nevada'),
    array(840, 'NH', 'New Hampshire'),
    array(840, 'NJ', 'New Jersey'),
    array(840, 'NM', 'New Mexico'),
    array(840, 'NY', 'New York'),
    array(840, 'NC', 'North Carolina'),
    array(840, 'ND', 'North Dakota'),
    array(840, 'MP', 'Northern Mariana Islands'),
    array(840, 'OH', 'Ohio'),
    array(840, 'OK', 'Oklahoma'),
    array(840, 'OR', 'Oregon'),
    array(840, 'PW', 'Palau'),
    array(840, 'PA', 'Pennsylvania'),
    array(840, 'PR', 'Puerto Rico'),
    array(840, 'RI', 'Rhode Island'),
    array(840, 'SC', 'South Carolina'),
    array(840, 'SD', 'South Dakota'),
    array(840, 'TN', 'Tennessee'),
    array(840, 'TX', 'Texas'),
    array(840, 'UT', 'Utah'),
    array(840, 'VT', 'Vermont'),
    array(840, 'VI', 'Virgin Islands'),
    array(840, 'VA', 'Virginia'),
    array(840, 'WA', 'Washington'),
    array(840, 'WV', 'West Virginia'),
    array(840, 'WI', 'Wisconsin'),
    array(840, 'WY', 'Wyoming'),
  );

  foreach ($zones as $zone) {
    db_query("INSERT INTO {uc_zones} (zone_country_id, zone_code, zone_name) VALUES (%d, '%s', '%s')", $zone);
  }

  variable_set('uc_address_format_840',
               "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
              ."\r\n!city, !zone_code !postal_code\r\n!country_name_if");
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal united_states_840_1.cif source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.