If some images came into teaser this module wipe them - but this doesn't works for rss feed.

You need to test it with rss feeds

Comments

hunvreus’s picture

Will have a look this week, I also need to test the support with Views. Thanks for the feedback.

Eugene Fidelin’s picture

Priority: Critical » Normal

I find out how to solve this problem - a modify function teaserthumbnail_nodeapi and add code for 'rss item' operation

 /**
 * Implementation of hook_nodeapi().
 */
function teaserthumbnail_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
  $has_thumbnail = variable_get('teaserthumbnail_thumbnail_'.$node->type, 0);
  if ($has_thumbnail) {
    switch ($op) {
      case 'insert':
      case 'update':
        _teaserthumbnail_process($node, $node->body);
        break;
        
      case 'delete':
        db_query('DELETE FROM {teaserthumbnail} WHERE nid = %d', $node->nid);
        break;
        
      case 'load':
        // We add the thumbnail filepath as an attribute of the node so that we
        // can use it outside of the teaser (in a listing for ex.)
        $node->teaserthumbnail = _teaserthumbnail_get_thumbnail_source($node);
        break;

      case 'view':
        if ($a3) {
          // We add the thumbnail to the content with a low weight to ensure it
          // is displayed at the beginning
          $node->content['teaserthumbnail'] = array(
            '#value' => theme('teaserthumbnail_thumbnail', $node),
            '#weight' => -50,
          );
          // We then remove media (both flash and pictures) from the teaser
          $node->content['body']['#value'] = _teaserthumbnail_strip_media($node->content['body']['#value']);
        }
        break;

      case 'rss item':
        // Eugef: We then remove media (both flash and pictures) from the rss item and add thum image
        $node->teaser = theme('teaserthumbnail_thumbnail', $node) . _teaserthumbnail_strip_media($node->content['body']['#value']);
        break;
    }
  }
}

I test this code on my site http://interesno.name - you can see rss here http://interesno.name/rss.xml

hunvreus’s picture

I will test this out and put it in the latest version of the module.

hunvreus’s picture

Status: Active » Fixed

The latest version is being committed: support for ImageCache 2, as well as Views and RSS.

hunvreus’s picture

Status: Fixed » Closed (fixed)