? teaserthumbnail.patch Index: teaserthumbnail.views.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/teaserthumbnail/teaserthumbnail.views.inc,v retrieving revision 1.3 diff -u -p -r1.3 teaserthumbnail.views.inc --- teaserthumbnail.views.inc 30 Jan 2009 16:18:36 -0000 1.3 +++ teaserthumbnail.views.inc 8 Nov 2009 11:23:59 -0000 @@ -5,7 +5,7 @@ */ function teaserthumbnail_views_data() { $data['teaserthumbnail']['table']['group'] = t('Node'); - + $data['teaserthumbnail']['table']['join'] = array( 'node' => array( 'left_field' => 'nid', @@ -20,6 +20,11 @@ function teaserthumbnail_views_data() { 'handler' => 'views_handler_field_teaserthumbnail', 'click sortable' => FALSE, ), + 'filter' => array( + 'handler' => 'views_handler_filter_boolean_operator_string', + 'label' => t('Has thumbnail'), + 'type' => 'yes-no', + ), ); return $data; Index: views/views_handler_field_teaserthumbnail.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/teaserthumbnail/views/views_handler_field_teaserthumbnail.inc,v retrieving revision 1.3 diff -u -p -r1.3 views_handler_field_teaserthumbnail.inc --- views/views_handler_field_teaserthumbnail.inc 21 Feb 2009 13:31:09 -0000 1.3 +++ views/views_handler_field_teaserthumbnail.inc 8 Nov 2009 11:23:59 -0000 @@ -1,5 +1,6 @@ !empty($this->options['link_to_node']), ); - $form['original_picture'] = array( + $form['original_picture'] = array( '#title' => t('Display original'), '#type' => 'checkbox', '#default_value' => !empty($this->options['original_picture']), @@ -30,7 +31,7 @@ class views_handler_field_teaserthumbnai foreach ($presets as $preset) { $options[$preset['presetname']] = $preset['presetname']; } - + $form['preset'] = array( '#type' => 'select', '#title' => t('Thumbnail preset'), @@ -42,21 +43,8 @@ class views_handler_field_teaserthumbnai function render($values) { $node = NULL; - $thumbnail = db_result(db_query("SELECT filepath FROM {teaserthumbnail} WHERE nid = %d", $values->nid)); - if (!empty($thumbnail)) { - if (empty($this->options['original_picture'])) { - if (empty($this->options['preset'])) { - $node->teaserthumbnail = $thumbnail; - $node->type = $values->type; - $thumbnail = theme('teaserthumbnail_thumbnail', $node); - } - else { - $thumbnail = theme('imagecache', $this->options['preset'], $thumbnail); - } - } - else { - $thumbnail = theme('image', $thumbnail); - } + if (!empty($values->{$this->field_alias})) { + $thumbnail = theme('imagecache', $this->options['preset'], $values->{$this->field_alias}); if (!empty($this->options['link_to_node'])) { return l($thumbnail, 'node/'. $values->nid, array('html' => TRUE)); } @@ -65,4 +53,4 @@ class views_handler_field_teaserthumbnai } } } -} \ No newline at end of file +}