=== modified file 'uc_lto.module'
--- uc_lto.module	2010-06-06 15:47:59 +0000
+++ uc_lto.module	2010-06-08 07:55:34 +0000
@@ -343,9 +343,23 @@
     'uc_lto_status' => array(
       'arguments' => array('form' => NULL),
     ),
+#    'views_view_field__expiration' => array (
+#    'arguments' => array('element'=> NULL),
+#    'template' => 'views-view-field--expiration',
+##      'original hook' => 'views_view',
+#      'path' => drupal_get_path('module', 'uc_lto'),
+#      ),
+#      'preprocess functions' => array(
+#        'template_preprocess',
+#        'template_preprocess_views_view_field',
+#        'uc_lto_preprocess_views_view_field__expiration',
+#      ),  
   );
 }
 
+#function uc_lto_preprocess_views_view_field__expiration(&$variables) {
+#}
+
 /**
  * Form embedded into node to display expiration status.
  */
@@ -457,4 +471,15 @@
       'uc_lto_box' => $form_state['values']['fields']['uc_lto_box'],
     ));
   }
-}
\ No newline at end of file
+}
+
+/**
+ * Implementation of hook_views_api().
+ */
+function uc_lto_views_api() {
+  return array(
+    'api' => '2.0',
+    'path' => drupal_get_path('module', 'uc_lto'),
+  );
+}
+

=== added file 'uc_lto.views.inc'
--- uc_lto.views.inc	1970-01-01 00:00:00 +0000
+++ uc_lto.views.inc	2010-06-08 07:56:26 +0000
@@ -0,0 +1,203 @@
+<?php
+// $Id$
+
+/**
+* @file
+* Views 2 hooks and callback
+* to add lto to views2
+* 
+*/
+ 
+ function uc_lto_views_data() {
+ 
+ $data['uc_lto']['table']['group'] = t('Lto');
+
+ $data['uc_lto']['table']['join']['node'] = array(
+	  'left_field' => 'nid',
+	       'field' => 'nid',
+	);
+
+$data['uc_lto']['nid'] = array(
+  'title' => t('Nid'),
+  'help' => t('The node ID of the node.'), // The help that appears on the UI,
+
+  'relationship' => array(
+	  'base' => 'node',
+	  'field' => 'nid',
+	  'handler' => 'views_handler_relationship',
+	  'label' => t('Limited time offer nid'),
+	),
+ // Information for accepting a nid as an argument
+  'argument' => array(
+     'handler' => 'views_handler_argument_node_nid',
+     'name field' => 'title', // the field to display in the summary.
+     'numeric' => TRUE,
+     'validate type' => 'nid',
+   ),
+ );
+
+ // timestamp field.
+$data['uc_lto']['expiration'] = array(
+  'title' => t('Expiration'),
+  'help' => t('When the limited time offer expire.'),
+  'field' => array(
+    'handler' => 'views_handler_field_expiration',
+   ),
+  'sort' => array(
+    'handler' => 'views_handler_sort_date',
+   ),
+  'filter' => array(
+    'handler' => 'views_handler_filter_date',
+   ),
+ );
+
+ return $data;
+}
+
+/**
+ * A handler to provide proper displays for expitation time.
+ *
+ * @ingroup views_field_handlers
+ */
+ 
+module_load_include('inc', 'views', 'handlers/views_handler_field');  
+
+class views_handler_field_expiration extends views_handler_field {
+  function option_definition() {
+    $options = parent::option_definition();
+
+    $options['date_format'] = array('default' => (variable_get('uc_lto_time_format',FALSE)?variable_get('uc_lto_time_format',FALSE):''));
+
+    return $options;
+  }
+
+  function options_form(&$form, &$form_state) {
+    parent::options_form($form, $form_state);
+    $time = time();
+
+    unset($form['alter']);
+    
+    $form['label']['#description'] = "Label used when the offer is active. Please choose a label that fits expiration time style, like 'expire on' for time of expiration or 'expire in' for time left or countdown.";
+    $form['label']['#default_value'] = 'Expires in';
+    
+    $form['lto_format'] = array(
+      '#type' => 'select',
+      '#title' => t('Choose how to show expiration time'),
+      '#options' => array(
+         '3' => 'LTO - Display time of expiration',
+         '6' => 'LTO - Display time left w/o active countdown',
+         '9' => 'LTO - Active javascript countdown',
+     ),
+      '#default_value' => isset($this->options['lto_format']) ? $this->options['lto_format'] : '9',
+    );
+    
+    $form['date_format'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Date format'),
+      '#description' => t('See <a href="http://us.php.net/manual/en/function.date.php" target="_blank">the PHP docs</a> for date formats. leave blank to use default format defined in Limited Times Offer Settings.'),
+      '#default_value' => isset($this->options['date_format']) ? $this->options['date_format'] : '',
+      '#process' => array('views_process_dependency'),
+      '#dependency' => array('edit-options-lto-format' => array('3', '6',)),
+    );
+    
+    $form['lto_js'] = array(
+      '#type' => 'select',
+      '#title' => t('Js style'),
+      '#description' => t('Js controlling the way the active countdown timer is displayed.'),
+      '#options' => array(
+         '0' => 'Default',
+         '1' => 'Custom',
+     ),
+      '#default_value' => isset($this->options['lto_js']) ? $this->options['lto_js'] : '',
+      '#process' => array('views_process_dependency'),
+      '#dependency' => array('edit-options-lto-format' => array('9',)),
+    );
+    
+    $form['js_file'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Custom js file'),
+      '#description' => t('Path to the custom JS file inside your active theme. Only put the path and filename within your theme, not the path to your theme. For example, if your customized JS file is called mycustom.js and you have it in the main folder of your theme you would simply put mycustom.js in the textfield.'),
+      '#default_value' => isset($this->options['js_file']) ? $this->options['js_file'] : '',
+      '#process' => array('views_process_dependency'),
+      '#dependency' => array('edit-options-lto-js' => array('1',)),
+    );
+    
+    $form['expired_label'] = array(
+      '#type' => 'textfield',
+      '#title' => t('Label when expired'),
+      '#description' => t('Label to be used when offer is expired. Please choose somthing that fits the expiration time style.'),
+      '#default_value' => isset($this->options['expired_label']) ? $this->options['expired_label'] : 'Expired',
+    );
+ }
+
+  function pre_render($values) {
+    $value = $values->{$this->field_alias};
+    $time = time();
+    if ($value >= $time) {
+      $this->options['actual_label'] = (isset($this->options['expired_label'])?$this->options['expired_label']:'');
+      } else {
+      $this->options['actual_label'] = (isset($this->options['label'])?$this->options['label'] :'');
+      }
+    return;
+  }
+  
+  function label() {
+    return $this->options['actual_label'];
+  }
+
+  function render($values) {
+    $value = $values->{$this->field_alias};
+    $format = $this->options['lto_format'];
+    if (in_array($format, array('3', '6', ))) {
+      $date_format = ( $this->options['date_format'] ? $this->options['date_format'] : variable_get('uc_lto_time_format', 'M d, Y \a\t g:i a'));
+    } else {
+      $js_format = $this->options['lto_js'];
+      if ($js_format) { $js_file = $this->options['js_file'];}
+    }
+    
+    if (!$value) {
+      return theme('views_nodate');
+    } else {
+      $time = time();
+      $in = $value - $time;
+      if ($value >= $time) {
+        switch ($format) {
+           case 3:
+             return format_date($value, 'custom', $date_format);
+           break;
+           case 6:
+             return format_interval($in, variable_get('uc_lto_time_gran', 2));
+           break;
+           case 9:
+             drupal_add_js(array('ucLTO' => array(
+                                      'expiration' => $value + variable_get('date_default_timezone', 0),
+                                      'timeGran' => intval(variable_get('uc_lto_time_gran', 2)),
+                                      'doCountdown' => TRUE,
+                                      ),), 'setting');
+             drupal_add_js(drupal_get_path('module', 'uc_lto') . '/uc_lto_timers.js', 'module');
+             if ($js_format == 0) {
+               drupal_add_js(drupal_get_path('module', 'uc_lto') . '/uc_lto.js', 'module');
+             } else {
+               global $theme_key;
+               drupal_add_js(drupal_get_path('theme', $theme_key) . '/' . $js_file);
+             }
+      if ($in < 60) { 
+        $lto_class = 'uc-lto-expiration-min';
+      }
+      elseif ($in < 3600) {
+        $lto_class = 'uc-lto-expiration-hour';
+      }
+      elseif ($in < 86400) {
+        $lto_class = 'uc-lto-expiration-day';
+      }
+          // this html shouldn't be here'
+          return '<span class="uc-lto-expiration ' . $lto_class . '">' . format_interval($in, variable_get('uc_lto_time_gran', 2)) . '</span>';
+           break;
+         }
+  } else {
+    $open = FALSE;
+    return t('@time ago', array('@time' => format_interval($time - $value, variable_get('uc_lto_time_gran', 2))));
+  }
+  }
+ } 
+}

