Index: /home/rcourtna/workspace/thruyou/drupal/sites/all/modules/og_calendar/og_calendar.module
===================================================================
--- /home/rcourtna/workspace/thruyou/drupal/sites/all/modules/og_calendar/og_calendar.module	(revision 367)
+++ /home/rcourtna/workspace/thruyou/drupal/sites/all/modules/og_calendar/og_calendar.module	(working copy)
@@ -18,9 +18,7 @@
     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 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;
@@ -70,7 +68,6 @@
         $block['subject'] = 'Group events';
         $block['content'] = $output;
         return $block;
-      }
     }
   }
 }

