Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery_jcarousel/theme/Attic/theme.inc,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 theme.inc
--- theme/theme.inc	22 Dec 2010 20:27:48 -0000	1.1.2.1
+++ theme/theme.inc	5 Jan 2011 00:19:33 -0000
@@ -27,3 +27,39 @@
   $output = $view->preview();
   return $output;
 }
+
+/**
+ * Theme function for rendering our imagecache thumbs.  Most of this was ripped from
+ * theme_imagecache_formatter_linked() in imagecache.module.
+ * 
+ * @param $element
+ * 
+ */
+function theme_imagecache_formatter_node_gallery_jcarousel_thumbnail_linked($element) {
+  
+  // Inside a view $element may contain NULL data. In that case, just return.
+  if (empty($element['#item']['fid'])) {
+    return '';
+  }
+
+  // Extract the preset name from the formatter name.
+  $presetname = substr($element['#formatter'], 0, strrpos($element['#formatter'], '_'));
+  $style = 'linked';
+
+  $item = $element['#item'];
+  $item['data']['alt'] = isset($item['data']['alt']) ? $item['data']['alt'] : '';
+  $item['data']['title'] = isset($item['data']['title']) ? $item['data']['title'] : NULL;
+
+  $imagetag = theme('imagecache', $presetname, $item['filepath'], $item['data']['alt'], $item['data']['title']);
+  $path = empty($item['nid']) ? '' : 'node/'. $item['nid'];
+  $class = "imagecache imagecache-$presetname imagecache-$style imagecache-{$element['#formatter']}";
+  
+  $options = array('attributes' => array('class' => $class), 'html' => TRUE);
+  $relationship = node_gallery_get_relationship(NULL, $element['#node']->node_type);
+  
+  if ($relationship['settings']['node_images_page_fragment']) {
+    $options['fragment'] = 'node-'. $element['#node']->nid;
+  }
+  return l($imagetag, $path, $options);
+  
+}
Index: node_gallery_jcarousel.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/node_gallery_jcarousel/node_gallery_jcarousel.module,v
retrieving revision 1.1.2.1
diff -u -r1.1.2.1 node_gallery_jcarousel.module
--- node_gallery_jcarousel.module	23 Dec 2010 03:20:55 -0000	1.1.2.1
+++ node_gallery_jcarousel.module	5 Jan 2011 00:19:33 -0000
@@ -84,6 +84,23 @@
 }
 
 /**
+ * Implementation of hook_theme_registry_alter().
+ *
+ * @param $theme_registry The entire cache of theme registry information, post-processing.
+ */
+function node_gallery_jcarousel_theme_registry_alter(&$theme_registry) {
+  $file = 'theme.inc';
+  $path = drupal_get_path('module', 'node_gallery_jcarousel') ."/theme";
+  
+  $theme_registry['imagecache_formatter_node-gallery-jcarousel-thumbnail_linked'] = array(
+    'function' => 'theme_imagecache_formatter_node_gallery_jcarousel_thumbnail_linked',
+    'arguments' => array('element' => NULL),
+    'path' => $path,
+    'file' => $file,
+  );
+}
+
+/**
  * Implementation of hook_help().
  *
  * @param $path A Drupal menu router path the help is being requested.
