Index: commentrss.module =================================================================== RCS file: /cvs/drupal/contributions/modules/commentrss/commentrss.module,v retrieving revision 1.12.2.2 diff -u -r1.12.2.2 commentrss.module --- commentrss.module 16 Jul 2007 04:19:11 -0000 1.12.2.2 +++ commentrss.module 10 Oct 2007 06:40:42 -0000 @@ -50,24 +50,24 @@ if (arg(0) == 'node' && is_numeric(arg(1)) && variable_get('commentrss_node', TRUE)) { $node = node_load(arg(1)); if ($node->nid && $node->comment != COMMENT_NODE_DISABLED) { - drupal_add_feed(url('crss/node/'. $node->nid), - t('Comments for @title', array('@title' => $node->title))); + commentrss_add_feed(url('crss/node/'. $node->nid), + t('Comments for @title', array('@title' => $node->title))); } } elseif (arg(0) == 'node' && variable_get('commentrss_site', TRUE)) { - drupal_add_feed(url('crss'), + commentrss_add_feed(url('crss'), t('@site - All comments', array('@site' => variable_get('site_name', 'Drupal')))); } elseif (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2)) && variable_get('commentrss_term', FALSE)) { $term = taxonomy_get_term(arg(2)); if ($term->tid) { - drupal_add_feed(url('crss/term/'. $term->tid), + commentrss_add_feed(url('crss/term/'. $term->tid), t('Comments for category "@title"', array('@title' => $term->name))); } } elseif (arg(0) == 'taxonomy' && arg(1) == 'vocabulary' && is_numeric(arg(2)) && variable_get('commentrss_node', FALSE)) { // vocabulary_list module is serving this page - drupal_add_feed(url('crss/vocab/'. arg(2)), t('Comments for this vocabulary')); + commentrss_add_feed(url('crss/vocab/'. arg(2)), t('Comments for this vocabulary')); } } return $items; @@ -275,6 +275,85 @@ '#title' => t('Node comments for a vocabulary'), '#default_value' => variable_get('commentrss_vocab', FALSE)); } + $form['commentrss_showheader'] = array('#type' => 'checkbox', + '#title' => t('Add feeds to header'), + '#default_value' => variable_get('commentrss_showheader', TRUE)); return system_settings_form($form); } + +/** + * Implementation of hook_block() + */ +function commentrss_block($op = 'list', $delta = 0, $edit = array()) { + switch ($op) { + + case 'list': + $blocks[0]['info'] = t('Commentrss: Block for comment rss feeds'); + return $blocks; + + case 'configure': + $form = array(); + return $form; + + case 'save': + return; + + case 'view': default: + switch ($delta) { + case 0: + $feeds = commentrss_get_feeds("\n", "