--- og_calendar.module	2007-12-04 15:32:41.000000000 -0700
+++ og_calendar.module.fixed	2007-12-04 15:34:44.000000000 -0700
@@ -18,9 +18,7 @@ function og_calendar_block($op = 'list',
     if ( arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2) ) {
       $node = node_load(arg(1));
     }
-    $types = variable_get('og_node_types', array('og'));
-    foreach ($types as $type) {
-      if ($node->type == $type) {
+      if (og_is_group_type($node->type)) {
         $sql = "SELECT DISTINCT e.nid FROM {event} e INNER JOIN {node} n ON n.nid = e.nid WHERE e.event_start >= %d ORDER BY e.event_start";
         $result = db_query(db_rewrite_sql($sql, 'e', 'nid', array('og_nid' => $node->nid)), time() - (2 * 60 * 60));
         $limit = 6;
@@ -71,7 +69,6 @@ function og_calendar_block($op = 'list',
         $block['content'] = $output;
         return $block;
       }
-    }
   }
 }
 
