Been trying to find a good RSS feed solution for 5.1, yours seems the easiest to grasp AND works with the feeds I want. Problem is, it displays the URL to the original post in a box that will "break" the formatting of the site. How can I remove this? Setting the length of URLs in the filtered and full HTML does absolutely nothing. Plus, since the URL is also available via the "Original Post" link, this just seems like a bit or redundancy. I have found the function definition (theme_simplefeed_item_node_view($values)) for this but I can't seem to track down where it is called. Thanks!

Comments

m3avrck’s picture

Status: Active » Fixed

Ok URLs have been fixed not to break themes.

I also updated the display, that information is *only* shown to users that can administer feeds, since it is used only by admins. Everyone else gets a clean display.

This is all overridable by copying this theme function into template.php and overriding it as well.

Anonymous’s picture

Status: Fixed » Closed (fixed)
Slim Pickens’s picture

The following hack to the simplefeed_item.module will remove the display of the feed item expiry details to administrative users:

/**
 * Implementation of hook_view().
 */
function simplefeed_item_view($node, $teaser = FALSE, $page = FALSE) {
  $node = node_prepare($node, $teaser);

  $node->content['simplefeed_item']['#theme'] = 'simplefeed_item_node_view';
  $node->content['simplefeed_item']['#weight'] = 2;
  $node->content['simplefeed_item']['url'] = array(
    '#value' => check_url($node->url),
    '#weight' => 1,
  );

/** 
  // since only administrators can edit when a feed item expires, only admins can see what this value is
  if (user_access('administer feeds')) {
    $node->content['simplefeed_item']['expires'] = array(
      '#value' => format_interval($node->expires),
      '#weight' => 2,
    );
  }
*/
  return $node;
}


/**
 * Theme the display of a feed node.
 */
function theme_simplefeed_item_node_view($values) {
  // needs to be a space so default values aren't outputed
  $output = ' ';
/**
  // since only administrators can edit when a feed item expires, only admins can see what this value is
  if (user_access('administer feeds')) {
    drupal_add_css(drupal_get_path('module', 'simplefeed') .'/simplefeed.css');

    $output = '<ul class="simplefeed-item">';
    // shorten really long URLs
    $output .= '<li><strong>URL:</strong> '. l(_filter_url_trim($values['url']['#value'], 48), $values['url']['#value']) .'</li>';
    $output .= '<li><strong>Expires:</strong> '. $values['expires']['#value'] .'</li>';
    $output .= '</ul>';
  }
*/
  return $output;
}