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

Drupal example source code file (ireland_372_2.cif)

This example Drupal source code file (ireland_372_2.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

array, co, function, galway, kildare, leitrim, louth, meath, php, street2, tipperary, version, zone_name

The ireland_372_2.cif Drupal example source code

<?php
// $Id: ireland_372_2.cif,v 1.1.2.9 2010/04/14 05:18:19 tr Exp $

// Note: Ireland does not currently have postal codes but it has been announced
// that they will be implemented - so I left the postal code in the address definition.
// http://www.dcmnr.gov.ie/Press+Releases/Dempsey+announces+programme+to+introduce+postcodes+in+Ireland+by+1st+January+2008.htm
//

function ireland_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 ('372', 'Ireland', 'IE', 'IRL', 2)");

  // Make the entries in the zones table.
  $zones = array(
    array(372, 'CARLOW', 'Co. Carlow'),
    array(372, 'CAVAN', 'Co. Cavan'),
    array(372, 'CLARE', 'Co. Clare'),
    array(372, 'CORK', 'Co. Cork'),
    array(372, 'DONEGAL', 'Co. Donegal'),
    array(372, 'DUBLIN', 'Co. Dublin'),
    array(372, 'GALWAY', 'Co. Galway'),
    array(372, 'KERRY', 'Co. Kerry'),
    array(372, 'KILDARE', 'Co. Kildare'),
    array(372, 'KILKENNY', 'Co. Kilkenny'),
    array(372, 'LAOIS', 'Co. Laois'),
    array(372, 'LEITRIM', 'Co. Leitrim'),
    array(372, 'LIMERICK', 'Co. Limerick'),
    array(372, 'LONGFORD', 'Co. Longford'),
    array(372, 'LOUTH', 'Co. Louth'),
    array(372, 'MAYO', 'Co. Mayo'),
    array(372, 'MEATH', 'Co. Meath'),
    array(372, 'MONAGHAN', 'Co. Monaghan'),
    array(372, 'OFFALY', 'Co. Offaly'),
    array(372, 'ROSCOMMON', 'Co. Roscommon'),
    array(372, 'SLIGO', 'Co. Sligo'),
    array(372, 'TIPPERARY', 'Co. Tipperary'),
    array(372, 'WATERFORD', 'Co. Waterford'),
    array(372, 'WESTMEATH', 'Co. Westmeath'),
    array(372, 'WEXFORD', 'Co. Wexford'),
    array(372, 'WICKLOW', 'Co. Wicklow'),
  );

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

  uc_set_address_format(372,
    "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
   ."\r\n!city, !zone_name !postal_code\r\n!country_name_if");
}

function ireland_update($version) {
  switch ($version) {
    case 2:
      uc_set_address_format(372,
        "!company\r\n!first_name !last_name\r\n!street1\r\n!street2"
       ."\r\n!city, !zone_name !postal_code\r\n!country_name_if");
      break;
  }
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal ireland_372_2.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.