--- zipcode.module	2009-08-26 18:32:02.000000000 +0200
+++ zipcodeNEW.module	2010-02-07 13:53:10.537624465 +0100
@@ -34,6 +34,7 @@ function zipcode_field_info() {
     'us_zipcode' => array('label' => t('US zipcodes')),
     'uk_zipcode' => array('label' => t('United Kingdom postal codes')),    
     'nl_zipcode' => array('label' => t('Dutch zipcodes')),
+    'hu_zipcode' => array('label' => t('Hungarian zipcodes')),    
     'au_zipcode' => array('label' => t('Australian zipcodes')),    
     'dk_zipcode' => array('label' => t('Danish zipcodes')),
     'pt_zipcode' => array('label' => t('Portuguese zipcodes')),    
@@ -120,6 +121,11 @@ function zipcode_field_settings($op, $fi
         	'value' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
       	);
       } 
+      if ($field['type'] == 'hu_zipcode') { 
+      	$columns = array(
+        	'value' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
+      	);
+      }   
       if ($field['type'] == 'au_zipcode') { 
       	$columns = array(
         	'value' => array('type' => 'varchar', 'length' => 255, 'not null' => FALSE),
@@ -194,6 +200,9 @@ function zipcode_field($op, &$node, $fie
           if ($field['type'] == 'nl_zipcode' && !valid_zipcode('nl', $item['value'])) {
 	    form_set_error($field['field_name'], t('"%value" is not a valid Dutch zipcode.<br>Zipcodes should contain 4 numbers followed by 2 letter',array('%value' => $item['value'])));
           }
+          if ($field['type'] == 'hu_zipcode' && !valid_zipcode('hu', $item['value'])) {
+	    form_set_error($field['field_name'], t('"%value" is not a valid Hungarian zipcode.<br>Zipcodes should contain 4 numbers',array('%value' => $item['value'])));
+          }         
           if ($field['type'] == 'au_zipcode' && !valid_zipcode('au', $item['value'])) {
 	    form_set_error($field['field_name'], t('"%value" is not a valid Australian zipcode.<br>Zipcodes should contain 4 numbers',array('%value' => $item['value'])));
           }         
@@ -226,6 +235,9 @@ function zipcode_field($op, &$node, $fie
           if ($field['type'] == 'nl_zipcode') {
             $node_field[$delta]['value'] = format_zipcode('nl', $node_field[$delta]['value'], $field);
           }          
+          if ($field['type'] == 'hu_zipcode') {
+            $node_field[$delta]['value'] = format_zipcode('hu', $node_field[$delta]['value'], $field);
+          }
           if ($field['type'] == 'au_zipcode') {
             $node_field[$delta]['value'] = format_zipcode('au', $node_field[$delta]['value'], $field);
           }
@@ -331,6 +343,7 @@ function zipcode_field_formatter_info() 
       			'us_zipcode', 
       			'uk_zipcode', 
       			'nl_zipcode', 
+      			'hu_zipcode',
       			'au_zipcode',
       			'dk_zipcode',
       			'pt_zipcode'      			
@@ -402,6 +415,7 @@ function zipcode_widget_info() {
       			'us_zipcode', 
       			'uk_zipcode', 
       			'nl_zipcode', 
+      			'hu_zipcode',
       			'au_zipcode',
       			'dk_zipcode',
       			'pt_zipcode'      			
@@ -616,6 +630,7 @@ function valid_zipcode($countrycode, $zi
   	|| $countrycode == 'us'
   	|| $countrycode == 'uk'
   	|| $countrycode == 'nl'
+  	|| $countrycode == 'hu'
   	|| $countrycode == 'au'
   	|| $countrycode == 'dk'
   	|| $countrycode == 'pt'  	
@@ -656,6 +671,7 @@ function format_zipcode($countrycode, $z
   	|| $countrycode == 'us'
   	|| $countrycode == 'uk'
   	|| $countrycode == 'nl'
+  	|| $countrycode == 'hu'
   	|| $countrycode == 'au'
   	|| $countrycode == 'dk'
   	|| $countrycode == 'pt'  	
