--- countdown.module	2007-09-07 11:15:20.000000000 -0400
+++ countdown_patched.module	2007-10-28 15:06:32.000000000 -0400
@@ -126,51 +126,58 @@ function countdown_block($op = 'list', $
   case 'view':
     if (user_access('access content')) {
       $block['subject'] = variable_get('countdown_block_title', t('Countdown'));
-      $time = time();
-      $difference = variable_get('countdown_timestamp', $time) - $time;
-      if ($difference < 0) {
-        $passed = 1;
-        $difference = abs($difference);
-      } else {
-        $passed = 0;
-      }
-
-      $accuracy  = variable_get('countdown_accuracy', 'd');
-      $days_left = floor($difference/60/60/24);
-      $hrs_left  = floor(($difference - $days_left*60*60*24)/60/60);
-      $min_left  = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60)/60);
-      $secs_left = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60 - $min_left*60));
-
-      $block['content'] .= t('%i days', array('%i' => $days_left));
-      if($accuracy == 'h' || $accuracy == 'm' || $accuracy == 's') {
-        $block['content'] .= t(', %i hours', array('%i' => $hrs_left));
-      }
-      if($accuracy == 'm' || $accuracy == 's') {
-        $block['content'] .= t(', %i minutes', array('%i' => $min_left));
-      }
-      if($accuracy == 's') {
-        $block['content'] .= t(', %i seconds', array('%i' => $secs_left));
-      }
-      $block['content'] .= t(($passed) ? ' since %s.' : ' until %s.', array('%s' => variable_get('countdown_event_name', '')));
-/*
-      $yrs_left  = floor($difference/31556926); // 31556926 seconds in a year
-      $months_left = floor(($difference%31556926)/2629744); // remainder of years into months - 2629744 seconds in month
-      $days_left = floor((($difference%31556926)%2629744)/86400); // remainder of months into days - 86400 seconds in a day
-      $hrs_left  = floor(((($difference%31556926)%2629744)%86400)/3600); // remainder of days into hours - 3600 seconds in an hour
-      $min_left  = floor((((($difference%31556926)%2629744)%86400)%3600)/60); // remainder of hours into minutes - 60 seconds in a minute
-      $secs_left = floor((((($difference%31556926)%2629744)%86400)%3600)%60); // remainder of minutes, already in seconds so no need to divide
-
-      $block['content'] .= t("%i years ", array('%i' => $yrs_left));
-      $block['content'] .= t("%i months ", array('%i' => $months_left));
-      $block['content'] .= t("%i days ", array('%i' => $days_left));
-      $block['content'] .= t("%i hours ", array('%i' => $hrs_left));
-      $block['content'] .= t("%i minutes ", array('%i' => $min_left));
-      $block['content'] .= t("%i seconds ", array('%i' => $secs_left));
-*/
+      
+      $block['content'] = theme('countdown_block');
+
       return $block;
     }
     break;
   }
 }
 
-?>
\ No newline at end of file
+
+function theme_countdown_block() {
+  $time = time();
+  $difference = variable_get('countdown_timestamp', $time) - $time;
+  if ($difference < 0) {
+    $passed = 1;
+    $difference = abs($difference);
+  } else {
+    $passed = 0;
+  }
+  $accuracy  = variable_get('countdown_accuracy', 'd');
+  $days_left = floor($difference/60/60/24);
+  $hrs_left  = floor(($difference - $days_left*60*60*24)/60/60);
+  $min_left  = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60)/60);
+  $secs_left = floor(($difference - $days_left*60*60*24 - $hrs_left*60*60 - $min_left*60));
+
+  $block = '';
+
+  $block .= t('%i days', array('%i' => $days_left));
+  if($accuracy == 'h' || $accuracy == 'm' || $accuracy == 's') {
+    $block .= t(', %i hours', array('%i' => $hrs_left));
+  }
+  if($accuracy == 'm' || $accuracy == 's') {
+    $block .= t(', %i minutes', array('%i' => $min_left));
+  }
+  if($accuracy == 's') {
+    $block .= t(', %i seconds', array('%i' => $secs_left));
+  }
+  $block .= t(($passed) ? ' since %s.' : ' until %s.', array('%s' => variable_get('countdown_event_name', '')));
+/*
+  $yrs_left  = floor($difference/31556926); // 31556926 seconds in a year
+  $months_left = floor(($difference%31556926)/2629744); // remainder of years into months - 2629744 seconds in month
+  $days_left = floor((($difference%31556926)%2629744)/86400); // remainder of months into days - 86400 seconds in a day
+  $hrs_left  = floor(((($difference%31556926)%2629744)%86400)/3600); // remainder of days into hours - 3600 seconds in an hour
+  $min_left  = floor((((($difference%31556926)%2629744)%86400)%3600)/60); // remainder of hours into minutes - 60 seconds in a minute
+  $secs_left = floor((((($difference%31556926)%2629744)%86400)%3600)%60); // remainder of minutes, already in seconds so no need to divide
+
+  $block .= t("%i years ", array('%i' => $yrs_left));
+  $block .= t("%i months ", array('%i' => $months_left));
+  $block .= t("%i days ", array('%i' => $days_left));
+  $block .= t("%i hours ", array('%i' => $hrs_left));
+  $block .= t("%i minutes ", array('%i' => $min_left));
+  $block .= t("%i seconds ", array('%i' => $secs_left));
+*/  
+  return $block;
+}
\ No newline at end of file
