I used aggregator & feedapi modules and created the external feed in a block - http://www.arisey.com/template. However I would like to clean up two things and add timestamp in terms of "xx days ago" :

1. There is a blue "blog it" button next to each feed item, how to eliminate this button button?
2. There is "more" link at the bottom of each block, how to get rid of this more link?
3 How to add timestamp in terms of "xx days ago"?

I looked at the aggregator module files and could not find "blog it" and "more" link. Can someone advise how to solve these problems? Many thanks for your help in advance.

Comments

wr5aw’s picture

To remove the blog it button from your feed items, you'll have to add a function to your template.php file within your theme folder. The following example is from a D6 install:

function yourthemename_aggregator_block_item($item, $feed = 0) {
  global $user;

  $output = '';
  if (FALSE && $user->uid && module_exists('blog') && user_access('create blog entries')) {
    if ($image = theme('image', 'misc/blog.png', t('blog it'), t('blog it'))) {
      $output .= '<div class="icon">'. l($image, 'node/add/blog', array('attributes' => array('title' => t('Comment on this news item in your personal blog.'), 'class' => 'blog-it'), 'query' => "iid=$item->iid", 'html' => TRUE)) .'</div>';
    }
  }

  // Display the external link to the item.
  $output .= '<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";

  return $output;
}

In the above example, I've left the original code intact and simply added a test for FALSE which always fails in an if statement. Optionally, you could just remove the entire nested if block like this:

function yourthemename_aggregator_block_item($item, $feed = 0) {
  // Display the external link to the item.
  $output = '<a href="'. check_url($item->link) .'">'. check_plain($item->title) ."</a>\n";

  return $output;
}
wr5aw’s picture

The -more- link is hard-coded into the aggregator_block() function in aggregator.module. One way to remove it is to use preg_replace within the hook_preprocess_block() function of template.php. Here's an example -

function w5pc_preprocess_block(&$vars, $hook) {
  if ($vars['block']->module == 'aggregator') {
    $pattern = '/<div class="more-link">.*<\/div>$/';
    $replacement = '';
    $content = trim($vars['block']->content);
    $content = preg_replace($pattern, $replacement, $content);
    $vars['block']->content = $content;
  }
}

The above code seems to work with a standard D6 install. Your mileage may vary.

erlingx’s picture

.more-link {
display:none;
}