Index: image_filter.info =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/image_filter/image_filter.info,v retrieving revision 1.1 diff -u -p -r1.1 image_filter.info --- image_filter.info 4 Feb 2007 01:38:00 -0000 1.1 +++ image_filter.info 17 Feb 2008 10:53:11 -0000 @@ -2,4 +2,6 @@ name = Image Filter description = "Allows users to reference images from other nodes." package = Image -dependencies = image +dependencies[] = image +core = "6.x" + Index: image_filter.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/image_filter/image_filter.module,v retrieving revision 1.26 diff -u -p -r1.26 image_filter.module --- image_filter.module 20 Oct 2007 20:17:15 -0000 1.26 +++ image_filter.module 17 Feb 2008 10:53:11 -0000 @@ -4,7 +4,8 @@ function image_filter_short_tip_translated() { return t( 'You may link to images on this site using a special syntax', -array('!explanation-url' => url('filter/tips', NULL, 'filter-image_filter-0'))); +//array('!explanation-url' => url('filter/tips', NULL, 'filter-image_filter-0'))); +array('!explanation-url' => url('filter/tips'))); } function image_filter_long_tip_translated() { @@ -128,10 +129,15 @@ function image_filter_process($text) { $img = NULL; - $result = db_query(db_rewrite_sql("SELECT n.nid, n.title, f.filename, f.filepath FROM {files} f, {node} n WHERE n.status = 1 AND f.filemime LIKE 'image/%%' AND f.nid = n.nid AND n.nid = %d" . (strlen($size) != 0 ? " AND f.filename IN ('" . db_escape_string($size) . "','_original')" : '')), $match[1]); +// $result = db_query(db_rewrite_sql("SELECT n.nid, n.title, f.filename, f.filepath FROM {files} f, {node} n WHERE n.status = 1 AND f.filemime LIKE 'image/%%' AND f.nid = n.nid AND n.nid = %d" . (strlen($size) != 0 ? " AND f.filename IN ('" . db_escape_string($size) . "','_original')" : '')), $match[1]); + $node = node_load($match[1], NULL, TRUE); // Loop over the files found for this image and select the best match. - while ($i = db_fetch_object($result)) { + //while ($i = db_fetch_object($result)) { + foreach( $node->images as $key => $img_path ) { + $i->filepath = $img_path; + $i->filename = $key; + $i->nid = $node->nid; $i->size = getimagesize(file_create_path($i->filepath)); if (! $img) { $img = $i; @@ -198,6 +204,18 @@ function image_filter_process($text) { } /** + * Drupal 6 theme hook to declared themeable links: + */ +function image_filter_theme() { + return array( + 'image_inline_img' => array( + 'arguments' => array('img'), + ), + ); +} + + +/** * Theme function to render image in a node. * Displays a thumbnail with a link to the image. */ @@ -216,7 +234,7 @@ function theme_image_inline_img($img) { ($img->class ? " class=\"$img->class\"" : '') . ($img->style ? " style=\"$img->style\"" : '') . " />"; if ($img->link) { - $imgtag = l($imgtag, $img->link, array(), NULL, NULL, TRUE, TRUE); + $imgtag = l($imgtag, $img->link, array( 'html' => TRUE )); } if (isset($img->caption)) { $imgtag = "