Index: lightbox2.formatter.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/lightbox2/Attic/lightbox2.formatter.inc,v
retrieving revision 1.1.2.16
diff -u -p -r1.1.2.16 lightbox2.formatter.inc
--- lightbox2.formatter.inc	5 Jan 2009 13:30:18 -0000	1.1.2.16
+++ lightbox2.formatter.inc	8 Jul 2009 17:45:44 -0000
@@ -52,6 +52,32 @@ function theme_lightbox2_formatter_image
 }
 
 /**
+ * Handler for Lightbox2 display of imagecache + imagefield CCK fields in compact view.
+ * This shows only the first image in a multiple imagefield but shows all images in the thickbox.
+ *
+ * @param $element
+ *   The CCK field element.
+ * @return
+ *   HTML output for displaying the image and link.
+ */
+function theme_lightbox2_compact_formatter_imagefield($element) {
+  if (!module_exists("imagecache") || !module_exists("imagefield")) {
+    return;
+  }
+
+  $field_name = $element['#field_name'];
+  $item = $element['#item'];
+  $formatter = $element['#formatter'];
+  $node = node_load($element['#item']['nid']);
+  
+  if (strpos($formatter, '__lightbox2_compact') !== FALSE) {
+    list($tmp, $lightbox_type, $view_preset, $lightbox_preset) = explode('__', $formatter, 4);
+    return lightbox2_imagefield_image_imagecache($field_name, $item, $formatter, $node, $view_preset, $lightbox_preset);
+  }
+}
+
+
+/**
  * Function to set up the data needed for
  * theme_imagefield_image_imagecache_lightbox2().
  *
@@ -103,6 +129,12 @@ function lightbox2_imagefield_image_imag
     elseif (strpos($formatter, '__lightframe2__') !== FALSE) {
       $rel = 'lightframe';
     }
+    
+    // Check if this is a compact display.
+    list($tmp, $lightbox_type, $tmp) = explode('__', $formatter, 3);
+    if ($lightbox_type == 'lightbox2_compact') {
+      $args['compact'] = TRUE;
+    }
     return theme('imagefield_image_imagecache_lightbox2', $view_preset, $field_name, $item, $node, $rel, $args);
   }
 }
@@ -225,9 +257,11 @@ function theme_imagefield_image_imagecac
     'rel' => $full_rel,
   );
 
-
   $attributes = array();
-  if ($view_preset == 'original') {
+  if (isset($args['compact']) && $item['#delta']) {
+    $image = '';
+  }
+  elseif ($view_preset == 'original') {
     $image = theme('lightbox2_image', $item['filepath'], $image_tag_alt, $image_tag_title, $attributes);
   }
   else {
Index: lightbox2.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/lightbox2/lightbox2.module,v
retrieving revision 1.16.2.16.2.147
diff -u -p -r1.16.2.16.2.147 lightbox2.module
--- lightbox2.module	8 Jan 2009 12:34:25 -0000	1.16.2.16.2.147
+++ lightbox2.module	8 Jul 2009 17:45:44 -0000
@@ -777,6 +777,10 @@ function lightbox2_field_formatter_info(
         'label' => 'Lightbox2: '. $view_rule .'->original',
         'field types' => array('image', 'filefield'),
       );
+      $lightbox['imagefield__lightbox2_compact__'. $view_rule .'__original'] = array(
+        'label' => 'Lightbox2: '. $view_rule .'->original Compact',
+        'field types' => array('image', 'filefield'),
+      );
       $slideshow['imagefield__lightshow2__original__'. $view_rule] = array(
         'label' => 'Lightbox2 slideshow: original->'. $view_rule,
         'field types' => array('image', 'filefield'),
@@ -910,6 +914,11 @@ function lightbox2_theme() {
         'function' => 'theme_lightbox2_formatter_imagefield',
         'file' => 'lightbox2.formatter.inc',
       );
+      $theme['lightbox2_formatter_imagefield__lightbox2_compact__'. $src['presetname'] .'__original'] = array(
+        'arguments' => array('element' => NULL),
+        'function' => 'theme_lightbox2_compact_formatter_imagefield',
+        'file' => 'lightbox2.formatter.inc',
+      );
       $theme['lightbox2_formatter_imagefield__lightshow2__'. $src['presetname'] .'__original'] = array(
         'arguments' => array('element' => NULL),
         'function' => 'theme_lightbox2_formatter_imagefield',
