Here's an export of my alterations to the default comment view so it respects the moderation queue (doesn't show recent comments that are in moderation still), has proper empty text and exposes an additional moderation block:

$view = new view;
$view->name = 'comments_recent';
$view->description = 'Contains a block and a page to list recent comments; the block will automatically link to the page, which displays the comment body as well as a link to the node.';
$view->tag = 'default';
$view->view_php = '';
$view->base_table = 'comments';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('relationships', array(
  'nid' => array(
    'id' => 'nid',
    'table' => 'comments',
    'field' => 'nid',
    'label' => 'Node',
    'required' => FALSE,
  ),
));
$handler->override_option('fields', array(
  'subject' => array(
    'id' => 'subject',
    'table' => 'comments',
    'field' => 'subject',
    'label' => '',
    'link_to_comment' => 1,
    'relationship' => 'none',
  ),
  'timestamp' => array(
    'id' => 'timestamp',
    'table' => 'comments',
    'field' => 'timestamp',
    'label' => '',
    'date_format' => 'time ago',
    'custom_date_format' => '',
    'relationship' => 'none',
  ),
));
$handler->override_option('sorts', array(
  'timestamp' => array(
    'id' => 'timestamp',
    'table' => 'comments',
    'field' => 'timestamp',
    'order' => 'DESC',
    'granularity' => 'second',
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status_extra' => array(
    'id' => 'status_extra',
    'table' => 'node',
    'field' => 'status_extra',
    'operator' => '=',
    'value' => '',
    'group' => 0,
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'relationship' => 'nid',
  ),
  'status' => array(
    'operator' => '=',
    'value' => 0,
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'comments',
    'field' => 'status',
    'relationship' => 'none',
  ),
));
$handler->override_option('access', array(
  'type' => 'none',
  'role' => array(),
  'perm' => '',
));
$handler->override_option('title', 'Recent comments');
$handler->override_option('empty', 'No comments yet.');
$handler->override_option('empty_format', '1');
$handler->override_option('items_per_page', 5);
$handler->override_option('use_more', 1);
$handler->override_option('style_plugin', 'list');
$handler->override_option('style_options', array(
  'type' => 'ul',
));
$handler = $view->new_display('page', 'Page', 'page');
$handler->override_option('fields', array(
  'title' => array(
    'id' => 'title',
    'table' => 'node',
    'field' => 'title',
    'label' => 'Reply to',
    'relationship' => 'nid',
    'link_to_node' => 1,
  ),
  'timestamp' => array(
    'id' => 'timestamp',
    'table' => 'comments',
    'field' => 'timestamp',
    'label' => '',
    'date_format' => 'time ago',
    'custom_date_format' => '',
    'relationship' => 'none',
  ),
  'subject' => array(
    'id' => 'subject',
    'table' => 'comments',
    'field' => 'subject',
    'label' => '',
    'link_to_comment' => 1,
    'relationship' => 'none',
  ),
  'comment' => array(
    'id' => 'comment',
    'table' => 'comments',
    'field' => 'comment',
    'label' => '',
    'relationship' => 'none',
  ),
));
$handler->override_option('items_per_page', 25);
$handler->override_option('use_pager', '1');
$handler->override_option('row_options', array(
  'inline' => array(
    'title' => 'title',
    'timestamp' => 'timestamp',
  ),
  'separator' => ' ',
));
$handler->override_option('path', 'comments/recent');
$handler->override_option('menu', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
  'name' => 'navigation',
));
$handler->override_option('tab_options', array(
  'type' => 'none',
  'title' => '',
  'weight' => 0,
));
$handler = $view->new_display('block', 'Block', 'block');
$handler->override_option('block_description', 'Recent comments view');
$handler->override_option('block_caching', -1);
$handler = $view->new_display('block', 'Moderation Queue', 'block_1');
$handler->override_option('fields', array(
  'subject' => array(
    'id' => 'subject',
    'table' => 'comments',
    'field' => 'subject',
    'label' => '',
    'link_to_comment' => 1,
    'relationship' => 'none',
  ),
  'timestamp' => array(
    'id' => 'timestamp',
    'table' => 'comments',
    'field' => 'timestamp',
    'label' => '',
    'date_format' => 'time ago',
    'custom_date_format' => '',
    'relationship' => 'none',
  ),
  'comment' => array(
    'label' => '',
    'exclude' => 0,
    'id' => 'comment',
    'table' => 'comments',
    'field' => 'comment',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
  'delete_comment' => array(
    'label' => '',
    'text' => 'delete',
    'exclude' => 0,
    'id' => 'delete_comment',
    'table' => 'comments',
    'field' => 'delete_comment',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
  'edit_comment' => array(
    'label' => '',
    'text' => 'edit',
    'exclude' => 0,
    'id' => 'edit_comment',
    'table' => 'comments',
    'field' => 'edit_comment',
    'override' => array(
      'button' => 'Use default',
    ),
    'relationship' => 'none',
  ),
));
$handler->override_option('filters', array(
  'status_extra' => array(
    'id' => 'status_extra',
    'table' => 'node',
    'field' => 'status_extra',
    'operator' => '=',
    'value' => '',
    'group' => 0,
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'relationship' => 'nid',
  ),
  'status' => array(
    'operator' => '=',
    'value' => 1,
    'group' => '0',
    'exposed' => FALSE,
    'expose' => array(
      'operator' => FALSE,
      'label' => '',
    ),
    'id' => 'status',
    'table' => 'comments',
    'field' => 'status',
    'relationship' => 'none',
    'override' => array(
      'button' => 'Use default',
    ),
  ),
));
$handler->override_option('title', 'Comment moderation');
$handler->override_option('empty', 'No comments awaiting moderation.');
$handler->override_option('style_plugin', 'table');
$handler->override_option('style_options', array(
  'grouping' => '',
  'override' => 1,
  'sticky' => 0,
  'order' => 'asc',
  'columns' => array(
    'subject' => 'subject',
    'timestamp' => 'timestamp',
    'comment' => 'comment',
    'delete_comment' => 'delete_comment',
    'edit_comment' => 'edit_comment',
  ),
  'info' => array(
    'subject' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'timestamp' => array(
      'sortable' => 0,
      'separator' => '',
    ),
    'comment' => array(
      'separator' => '',
    ),
    'delete_comment' => array(
      'separator' => '',
    ),
    'edit_comment' => array(
      'separator' => '',
    ),
  ),
  'default' => '-1',
));
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);

Comments

mdupont’s picture

Status: Active » Closed (won't fix)

Old issue. This is a View so not related to Drupal core. And D6 is only receiving critical fixes now. Closing.